org.ogf.saga.file
Interface File

All Superinterfaces:
Async, Cloneable, NSEntry, Permissions<NSEntry>, SagaObject

public interface File
extends NSEntry

The File interface represents an open file descriptor for reads/writes on a physical file. Errors result in an SagaIOException, not a POSIX error code.


Field Summary
 
Fields inherited from interface org.ogf.saga.SagaObject
NO_WAIT, WAIT_FOREVER
 
Method Summary
 long getSize()
          Returns the number of bytes in the file.
 Task<File,Long> getSize(TaskMode mode)
          Creates a task that obtains the number of bytes in the file.
 List<String> modesE()
          Lists the extended modes available in this implementation and/or on the server side.
 Task<File,List<String>> modesE(TaskMode mode)
          Creates a task that lists the extended modes available in this implementation and/or on the server side.
 int read(Buffer buffer)
          Reads up to the buffer's size from the file into the buffer.
 int read(Buffer buffer, int len)
          Reads up to len bytes from the file into the buffer.
 int read(Buffer buffer, int offset, int len)
          Reads up to len bytes from the file into the buffer, at the specified offset.
 Task<File,Integer> read(TaskMode mode, Buffer buffer)
          Creates a task that reads up to the buffer's size bytes from the file into the buffer.
 Task<File,Integer> read(TaskMode mode, Buffer buffer, int len)
          Creates a task that reads up to len bytes from the file into the buffer.
 Task<File,Integer> read(TaskMode mode, Buffer buffer, int offset, int len)
          Creates a task that reads up to len bytes from the file into the buffer at the specified buffer offset.
 int readE(String emode, String spec, Buffer buffer)
          Extended read.
 Task<File,Integer> readE(TaskMode mode, String emode, String spec, Buffer buffer)
          Creates a task for an extended read.
 int readP(String pattern, Buffer buffer)
          Pattern-based read.
 Task<File,Integer> readP(TaskMode mode, String pattern, Buffer buffer)
          Creates a task that does a pattern-based read.
 void readV(IOVec[] iovecs)
          Gather/scatter read.
 Task<File,Void> readV(TaskMode mode, IOVec[] iovecs)
          Creates a task that does a gather/scatter read.
 long seek(long offset, SeekMode whence)
          Repositions the current file position as requested.
 Task<File,Long> seek(TaskMode mode, long offset, SeekMode whence)
          Creates a task that repositions the current file position as requested.
 int sizeE(String emode, String spec)
          Determines the storage size required for an extended I/O operation.
 Task<File,Integer> sizeE(TaskMode mode, String emode, String spec)
          Creates a task that determines the storage size required for an extended I/O operation.
 int sizeP(String pattern)
          Determines the storage size required for a pattern I/O operation.
 Task<File,Integer> sizeP(TaskMode mode, String pattern)
          Creates a task that determines the storage size required for a pattern I/O operation.
 int write(Buffer buffer)
          Writes up to the buffer's size bytes from the buffer to the file at the current file position.
 int write(Buffer buffer, int len)
          Writes up to len bytes from the buffer to the file at the current file position.
 int write(Buffer buffer, int offset, int len)
          Writes up to len bytes from the buffer at the specified buffer offset to the file at the current file position.
 Task<File,Integer> write(TaskMode mode, Buffer buffer)
          Creates a task that writes up to the buffer's size bytes from the buffer to the file at the current file position.
 Task<File,Integer> write(TaskMode mode, Buffer buffer, int len)
          Creates a task that writes up to len bytes from the buffer to the file at the current file position.
 Task<File,Integer> write(TaskMode mode, Buffer buffer, int offset, int len)
          Creates a task that writes up to len bytes from the buffer at the specified buffer offset to the file at the current file position.
 int writeE(String emode, String spec, Buffer buffer)
          Extended write.
 Task<File,Integer> writeE(TaskMode mode, String emode, String spec, Buffer buffer)
          Creates a task for an extended write.
 int writeP(String pattern, Buffer buffer)
          Pattern-based write.
 Task<File,Integer> writeP(TaskMode mode, String pattern, Buffer buffer)
          Creates a task that does a pattern-based write.
 void writeV(IOVec[] iovecs)
          Gather/scatter write.
 Task<File,Void> writeV(TaskMode mode, IOVec[] iovecs)
          Creates a task that does a gather/scatter write.
 
