Package io.datarouter.storage.file
Class PathService
java.lang.Object
io.datarouter.storage.file.PathService
@Singleton
public class PathService
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPathService.CheckedPathService -
Constructor Summary
Constructors Constructor Description PathService() -
Method Summary
Modifier and Type Method Description voiddelete(java.nio.file.Path fullPath)static java.lang.StringpathToString(java.nio.file.Path path)io.datarouter.scanner.Scanner<java.nio.file.Path>scanChildren(java.nio.file.Path fullPath, java.util.Set<java.lang.String> excluding, int limit, boolean sorted)io.datarouter.scanner.Scanner<java.nio.file.Path>scanDescendants(java.nio.file.Path fullPath, boolean includeDirectories, boolean sorted)Recursively scan directories, optionally sorting them in String ordering, since the filesystem may return them in any order, which is often the order that subdirectories were added to a parent.java.lang.Longsize(java.nio.file.Path path)
-
Constructor Details
-
PathService
public PathService()
-
-
Method Details
-
pathToString
public static java.lang.String pathToString(java.nio.file.Path path) -
scanChildren
public io.datarouter.scanner.Scanner<java.nio.file.Path> scanChildren(java.nio.file.Path fullPath, java.util.Set<java.lang.String> excluding, int limit, boolean sorted) -
scanDescendants
public io.datarouter.scanner.Scanner<java.nio.file.Path> scanDescendants(java.nio.file.Path fullPath, boolean includeDirectories, boolean sorted)Recursively scan directories, optionally sorting them in String ordering, since the filesystem may return them in any order, which is often the order that subdirectories were added to a parent.- Parameters:
fullPath- Path from the root of the filesystem or relative to the execution point.includeDirectories- False for results similar to an object store like S3 or GCSsorted- If true, sort each subdirectory before recursing, so that full paths match String sorting.- Returns:
-
size
public java.lang.Long size(java.nio.file.Path path) -
delete
public void delete(java.nio.file.Path fullPath)
-