org.ogf.saga.file
Interface Directory

All Superinterfaces:
Async, Cloneable, Iterable<URL>, NSDirectory, NSEntry, Permissions<NSEntry>, SagaObject

public interface Directory
extends NSDirectory

A Directory instance represents an open directory.


Field Summary
 
Fields inherited from interface org.ogf.saga.SagaObject
NO_WAIT, WAIT_FOREVER
 
Method Summary
 Task<Directory,Long> getSize(TaskMode mode, URL name)
          Creates a task that retrieves the number of bytes in the specified file.
 Task<Directory,Long> getSize(TaskMode mode, URL name, int flags)
          Creates a task that retrieves the number of bytes in the specified file.
 long getSize(URL name)
          Returns the number of bytes in the specified file.
 long getSize(URL name, int flags)
          Returns the number of bytes in the specified file.
 Task<Directory,Boolean> isFile(TaskMode mode, URL name)
          Creates a task that tests the name for being a directory entry.
 boolean isFile(URL name)
          Tests the name for being a directory entry.
 Task<Directory,Directory> openDirectory(TaskMode mode, URL name)
          Creates a task that creates a new Directory instance.
 Task<Directory,Directory> openDirectory(TaskMode mode, URL name, int flags)
          Creates a task that creates a new Directory instance.
 Directory openDirectory(URL name)
          Creates a new Directory instance.
 Directory openDirectory(URL name, int flags)
          Creates a new Directory instance.
 Task<Directory,File> openFile(TaskMode mode, URL name)
          Creates a task that creates a new File instance.
 Task<Directory,File> openFile(TaskMode mode, URL name, int flags)
          Creates a task that creates a new File instance.
 File openFile(URL name)
          Creates a new File instance.
 File openFile(URL name, int flags)
          Creates a new File instance.
 Task<Directory,FileInputStream> openFileInputStream(TaskMode mode, URL name)
          Creates a task that creates a new FileInputStream instance.
 FileInputStream openFileInputStream(URL name)
          Creates a new FileInputStream instance.
 Task<Directory,FileOutputStream> openFileOutputStream(TaskMode mode, URL name)
          Creates a task that creates a new FileOutputStream instance.
 Task<Directory,FileOutputStream> openFileOutputStream(TaskMode mode, URL name, boolean append)
          Creates a task that creates a new FileOutputStream instance.
 FileOutputStream openFileOutputStream(URL name)
          Creates a new FileOutputStream instance.
 FileOutputStream openFileOutputStream(URL name, boolean append)
          Creates a new FileOutputStream instance.
 
Methods inherited from interface org.ogf.saga.namespace.NSDirectory
changeDir, changeDir, copy, copy, copy, copy, copy, copy, copy, copy, exists, exists, find, find, find, find, getEntry, getEntry, getMTime, getMTime, getNumEntries, getNumEntries, isDir, isDir, isEntry, isEntry, isLink, isLink, link, link, link, link, link, link, link, link, list, list, list, list, list, list, list, list, makeDir, makeDir, makeDir, makeDir, move, move, move, move, move, move, move, move, open, open, open, open, openDir, openDir, openDir, openDir, permissionsAllow, permissionsAllow, permissionsAllow, permissionsAllow, permissionsAllow, permissionsAllow, permissionsAllow, permissionsAllow, permissionsDeny, permissionsDeny, permissionsDeny, permissionsDeny, permissionsDeny, permissionsDeny, permissionsDeny, permissionsDeny, readLink, readLink, remove, remove, remove, remove, remove, remove, remove, remove
 
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
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

getSize

long getSize(URL name,
             int flags)
             throws NotImplementedException,
                    IncorrectURLException,
                    AuthenticationFailedException,
                    AuthorizationFailedException,
                    PermissionDeniedException,
                    BadParameterException,
                    IncorrectStateException,
                    DoesNotExistException,
                    TimeoutException,
                    NoSuccessException
Returns the number of bytes in the specified file.

Parameters:
name - name of file to inspect.
flags - mode for operation.
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 specified URL contains an invalid entry name, or illegal flags are specified (the only legal flags are NONE and DEREFERENCE).
IncorrectStateException - is thrown when the Directory is already closed.
IncorrectURLException - is thrown when an implementation cannot handle the specified protocol, or that access to the specified entity via the given protocol is impossible.
DoesNotExistException - is thrown if the specified name does not exist.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

getSize

long getSize(URL name)
             throws NotImplementedException,
                    IncorrectURLException,
                    AuthenticationFailedException,
                    AuthorizationFailedException,
                    PermissionDeniedException,
                    BadParameterException,
                    IncorrectStateException,
                    DoesNotExistException,
                    TimeoutException,
                    NoSuccessException
Returns the number of bytes in the specified file.