Methods inherited from interface org.ogf.saga.namespace.NSEntry
close, close, close, close, copy, copy, copy, copy, getCWD, getCWD, getMTime, getMTime, getName, getName, getURL, getURL, isDir, isDir, isEntry, isEntry, isLink, isLink, link, link, link, link, move, move, move, move, permissionsAllow, permissionsAllow, permissionsDeny, permissionsDeny, readLink, readLink, remove, remove, remove, remove
 
Methods inherited from interface org.ogf.saga.SagaObject
clone, getId, getSession
 
Methods inherited from interface org.ogf.saga.permissions.Permissions
getGroup, getGroup, getOwner, getOwner, permissionsAllow, permissionsAllow, permissionsCheck, permissionsCheck, permissionsDeny, permissionsDeny
 

Method Detail

getSize

long getSize()
             throws NotImplementedException,
                    AuthenticationFailedException,
                    AuthorizationFailedException,
                    PermissionDeniedException,
                    IncorrectStateException,
                    TimeoutException,
                    NoSuccessException
Returns the number of bytes in the file.

Returns:
the size.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
IncorrectStateException - is thrown when the Directory is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

read

int read(Buffer buffer,
         int len)
         throws NotImplementedException,
                AuthenticationFailedException,
                AuthorizationFailedException,
                PermissionDeniedException,
                BadParameterException,
                IncorrectStateException,
                TimeoutException,
                NoSuccessException,
                SagaIOException
Reads up to len bytes from the file into the buffer. Returns the number of bytes read, or 0 at end-of-file. Note: this call is blocking. The async version can be used to implement non-blocking reads.

Parameters:
buffer - the buffer to read data into.
len - the number of bytes to be read.
Returns:
the number of bytes read
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened WriteOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown if the provided buffer is not large enough to hold the required length.
IncorrectStateException - is thrown when the File is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on read failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

read

int read(Buffer buffer,
         int offset,
         int len)
         throws NotImplementedException,
                AuthenticationFailedException,
                AuthorizationFailedException,
                PermissionDeniedException,
                BadParameterException,
                IncorrectStateException,
                TimeoutException,
                NoSuccessException,
                SagaIOException
Reads up to len bytes from the file into the buffer, at the specified offset. Returns the number of bytes read, or 0 at end-of-file. Note: this call is blocking. The async version can be used to implement non-blocking reads.

Parameters:
buffer - the buffer to read data into.
offset - the offset in the buffer.
len - the number of bytes to be read.
Returns:
the number of bytes read.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened WriteOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown if the provided buffer is not large enough to hold the required length.
IncorrectStateException - is thrown when the File is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on read failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

read

int read(Buffer buffer)
         throws NotImplementedException,
                AuthenticationFailedException,
                AuthorizationFailedException,
                PermissionDeniedException,
                BadParameterException,
                IncorrectStateException,
                TimeoutException,
                NoSuccessException,
                SagaIOException
Reads up to the buffer's size from the file into the buffer. Returns the number of bytes read, or 0 at end-of-file. Note: this call is blocking. The async version can be used to implement non-blocking reads.

Parameters:
buffer - the buffer to read data into.
Returns:
the number of bytes read.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened WriteOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown if the provided buffer is not large enough to hold the required length.
IncorrectStateException - is thrown when the File is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on read failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

write

int write(Buffer buffer,
          int offset,
          int len)
          throws NotImplementedException,
                 AuthenticationFailedException,
                 AuthorizationFailedException,
                 PermissionDeniedException,
                 BadParameterException,
                 IncorrectStateException,
                 TimeoutException,
                 NoSuccessException,
                 SagaIOException
Writes up to len bytes from the buffer at the specified buffer offset to the file at the current file position. Returns the number of bytes written.

