public interface FileDataset extends Dataset
Dataset.DatasetType
Modifier and Type | Method and Description |
---|---|
void |
addFile(String fileName,
String mode)
Adds a file with the specified permission "r", "w" or "rw" to this
dataset.
|
Collection<String> |
getFiles()
Retrieves the list of files in this dataset.
|
long |
getPosition(String fileName)
Retrieves the position of filePointer for the given dataset
|
long |
getSize(String fileName)
Returns the current size of the file in question
|
boolean |
hasFile(String fileName)
Checks to see if the file is part of a given dataset
|
int |
read(String fileName,
byte[] bytesToRead)
Attempts to read a set of bytes from the underlying file.
|
int |
read(String fileName,
ByteBuffer readBuffer)
Attempts to read a set of bytes from the underlying file.
|
void |
removeFile(String fileName)
Removes a file from this dataset.
|
void |
setPosition(String fileName,
long newPosition)
Sets the position of filePointer for one of the file in the given
dataset.
|
int |
write(String fileName,
byte[] bytesToWrite)
Writes a byte[] to a give file.
|
int |
write(String fileName,
ByteBuffer writeBuffer)
Write the specified Buffer to the file corresponding to the specified
file.
|
close, getDataAvailabilityNotifier, getDatasetIdentifier, getDatasetType, getDescription, getLastModificationTime, initializeDataset, isAvailable, isDataAvailable, isInitialized, supportsDataAvailabilityNotifications
long getSize(String fileName) throws DatasetException
fileName
- The name of the fileDatasetException
- If there are problems retrieving the FileChannel corresponding
to the fileIOException
- If there are IO problems in completing the operation.long getPosition(String fileName) throws DatasetException
fileName
- The name of the file.DatasetException
- If there are problems retrieving the FileChannel corresponding
to the fileIOException
- If there are IO problems in performing the operationvoid setPosition(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(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(String fileName, 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(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(String fileName, 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(String fileName, String mode) throws DatasetException
fileName
- The name of the filemode
- The permissions associated with this fileNullPointerException
- If the specified filename is NULLDatasetException
- If there are problems adding this filevoid removeFile(String fileName) throws DatasetException
fileName
- The name of the fileNullPointerException
- If the specified filename is NULLDatasetException
- If there are problems removing this fileboolean hasFile(String fileName)
fileName
- The name of the filetrue
if the file is a part of the dataset;
false
otherwise.Collection<String> getFiles()
Copyright © 2015. All rights reserved.