public interface FileDataset extends Dataset
Dataset.DatasetType| Modifier and Type | Method and Description |
|---|---|
void |
addFile(java.lang.String fileName,
java.lang.String mode)
Adds a file with the specified permission "r", "w" or "rw" to this
dataset.
|
java.util.Collection<java.lang.String> |
getFiles()
Retrieves the list of files in this dataset.
|
long |
getPosition(java.lang.String fileName)
Retrieves the position of filePointer for the given dataset
|
long |
getSize(java.lang.String fileName)
Returns the current size of the file in question
|
boolean |
hasFile(java.lang.String fileName)
Checks to see if the file is part of a given dataset
|
int |
read(java.lang.String fileName,
byte[] bytesToRead)
Attempts to read a set of bytes from the underlying file.
|
int |
read(java.lang.String fileName,
java.nio.ByteBuffer readBuffer)
Attempts to read a set of bytes from the underlying file.
|
void |
removeFile(java.lang.String fileName)
Removes a file from this dataset.
|
void |
setPosition(java.lang.String fileName,
long newPosition)
Sets the position of filePointer for one of the file in the given
dataset.
|
int |
write(java.lang.String fileName,
byte[] bytesToWrite)
Writes a byte[] to a give file.
|
int |
write(java.lang.String fileName,
java.nio.ByteBuffer writeBuffer)
Write the specified Buffer to the file corresponding to the specified
file.
|
close, getDataAvailabilityNotifier, getDatasetType, getDescription, getIdentifier, getLastModificationTime, initializeDataset, isAvailable, isDataAvailable, isInitialized, supportsDataAvailabilityNotificationsmarshalllong getSize(java.lang.String fileName)
throws DatasetException
fileName - The name of the fileDatasetException - If there are problems retrieving the FileChannel corresponding
to the filejava.io.IOException - If there are IO problems in completing the operation.long getPosition(java.lang.String fileName)
throws DatasetException
fileName - The name of the file.DatasetException - If there are problems retrieving the FileChannel corresponding
to the filejava.io.IOException - If there are IO problems in performing the operationvoid setPosition(java.lang.String fileName,
long newPosition)
throws DatasetException
fileName - The filenewPosition - The new position for the pointerDatasetException - If there are problems retrieving the FileChannel corresponding
to the fileint read(java.lang.String fileName,
byte[] bytesToRead)
throws DatasetException
fileName - The file to be readbytesToRead - The byte[] to be read intoDatasetException - If there are problems retrieving the FileChannel
corresponding to the fileint read(java.lang.String fileName,
java.nio.ByteBuffer readBuffer)
throws DatasetException
fileName - The file to be readreadBuffer - The buffer to be read intoDatasetException - If there are problems retrieving the FileChannel
corresponding to the fileint write(java.lang.String fileName,
byte[] bytesToWrite)
throws DatasetException
fileName - The file to be written tobytesToWrite - The byte[] to be written.DatasetException - If there are problems retrieving the FileChannel
corresponding to the fileint write(java.lang.String fileName,
java.nio.ByteBuffer writeBuffer)
throws DatasetException
fileName - The file to be written towriteBuffer - The buffer holding the bytes to be writtenDatasetException - If there are problems retrieving the FileChannel
corresponding to the filevoid addFile(java.lang.String fileName,
java.lang.String mode)
throws DatasetException
fileName - The name of the filemode - The permissions associated with this filejava.lang.NullPointerException - If the specified filename is NULLDatasetException - If there are problems adding this filevoid removeFile(java.lang.String fileName)
throws DatasetException
fileName - The name of the filejava.lang.NullPointerException - If the specified filename is NULLDatasetException - If there are problems removing this fileboolean hasFile(java.lang.String fileName)
fileName - The name of the filetrue if the file is a part of the dataset;
false otherwise.java.util.Collection<java.lang.String> getFiles()