public interface RawFileStore extends StatefulServiceInterface
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists()
Checks to see if a raw file exists with the file ID that the service was
initialized with.
|
Long |
getFileId()
Returns the current file id or null if none has been set.
|
byte[] |
read(long position,
int length)
Delegates to
FileBuffer |
OriginalFile |
save()
Saves the
OriginalFile associated with the service if it has
been modified. |
void |
setFileId(long fileId)
This method manages the state of the service.
|
long |
size()
Returns the size of the file on disk (not as stored in the database since
that value will only be updated on
save(). |
boolean |
truncate(long length)
Limits the size of a file to the given length.
|
void |
write(byte[] buf,
long position,
int length)
Delegates to
FileBuffer |
activate, close, getCurrentEventContext, passivateLong getFileId()
void setFileId(long fileId)
SecurityViolation.fileId - an OriginalFile id.boolean exists()
true if there is an accessible file within the
original file repository with the correct ID. Otherwise
false.ResourceError - if there is a problem accessing the file due to
permissions errors within the repository or any other I/O error.byte[] read(long position,
int length)
FileBufferlong size()
save(). If the file has not
yet been written to, and therefore does not exist, a
ResourceError will be thrown.boolean truncate(long length)
void write(byte[] buf,
long position,
int length)
FileBufferOriginalFile save()
OriginalFile associated with the service if it has
been modified. The returned valued should replace all instances of the
OriginalFile in the client.
If save has not been called, RawFileStore instances will save the
OriginalFile object associated with it on StatefulServiceInterface.close().
Version: 5.1.4-ice34-b55
Copyright © 2015 The University of Dundee & Open Microscopy Environment. All Rights Reserved.