Package ome.services.scripts
Class RepoFile
- java.lang.Object
-
- ome.services.scripts.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 newFile
and callsRepoFile(File, File)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
basename()
java.lang.String
dirname()
java.io.File
file()
java.lang.String
fullname()
java.lang.String
hash()
ome.model.enums.ChecksumAlgorithm
hasher()
long
length()
boolean
matches(java.io.File file)
static java.lang.String
norm(java.lang.String path)
Somewhat complicated method to turn any path into a unique like path rooted at "/".java.lang.String
toString()
-
-
-
Constructor Detail
-
RepoFile
public RepoFile(java.io.File root, java.lang.String path)
Assumes that path is relative under root, and constructs a newFile
and callsRepoFile(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()
-
hasher
public ome.model.enums.ChecksumAlgorithm hasher()
-
hash
public java.lang.String hash()
-
length
public long length()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-