OSID Logo
OSID Specifications
filing package
Version 3.0.0
Release Candidate Preview
Interfaceosid.filing.FileSystemSession
Implementsosid.OsidSession
Description

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:

  • comparative view: elements may be silently omitted or re-ordered
  • plenary view: provides a complete result set or is an error condition
  • federated directory view: searches include entries in directories of which this directory is an ancestor
  • isolated directory view: lookups are restricted to entries in this directory only

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.

MethodgetDirectoryId
Description

Gets the Id of this directory.

Returnosid.id.Idthe Id of this directory
CompliancemandatoryThis method must be implemented.
MethodgetDirectory
Description

Gets the directory associated with this session.

Returnosid.filing.Directorythe directory associated with this session
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanLookupDirectoryEntries
Description

Tests if this user can perform entry lookups. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations.

Returnboolean false if lookup methods are not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodhasParentDirectory
Description

Tests if the directory associated with this session has a parent directory.

Returnboolean true if a parent exists, false otherwise
CompliancemandatoryThis method is must be implemented.
MethodgetParentDirectory
Description

Gets the parent of the directory associated with this session.

Returnosid.filing.Directorythe parent of the directory associated with this session
ErrorsILLEGAL_STATE hasParentDirectory() is false
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoduseComparativeDirectoryView
Description

The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error. This view is used when greater interoperability is desired at the expense of precision.

CompliancemandatoryThis method is must be implemented.
MethodusePlenaryDirectoryView
Description

A complete view of the file or directory returns is desired. Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability.

CompliancemandatoryThis method is must be implemented.
MethoduseFederatedDirectoryView
Description

Federates the view for methods in this session. A federated view will include entries in directories which are children of this directory.

CompliancemandatoryThis method is must be implemented.
MethoduseIsolatedDirectoryView
Description

Isolates the view for methods in this session. An isolated view restricts lookups to this directory only.

CompliancemandatoryThis method is must be implemented.
Methodexists
Description

Tests if a file, directory or alias name exists. In a federated view, the existence test is performed on this directory and any children of this directory. In an isolated view, the existence test is restrcited to this directory only.

Parametersstringnamea file or directory name
Returnboolean true if the name exists, false otherwise
ErrorsNULL_ARGUMENT name is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method is must be implemented.
MethodisFile
Description

Tests if a name exists and is a file or an alias to a file. In a federated view, the exietence test is performed on this directory and any children of this directory. In an isolated view, the existence test is restrcited to this directory only.

Parametersstringnamea file name
Returnboolean true if the name is a file, false otherwise
ErrorsNULL_ARGUMENT name is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method is must be implemented.
MethodisDirectory
Description

Tests if a name exists and is a directory or an alias to a directory. In a federated view, the exietence test is performed on this directory and any children of this directory. In an isolated view, the existence test is restrcited to this directory only.

Parametersstringnamea file or directory name
Returnboolean true if the path is a directory, false otherwise
ErrorsNULL_ARGUMENT name is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method is must be implemented.
MethodisAlias
Description

Tests if a name exists and is an alias. In a federated view, the exietence test is performed on this directory and any children of this directory. In an isolated view, the existence test is restrcited to this directory only.

Parametersstringnamea file or directory name
Returnboolean true if the path is an alias, false otherwise
ErrorsNULL_ARGUMENT name is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method is must be implemented.
MethodgetFile
Description

Gets a specified file or alias to the file by its name in the current directory only. For federated views, use getFilesByName().

Parametersstringnamethe name to the file
Returnosid.filing.Filethe file
ErrorsNOT_FOUND name is not found or is a directory
NULL_ARGUMENT name is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetFilesByName
Description

Gets a specified files and aliases to files for the given file name. In an isolated view, this method behaves like 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.

Parametersstringnamethe name of the file
Returnosid.filing.FileListthe list of files of the given name
ErrorsNULL_ARGUMENT name is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetFiles
Description

Gets the list of files and aliases to files in this directory. In a federated view, this method returns all files 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.

Returnosid.filing.FileListthe list of files in this directory
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetSubdirectory
Description

Gets a specified directory or alias to the directory by its name in the current directory only. For federated views, use getDirectoriesByName().

Parametersstringnamethe name of the directory
Returnosid.filing.Directorythe directory
ErrorsNOT_FOUND name is not found or is a file
NULL_ARGUMENT name is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetSubdirectoriesByName
Description

Gets a specified directories and aliases to directories for the given directory name. In an isolated view, this method behaves like 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.

Parametersstringnamethe name of the file
Returnosid.filing.DirectoryListthe list of files of the given name
ErrorsNULL_ARGUMENT name is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetSubdirectories
Description

Gets the list of directories and aliases to directories in this directory. In a federated view, this method returns all directories 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.

Returnosid.filing.DirectoryListthe list of directories in this directory
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.