Version: 5.4.10-ice35-b105

OmeroBlitz API
Home Previous Up Next Index

omero::grid::Repository

Overview

[ "ami" ] interface Repository

Client-accessible interface representing a single mount point on the server-side.

Derived Classes and Interfaces

ManagedRepository

Operation Index

root
Return the OriginalFile descriptor for this Repository.
mimetype
Returns the best-guess mimetype for the given path.
list
Returns a set of strings naming the files and directories in the directory denoted by an abstract pathname.
listFiles
Returns an array of abstract pathname objects denoting the files in the directory denoted by an abstract pathname.
register
Create an OriginalFile in the database for the given path.
file
Returns a special RawFileStore which permits only the operations set out in the options string ""wb"", ""a+"", etc.
pixels

Deprecated.

fileById
fileExists
Returns true if the file or path exists within the repository.
makeDir
Create a directory at the given path.
treeList
Similar to list but recursive and returns only primitive values for the file at each location.
deletePaths
Delete several individual paths.

Operations

model::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.

string mimetype(string path) throws ServerError

Returns the best-guess mimetype for the given path.

api::StringSet list(string path) throws ServerError

Returns a set of strings naming the files and directories in the directory denoted by an abstract pathname.

api::OriginalFileList listFiles(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 each model::OriginalFile instance.

model::OriginalFile register(string path, RString mimetype) throws ServerError

Create an OriginalFile in the database for the given path.

api::RawFileStore* file(string path, 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.

api::RawPixelsStore* pixels(string path) throws ServerError

may be wholly removed in next major version

api::RawFileStore* fileById(long id) throws ServerError

bool fileExists(string path) throws ServerError

Returns true if the file or path exists within the repository. In other words, if a call on `dirname path` to listFiles would return an object for this path.

void makeDir(string path, bool 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.

RMap treeList(string path) throws ServerError

Similar to list 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 returned RMap 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
}
}
}
}

cmd::Handle* deletePaths(api::StringArray paths, bool recursively, bool force) throws ServerError

Delete several individual paths. Internally, this converts all of the paths into a single cmd::Delete2 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.


Home Previous Up Next Index