Parameters:
buffer - the buffer to write data from.
offset - the buffer offset.
len - the number of bytes to be written.
Returns:
the number of bytes written.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened ReadOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown if the provided buffer is not large enough to hold the specified length.
IncorrectStateException - is thrown when the File is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on write failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

write

int write(Buffer buffer,
          int len)
          throws NotImplementedException,
                 AuthenticationFailedException,
                 AuthorizationFailedException,
                 PermissionDeniedException,
                 BadParameterException,
                 IncorrectStateException,
                 TimeoutException,
                 NoSuccessException,
                 SagaIOException
Writes up to len bytes from the buffer to the file at the current file position. Returns the number of bytes written.

Parameters:
buffer - the buffer to write data from.
len - the number of bytes to be written.
Returns:
the number of bytes written.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened ReadOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown if the provided buffer is not large enough to hold the specified length.
IncorrectStateException - is thrown when the File is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on write failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

write

int write(Buffer buffer)
          throws NotImplementedException,
                 AuthenticationFailedException,
                 AuthorizationFailedException,
                 PermissionDeniedException,
                 BadParameterException,
                 IncorrectStateException,
                 TimeoutException,
                 NoSuccessException,
                 SagaIOException
Writes up to the buffer's size bytes from the buffer to the file at the current file position. Returns the number of bytes written.

Parameters:
buffer - the buffer to write data from.
Returns:
the number of bytes written.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened ReadOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown if the provided buffer is not large enough to hold the specified length.
IncorrectStateException - is thrown when the File is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on write failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

seek

long seek(long offset,
          SeekMode whence)
          throws NotImplementedException,
                 AuthenticationFailedException,
                 AuthorizationFailedException,
                 PermissionDeniedException,
                 IncorrectStateException,
                 TimeoutException,
                 NoSuccessException,
                 SagaIOException
Repositions the current file position as requested.

Parameters:
offset - offset in bytes to move pointer.
whence - determines from where the offset is relative.
Returns:
the position after the seek.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
IncorrectStateException - is thrown when the File is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on seek failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

readV

void readV(IOVec[] iovecs)
           throws NotImplementedException,
                  AuthenticationFailedException,
                  AuthorizationFailedException,
                  PermissionDeniedException,
                  BadParameterException,
                  IncorrectStateException,
                  TimeoutException,
                  NoSuccessException,
                  SagaIOException
Gather/scatter read.

Parameters:
iovecs - array of IOVecs determining how much to read and where to store it.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened WriteOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown if the provided buffer is not large enough to hold the required length.
IncorrectStateException - is thrown when the File is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on read failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

writeV

void writeV(IOVec[] iovecs)
            throws NotImplementedException,
                   AuthenticationFailedException,
                   AuthorizationFailedException,
                   PermissionDeniedException,
                   BadParameterException,
                   IncorrectStateException,
                   TimeoutException,
                   NoSuccessException,
                   SagaIOException
Gather/scatter write.

Parameters:
iovecs - array of IOVecs determining how much to write and where to obtain the data from.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened ReadOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown if the provided buffer is not large enough to hold the specified length.
IncorrectStateException - is thrown when the File is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on write failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

sizeP

int sizeP(String pattern)
          throws NotImplementedException,
                 AuthenticationFailedException,
                 AuthorizationFailedException,
                 IncorrectStateException,
                 PermissionDeniedException,
                 BadParameterException,
                 TimeoutException,
                 NoSuccessException
Determines the storage size required for a pattern I/O operation.

Parameters:
pattern - to determine size for.
Returns:
the size.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown when the pattern cannot be parsed.
IncorrectStateException - is thrown when the File is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

readP

int readP(String pattern,
          Buffer buffer)
          throws NotImplementedException,
                 AuthenticationFailedException,
                 AuthorizationFailedException,
                 PermissionDeniedException,
                 BadParameterException,
                 IncorrectStateException,
                 TimeoutException,
                 NoSuccessException,
                 SagaIOException
Pattern-based read.

