Package omero.grid
Interface _RepositoryOperationsNC
-
- All Known Subinterfaces:
_ManagedRepositoryOperationsNC
,ManagedRepository
,Repository
- All Known Implementing Classes:
_ManagedRepositoryDisp
,_ManagedRepositoryTie
,_RepositoryDisp
,_RepositoryTie
public interface _RepositoryOperationsNC
Client-accessible interface representing a single mount point on the server-side.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HandlePrx
deletePaths(java.lang.String[] paths, boolean recursively, boolean force)
Delete several individual paths.RawFileStorePrx
file(java.lang.String path, java.lang.String mode)
Returns a special RawFileStore which permits only the operations set out in the options string ""wb"", ""a+"", etc.RawFileStorePrx
fileById(long id)
boolean
fileExists(java.lang.String path)
Returns true if the file or path exists within the repository.java.util.List<java.lang.String>
list(java.lang.String path)
Returns a set of strings naming the files and directories in the directory denoted by an abstract pathname.java.util.List<OriginalFile>
listFiles(java.lang.String path)
Returns an array of abstract pathname objects denoting the files in the directory denoted by an abstract pathname.void
makeDir(java.lang.String path, boolean parents)
Create a directory at the given path.java.lang.String
mimetype(java.lang.String path)
Returns the best-guess mimetype for the given path.OriginalFile
register(java.lang.String path, RString mimetype)
Create an OriginalFile in the database for the given path.OriginalFile
root()
Return the OriginalFile descriptor for this Repository.RMap
treeList(java.lang.String path)
Similar tolist
but recursive and returns only primitive values for the file at each location.
-
-
-
Method Detail
-
root
OriginalFile root() throws ServerError
Return the OriginalFile descriptor for this Repository. It will have the path of the repository's root on the underlying filesystem.- Throws:
ServerError
-
mimetype
java.lang.String mimetype(java.lang.String path) throws ServerError
Returns the best-guess mimetype for the given path.- Throws:
ServerError
-
list
java.util.List<java.lang.String> list(java.lang.String path) throws ServerError
Returns a set of strings naming the files and directories in the directory denoted by an abstract pathname.- Throws:
ServerError
-
listFiles
java.util.List<OriginalFile> listFiles(java.lang.String path) throws ServerError
Returns an array of abstract pathname objects denoting the files in the directory denoted by an abstract pathname. It is expected that at a minimum the ""name"", ""path"", ""size"" and ""mtime"" attributes will be present for eachOriginalFile
instance.- Throws:
ServerError
-
register
OriginalFile register(java.lang.String path, RString mimetype) throws ServerError
Create an OriginalFile in the database for the given path.- Throws:
ServerError
-
file
RawFileStorePrx file(java.lang.String path, java.lang.String mode) throws ServerError
Returns a special RawFileStore which permits only the operations set out in the options string ""wb"", ""a+"", etc. FIXME: Initially only ""r"" and ""rw"" are supported as these are handled directly by RandomAccessFile and so don't break the current implementation. Any call to that tries to break the options will throw an ApiUsageException. If a file exists at the given path, a ValidationException will be thrown.- Throws:
ServerError
-
fileById
RawFileStorePrx fileById(long id) throws ServerError
- Throws:
ServerError
-
fileExists
boolean fileExists(java.lang.String path) throws ServerError
Returns true if the file or path exists within the repository. In other words, if a call on `dirname path` tolistFiles
would return an object for this path.- Throws:
ServerError
-
makeDir
void makeDir(java.lang.String path, boolean parents) throws ServerError
Create a directory at the given path. If parents is true, then all preceding paths will be generated and no exception will be thrown if the directory already exists. Otherwise, all parent directories must exist in both the DB and on the filesystem and be readable.- Throws:
ServerError
-
treeList
RMap treeList(java.lang.String path) throws ServerError
Similar tolist
but recursive and returns only primitive values for the file at each location. Guaranteed for each path is only the values id and mimetype. After a call to unwrap, the returnedRMap
for a call to treeList("/user_1/dir0") might look something like:{ "/user_1/dir0/file1.txt" : { "id":10, "mimetype": "binary", "size": 10000L }, "/user_1/dir0/dir1" : { "id": 100, "mimetype": "Directory", "size": 0L, "files": { "/user_1/dir0/dir1/file1indir.txt" : { "id": 1, "mimetype": "png", "size": 500 } } } }
- Throws:
ServerError
-
deletePaths
HandlePrx deletePaths(java.lang.String[] paths, boolean recursively, boolean force) throws ServerError
Delete several individual paths. Internally, this converts all of the paths into a singleDelete2
command and submits it. If a ""recursively"" is true, then directories will be searched and all of their contained files will be placed before them in the delete order. When the directory is removed from the database, it will removed from the filesystem if and only if it is empty. If ""recursively"" is false, then the delete will produce an error according to the ""force"" flag. If ""force"" is false, this method attempts the delete of all given paths in a single transaction, and any failure will cause the entire transaction to fail. If ""force"" is true, however, then all the other deletes will succeed. which could possibly leave dangling files within no longer extant directories.- Throws:
ServerError
-
-