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 class  PathService.CheckedPathService  
  • Constructor Summary

    Constructors 
    Constructor Description
    PathService()  
  • Method Summary

    Modifier and Type Method Description
    void delete​(java.nio.file.Path fullPath)  
    static java.lang.String pathToString​(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.Long size​(java.nio.file.Path path)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • 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 GCS
      sorted - 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)