Parameters:
pattern - specification for the read operation.
buffer - to store data into.
Returns:
number of succesfully read bytes.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened WriteOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown when the pattern cannot be parsed.
IncorrectStateException - is thrown when the File is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on read failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

writeP

int writeP(String pattern,
           Buffer buffer)
           throws NotImplementedException,
                  AuthenticationFailedException,
                  AuthorizationFailedException,
                  PermissionDeniedException,
                  BadParameterException,
                  IncorrectStateException,
                  TimeoutException,
                  NoSuccessException,
                  SagaIOException
Pattern-based write.

Parameters:
pattern - specification for the write operation.
buffer - to be written.
Returns:
number of succesfully written bytes.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened ReadOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown when the pattern cannot be parsed.
IncorrectStateException - is thrown when the File is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on write failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

modesE

List<String> modesE()
                    throws NotImplementedException,
                           AuthenticationFailedException,
                           AuthorizationFailedException,
                           PermissionDeniedException,
                           IncorrectStateException,
                           TimeoutException,
                           NoSuccessException
Lists the extended modes available in this implementation and/or on the server side.

Returns:
list of available modes.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
IncorrectStateException - is thrown when the File is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

sizeE

int sizeE(String emode,
          String spec)
          throws NotImplementedException,
                 AuthenticationFailedException,
                 AuthorizationFailedException,
                 IncorrectStateException,
                 PermissionDeniedException,
                 BadParameterException,
                 TimeoutException,
                 NoSuccessException
Determines the storage size required for an extended I/O operation.

Parameters:
emode - extended mode to use.
spec - to determine size for.
Returns:
the size.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown when the emode is not supported or the spec cannot be parsed.
IncorrectStateException - is thrown when the File is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

readE

int readE(String emode,
          String spec,
          Buffer buffer)
          throws NotImplementedException,
                 AuthenticationFailedException,
                 AuthorizationFailedException,
                 PermissionDeniedException,
                 BadParameterException,
                 IncorrectStateException,
                 TimeoutException,
                 NoSuccessException,
                 SagaIOException
Extended read.

Parameters:
emode - extended mode to use.
spec - specification of read operation.
buffer - to store the data read.
Returns:
the number of successfully read bytes.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened WriteOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown when the emode is not supported or the spec cannot be parsed.
IncorrectStateException - is thrown when the File is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on read failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

writeE

int writeE(String emode,
           String spec,
           Buffer buffer)
           throws NotImplementedException,
                  AuthenticationFailedException,
                  AuthorizationFailedException,
                  PermissionDeniedException,
                  BadParameterException,
                  IncorrectStateException,
                  TimeoutException,
                  NoSuccessException,
                  SagaIOException
Extended write.

Parameters:
emode - extended mode to use.
spec - specification of write operation.
buffer - data to write.
Returns:
the number of successfully written bytes.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened ReadOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown when the emode is not supported or the spec cannot be parsed.
IncorrectStateException - is thrown when the File is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on write failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

getSize

Task<File,Long> getSize(TaskMode mode)
                        throws NotImplementedException
Creates a task that obtains the number of bytes in the file. This is the task version.

Parameters:
mode - the task mode.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

read

Task<File,Integer> read(TaskMode mode,
                        Buffer buffer,
                        int offset,
                        int len)
                        throws NotImplementedException
Creates a task that reads up to len bytes from the file into the buffer at the specified buffer offset. The number returned by the task is the number of bytes read, or 0 at end-of-file.

Parameters:
mode - the task mode.
offset - the buffer offset.
len - the number of bytes to be read.
buffer - the buffer to read data into.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

read

Task<File,Integer> read(TaskMode mode,
                        Buffer buffer,
                        int len)
                        throws NotImplementedException
Creates a task that reads up to len bytes from the file into the buffer. The number returned by the task is the number of bytes read, or 0 at end-of-file.

Parameters:
mode - the task mode.
len - the number of bytes to be read.
buffer - the buffer to read data into.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

read

Task<File,Integer> read(TaskMode mode,
                        Buffer buffer)
                        throws NotImplementedException
Creates a task that reads up to the buffer's size bytes from the file into the buffer. The number returned by the task is the number of bytes read, or 0 at end-of-file.