Parameters:
name - name of file to inspect.
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 specified URL contains an invalid entry name.
IncorrectStateException - is thrown when the Directory is already closed.
IncorrectURLException - is thrown when an implementation cannot handle the specified protocol, or that access to the specified entity via the given protocol is impossible.
DoesNotExistException - is thrown if the specified name does not exist.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

isFile

boolean isFile(URL name)
               throws NotImplementedException,
                      IncorrectURLException,
                      DoesNotExistException,
                      AuthenticationFailedException,
                      AuthorizationFailedException,
                      PermissionDeniedException,
                      BadParameterException,
                      IncorrectStateException,
                      TimeoutException,
                      NoSuccessException
Tests the name for being a directory entry. Is an alias for NSDirectory.isEntry(org.ogf.saga.url.URL).

Parameters:
name - to be tested.
Returns:
true if the name represents a non-directory entry.
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 specified URL contains an invalid entry name.
IncorrectStateException - is thrown when the Directory is already closed.
IncorrectURLException - is thrown when an implementation cannot handle the specified protocol, or that access to the specified entity via the given protocol is impossible.
DoesNotExistException - is thrown if the specified name does not exist.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

openDirectory

Directory openDirectory(URL name,
                        int flags)
                        throws NotImplementedException,
                               IncorrectURLException,
                               AuthenticationFailedException,
                               AuthorizationFailedException,
                               PermissionDeniedException,
                               BadParameterException,
                               IncorrectStateException,
                               AlreadyExistsException,
                               DoesNotExistException,
                               TimeoutException,
                               NoSuccessException
Creates a new Directory instance.

Parameters:
name - directory to open.
flags - defining the operation modus.
Returns:
the opened directory instance.
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 specified URL does not point to a directory, or is an invalid directory name.
IncorrectStateException - is thrown when the Directory is already closed.
IncorrectURLException - is thrown if an implementation cannot handle the specified protocol, or that access to the specified entity via the given protocol is impossible.
AlreadyExistsException - is thrown if the specified URL already exists, and the CREATE and EXCLUSIVE flags are given.
DoesNotExistException - is thrown if the specified URL does not exist, and the CREATE flag is not given.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

openDirectory

Directory openDirectory(URL name)
                        throws NotImplementedException,
                               IncorrectURLException,
                               AuthenticationFailedException,
                               AuthorizationFailedException,
                               PermissionDeniedException,
                               BadParameterException,
                               IncorrectStateException,
                               AlreadyExistsException,
                               DoesNotExistException,
                               TimeoutException,
                               NoSuccessException
Creates a new Directory instance.

Parameters:
name - directory to open.
Returns:
the opened directory instance.
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 specified URL does not point to a directory, or is an invalid directory name.
IncorrectStateException - is thrown when the Directory is already closed.
IncorrectURLException - is thrown if an implementation cannot handle the specified protocol, or that access to the specified entity via the given protocol is impossible.
AlreadyExistsException - not thrown, but specified because a method may be invoked that can throw this exception, but will not in this case.
DoesNotExistException - is thrown if the specified URL does not exist.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

openFile

File openFile(URL name,
              int flags)
              throws NotImplementedException,
                     IncorrectURLException,
                     AuthenticationFailedException,
                     AuthorizationFailedException,
                     PermissionDeniedException,
                     BadParameterException,
                     IncorrectStateException,
                     AlreadyExistsException,
                     DoesNotExistException,
                     TimeoutException,
                     NoSuccessException
Creates a new File instance.

Parameters:
name - file to open.
flags - defining the operation modus.
Returns:
the opened file instance.
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 specified URL is an invalid file name.
IncorrectURLException - is thrown when an implementation cannot handle the specified protocol, or that access to the specified entity via the given protocol is impossible.
AlreadyExistsException - is thrown if the specified URL already exists, and the CREATE and EXCLUSIVE flags are given.
DoesNotExistException - is thrown if the specified URL does not exist, and the CREATE flag is not given.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
IncorrectStateException

openFile

File openFile(URL name)
              throws NotImplementedException,
                     IncorrectURLException,
                     AuthenticationFailedException,
                     AuthorizationFailedException,
                     PermissionDeniedException,
                     BadParameterException,
                     IncorrectStateException,
                     AlreadyExistsException,
                     DoesNotExistException,
                     TimeoutException,
                     NoSuccessException
Creates a new File instance.

Parameters:
name - file to open.
Returns:
the opened file instance.
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 specified URL is an invalid file name.
IncorrectURLException - is thrown when an implementation cannot handle the specified protocol, or that access to the specified entity via the given protocol is impossible.
AlreadyExistsException - is not thrown, but a method may be invoked that may throw it (but not in this case).
DoesNotExistException - is thrown if the specified URL does not exist.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
IncorrectStateException

openFileInputStream

FileInputStream openFileInputStream(URL name)
                                    throws NotImplementedException,
                                           IncorrectURLException,
                                           AuthenticationFailedException,
                                           AuthorizationFailedException,
                                           PermissionDeniedException,
                                           BadParameterException,
                                           IncorrectStateException,
                                           AlreadyExistsException,
                                           DoesNotExistException,
                                           TimeoutException,
                                           NoSuccessException
