OmeroBlitz API
Home Previous Up Next Index

omero::api::RawFileStore

Overview

[ "ami", "amd" ] interface RawFileStore extends StatefulServiceInterface

Raw file gateway which provides access to the OMERO file repository. Note: methods on this service are protected by a DOWNLOAD restriction.

Operation Index

setFileId
This method manages the state of the service.
getFileId
Returns the current file id or null if none has been set.
read
Reads length bytes of data at the position from the raw file into an array of bytes.
size
Returns the size of the file on disk (not as stored in the database since that value will only be updated on {@code save}.
truncate
Limits the size of a file to the given length.
write
Writes length bytes of data from the specified buf byte array starting at at position to the raw file.
exists
Checks to see if a raw file exists with the file ID that the service was initialized with.
save
Saves the model::OriginalFile associated with the service if it has been modified.

Operations

void setFileId(long fileId) throws ServerError

This method manages the state of the service. This method will throw a SecurityViolation if for the current user context either the file is not readable or a {@code omero.constants.permissions.BINARYACCESS} restriction is in place.

RLong getFileId() throws ServerError

Returns the current file id or null if none has been set.

::Ice::ByteSeq read(long position, int length) throws ServerError

Reads length bytes of data at the position from the raw file into an array of bytes.

long size() throws ServerError

Returns the size of the file on disk (not as stored in the database since that value will only be updated on {@code save}. If the file has not yet been written to, and therefore does not exist, a ResourceError will be thrown.

bool truncate(long length) throws ServerError

Limits the size of a file to the given length. If the file is already shorter than length, no action is taken in which case false is returned.

void write(::Ice::ByteSeq buf, long position, int length) throws ServerError

Writes length bytes of data from the specified buf byte array starting at at position to the raw file.

bool exists() throws ServerError

Checks to see if a raw file exists with the file ID that the service was initialized with.

Return Value

true if there is an accessible file within the original file repository with the correct ID. Otherwise false.

Exceptions

ResourceError
if there is a problem accessing the file due to permissions errors within the repository or any other I/O error.

model::OriginalFile save() throws ServerError

Saves the model::OriginalFile associated with the service if it has been modified. The returned valued should replace all instances of the model::OriginalFile in the client. If save has not been called, RawFileStore instances will save the model::OriginalFile object associated with it on {@code close}. See also ticket 1651 and ticket 2161.


Home Previous Up Next Index