Parameters:
mode - the task mode.
buffer - the buffer to read data into.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

write

Task<File,Integer> write(TaskMode mode,
                         Buffer buffer,
                         int offset,
                         int len)
                         throws NotImplementedException
Creates a task that writes up to len bytes from the buffer at the specified buffer offset to the file at the current file position. The number returned by the task is the number of bytes written.

Parameters:
mode - the task mode.
offset - the buffer offset.
len - the number of bytes to be written.
buffer - the buffer to write data from.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

write

Task<File,Integer> write(TaskMode mode,
                         Buffer buffer,
                         int len)
                         throws NotImplementedException
Creates a task that writes up to len bytes from the buffer to the file at the current file position. The number returned by the task is the number of bytes written.

Parameters:
mode - the task mode.
len - the number of bytes to be written.
buffer - the buffer to write data from.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

write

Task<File,Integer> write(TaskMode mode,
                         Buffer buffer)
                         throws NotImplementedException
Creates a task that writes up to the buffer's size bytes from the buffer to the file at the current file position. The number returned by the task is the number of bytes written.

Parameters:
mode - the task mode.
buffer - the buffer to write data from.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

seek

Task<File,Long> seek(TaskMode mode,
                     long offset,
                     SeekMode whence)
                     throws NotImplementedException
Creates a task that repositions the current file position as requested. The number returned by the task is the new file position.

Parameters:
mode - the task mode.
offset - offset in bytes to move pointer.
whence - determines from where the offset is relative.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

readV

Task<File,Void> readV(TaskMode mode,
                      IOVec[] iovecs)
                      throws NotImplementedException
Creates a task that does a gather/scatter read.

Parameters:
mode - the task mode.
iovecs - array of IOVecs determining how much to read and where to store it.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

writeV

Task<File,Void> writeV(TaskMode mode,
                       IOVec[] iovecs)
                       throws NotImplementedException
Creates a task that does a gather/scatter write.

Parameters:
mode - the task mode.
iovecs - array of IOVecs determining how much to write and where to obtain the data from.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

sizeP

Task<File,Integer> sizeP(TaskMode mode,
                         String pattern)
                         throws NotImplementedException
Creates a task that determines the storage size required for a pattern I/O operation.

Parameters:
mode - the task mode.
pattern - to determine size for.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

readP

Task<File,Integer> readP(TaskMode mode,
                         String pattern,
                         Buffer buffer)
                         throws NotImplementedException
Creates a task that does a pattern-based read.

Parameters:
mode - the task mode.
pattern - specification for the read operation.
buffer - to store data into.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

writeP

Task<File,Integer> writeP(TaskMode mode,
                          String pattern,
                          Buffer buffer)
                          throws NotImplementedException
Creates a task that does a pattern-based write.

Parameters:
mode - the task mode.
pattern - specification for the write operation.
buffer - to be written.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

modesE

Task<File,List<String>> modesE(TaskMode mode)
                               throws NotImplementedException
Creates a task that lists the extended modes available in this implementation and/or on the server side.

Parameters:
mode - the task mode.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

sizeE

Task<File,Integer> sizeE(TaskMode mode,
                         String emode,
                         String spec)
                         throws NotImplementedException
Creates a task that determines the storage size required for an extended I/O operation.

Parameters:
mode - the task mode.
emode - extended mode to use.
spec - to determine size for.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

readE

Task<File,Integer> readE(TaskMode mode,
                         String emode,
                         String spec,
                         Buffer buffer)
                         throws NotImplementedException
Creates a task for an extended read.

Parameters:
mode - the task mode.
emode - extended mode to use.
spec - specification of read operation.
buffer - to store the data read.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

writeE

Task<File,Integer> writeE(TaskMode mode,
                          String emode,
                          String spec,
                          Buffer buffer)
                          throws NotImplementedException
Creates a task for an extended write.

Parameters:
mode - the task mode.
emode - extended mode to use.
spec - specification of write operation.
buffer - data to write.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.


Copyright © 2014 Open Grid Forum. All rights reserved.