public interface FileSystemSession extends OsidSession
This session defines methods for examining file systems. A
FileSystemSession
is associated with a directory that, unlike
other catalogs, behaves as the current directory path for supplying
relative path names. Absolute path names can be supplied to access any
file or directory in the file system.
This session defines the following views:
Generally, the comparative view should be used for most applications as it permits operation even if there is data out of sync. Some administrative applications may need to know whether it had retrieved an entire set of objects and may sacrifice some interoperability for the sake of precision using the plenary view.
Modifier and Type | Method and Description |
---|---|
boolean |
canLookupDirectoryEntries()
Tests if this user can perform entry lookups.
|
boolean |
exists(java.lang.String name)
Tests if a file, directory or alias name exists.
|
Directory |
getDirectory()
Gets the directory associated with this session.
|
Id |
getDirectoryId()
Gets the
Id of this directory. |
File |
getFile(java.lang.String name)
Gets a specified file or alias to the file by its name in the current
directory only.
|
FileList |
getFiles()
Gets the list of files and aliases to files in this directory.
|
FileList |
getFilesByName(java.lang.String name)
Gets a specified files and aliases to files for the given file name.
|
Directory |
getParentDirectory()
Gets the parent of the directory associated with this session.
|
DirectoryList |
getSubdirectories()
Gets the list of directories and aliases to directories in this
directory.
|
DirectoryList |
getSubdirectoriesByName(java.lang.String name)
Gets a specified directories and aliases to directories for the given
directory name.
|
Directory |
getSubdirectory(java.lang.String name)
Gets a specified directory or alias to the directory by its name in
the current directory only.
|
boolean |
hasParentDirectory()
Tests if the directory associated with this session has a parent
directory.
|
boolean |
isAlias(java.lang.String name)
Tests if a name exists and is an alias.
|
boolean |
isDirectory(java.lang.String name)
Tests if a name exists and is a directory or an alias to a directory.
|
boolean |
isFile(java.lang.String name)
Tests if a name exists and is a file or an alias to a file.
|
void |
useComparativeDirectoryView()
The returns from the lookup methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
useFederatedDirectoryView()
Federates the view for methods in this session.
|
void |
useIsolatedDirectoryView()
Isolates the view for methods in this session.
|
void |
usePlenaryDirectoryView()
A complete view of the file or directory returns is desired.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getDirectoryId()
Id
of this directory. Id
of this directorymandatory
- This method must be implemented. Directory getDirectory() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canLookupDirectoryEntries()
PERMISSION_DENIED.
This is intended as a hint to an
application that may opt not to offer lookup operations. false
if lookup methods are not authorized,
true
otherwisemandatory
- This method must be implemented. boolean hasParentDirectory()
true
if a parent exists, false
otherwisemandatory
- This method is must be implemented. Directory getParentDirectory() throws OperationFailedException, PermissionDeniedException
IllegalStateException
- hasParentDirectory()
is false
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void useComparativeDirectoryView()
mandatory
- This method is must be implemented. void usePlenaryDirectoryView()
mandatory
- This method is must be implemented. void useFederatedDirectoryView()
mandatory
- This method is must be implemented. void useIsolatedDirectoryView()
mandatory
- This method is must be implemented. boolean exists(java.lang.String name) throws OperationFailedException, PermissionDeniedException
name
- a file or directory name true
if the name exists, false
otherwiseNullArgumentException
- name
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. boolean isFile(java.lang.String name) throws OperationFailedException, PermissionDeniedException
name
- a file name true
if the name is a file, false
otherwiseNullArgumentException
- name
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. boolean isDirectory(java.lang.String name) throws OperationFailedException, PermissionDeniedException
name
- a file or directory name true
if the path is a directory, false
otherwiseNullArgumentException
- name
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. boolean isAlias(java.lang.String name) throws OperationFailedException, PermissionDeniedException
name
- a file or directory name true
if the path is an alias, false
otherwiseNullArgumentException
- name
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. File getFile(java.lang.String name) throws NotFoundException, OperationFailedException, PermissionDeniedException
getFilesByName().
name
- the name to the fileNotFoundException
- name
is not found or
is a directoryNullArgumentException
- name
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. FileList getFilesByName(java.lang.String name) throws OperationFailedException, PermissionDeniedException
getFile().
Is a federated view, this method returns a list of files by
the same name in descendant directories. In plenary mode, the returned
list contains all known files or an error results. Otherwise, the
returned list may contain only those files that are accessible through
this session.name
- the name of the fileNullArgumentException
- name
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. FileList getFiles() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. Directory getSubdirectory(java.lang.String name) throws NotFoundException, OperationFailedException, PermissionDeniedException
getDirectoriesByName().
name
- the name of the directoryNotFoundException
- name
is not found or
is a fileNullArgumentException
- name
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DirectoryList getSubdirectoriesByName(java.lang.String name) throws OperationFailedException, PermissionDeniedException
getDirectory().
Is a federated view, this method returns a
list of directories by the same name in descedent directories. In
plenary mode, the returned list contains all known files or an error
results. Otherwise, the returned list may contain only those files
that are accessible through this session.name
- the name of the fileNullArgumentException
- name
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DirectoryList getSubdirectories() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.