Creates a new FileInputStream instance.

Parameters:
name - file to open.
Returns:
the input stream.
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 specified URL is an invalid file name.
IncorrectURLException - is thrown when an implementation cannot handle the specified protocol, or that access to the specified entity via the given protocol is impossible.
AlreadyExistsException - is not thrown, but a method may be invoked that may throw it (but not in this case).
DoesNotExistException - is thrown if the specified URL does not exist.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
IncorrectStateException

openFileOutputStream

FileOutputStream openFileOutputStream(URL name)
                                      throws NotImplementedException,
                                             IncorrectURLException,
                                             AuthenticationFailedException,
                                             AuthorizationFailedException,
                                             PermissionDeniedException,
                                             BadParameterException,
                                             IncorrectStateException,
                                             AlreadyExistsException,
                                             DoesNotExistException,
                                             TimeoutException,
                                             NoSuccessException
Creates a new FileOutputStream instance.

Parameters:
name - file to open.
Returns:
the output stream.
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 specified URL points to a directory, or is an invalid entry name.
IncorrectStateException - is thrown when the NSDirectory is already closed.
IncorrectURLException - is thrown if an implementation cannot handle the specified protocol, or that access to the specified entity via the given protocol is impossible.
AlreadyExistsException - is not thrown, but a method may be invoked that may throw it (but not in this case).
DoesNotExistException - is thrown if the parent directory does not exist.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

openFileOutputStream

FileOutputStream openFileOutputStream(URL name,
                                      boolean append)
                                      throws NotImplementedException,
                                             IncorrectURLException,
                                             AuthenticationFailedException,
                                             AuthorizationFailedException,
                                             PermissionDeniedException,
                                             BadParameterException,
                                             IncorrectStateException,
                                             AlreadyExistsException,
                                             DoesNotExistException,
                                             TimeoutException,
                                             NoSuccessException
Creates a new FileOutputStream instance.

Parameters:
name - file to open.
append - when set, the stream appends to the file.
Returns:
the output stream.
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 specified URL points to a directory, or is an invalid entry name.
IncorrectStateException - is thrown when the NSDirectory is already closed.
IncorrectURLException - is thrown if an implementation cannot handle the specified protocol, or that access to the specified entity via the given protocol is impossible.
AlreadyExistsException - is not thrown, but a method may be invoked that may throw it (but not in this case).
DoesNotExistException - is thrown if the parent directory does not exist.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

getSize

Task<Directory,Long> getSize(TaskMode mode,
                             URL name,
                             int flags)
                             throws NotImplementedException
Creates a task that retrieves the number of bytes in the specified file.

Parameters:
mode - the task mode.
name - name of file to inspect.
flags - mode for operation.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

getSize

Task<Directory,Long> getSize(TaskMode mode,
                             URL name)
                             throws NotImplementedException
Creates a task that retrieves the number of bytes in the specified file.

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

isFile

Task<Directory,Boolean> isFile(TaskMode mode,
                               URL name)
                               throws NotImplementedException
Creates a task that tests the name for being a directory entry. Is an alias for NSDirectory.isEntry(org.ogf.saga.url.URL).

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

openDirectory

Task<Directory,Directory> openDirectory(TaskMode mode,
                                        URL name,
                                        int flags)
                                        throws NotImplementedException
Creates a task that creates a new Directory instance.

Parameters:
mode - the task mode.
name - directory to open.
flags - defining the operation modus.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

openDirectory

Task<Directory,Directory> openDirectory(TaskMode mode,
                                        URL name)
                                        throws NotImplementedException
Creates a task that creates a new Directory instance.

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

openFile

Task<Directory,File> openFile(TaskMode mode,
                              URL name,
                              int flags)
                              throws NotImplementedException
Creates a task that creates a new File instance.

Parameters:
mode - the task mode.
name - file to open.
flags - defining the operation modus.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

openFile

Task<Directory,File> openFile(TaskMode mode,
                              URL name)
                              throws NotImplementedException
Creates a task that creates a new File instance.

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

openFileInputStream

Task<Directory,FileInputStream> openFileInputStream(TaskMode mode,
                                                    URL name)
                                                    throws NotImplementedException
Creates a task that creates a new FileInputStream instance.

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

openFileOutputStream

Task<Directory,FileOutputStream> openFileOutputStream(TaskMode mode,
                                                      URL name)
                                                      throws NotImplementedException
Creates a task that creates a new FileOutputStream instance.

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

openFileOutputStream

Task<Directory,FileOutputStream> openFileOutputStream(TaskMode mode,
                                                      URL name,
                                                      boolean append)
                                                      throws NotImplementedException
Creates a task that creates a new FileOutputStream instance.

Parameters:
mode - the task mode.
name - file to open.
append - when set, the file is opened for appending.
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.