Class RepoFile


  • public class RepoFile
    extends java.lang.Object
    File type wrapper for paths which are intended for being stored in the database as a part of this repository.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  RepoFile.FsFile
      File type wrapper for actual OS files.
    • Constructor Summary

      Constructors 
      Constructor Description
      RepoFile​(java.io.File root, java.io.File file)
      Both root and file are absolute paths to files.
      RepoFile​(java.io.File root, java.lang.String path)
      Assumes that path is relative under root, and constructs a new File and calls RepoFile(File, File)
    • Constructor Detail

      • RepoFile

        public RepoFile​(java.io.File root,
                        java.lang.String path)
        Assumes that path is relative under root, and constructs a new File and calls RepoFile(File, File)
      • RepoFile

        public RepoFile​(java.io.File root,
                        java.io.File file)
        Both root and file are absolute paths to files. This constructor calculates the relative part of the second argument based on the first.
    • Method Detail

      • norm

        public static java.lang.String norm​(java.lang.String path)
        Somewhat complicated method to turn any path into a unique like path rooted at "/".
        Parameters:
        path - Non-null;
        Returns:
        See above.
      • matches

        public boolean matches​(java.io.File file)
      • file

        public java.io.File file()
      • basename

        public java.lang.String basename()
      • dirname

        public java.lang.String dirname()
      • fullname

        public java.lang.String fullname()
      • hash

        public java.lang.String hash()
      • length

        public long length()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object