OSID Logo
OSID Specifications
filing package
Version 3.1.0
Interfaceosid.filing.FileSystemManagementSession
Implementsosid.OsidSession
Used Byosid.filing.FilingManager
osid.filing.FilingProxyManager
Description

This session defines methods for operating on files and directories. This session is an expanded version of the DirectoryAdminSession that defines methods requiring path names for navigating a federation of directories as opposed to working within a single directory node.

The directory associated with this session is the current working directory and any relative path names provided are with respect to this directory. Absolute pathnames may be supplied outside this directory.

MethodgetDirectoryId
Description

Gets the Id of this directory.

Returnosid.id.Id the Id of this directory
Compliancemandatory This method must be implemented.
MethodgetDirectory
Description

Gets the directory associated with this session.

Returnosid.filing.Directory the directory associated with this session
ErrorsOPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanManageFiling
Description

Tests if this user can perform functions in this session. 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 to unauthorized users.

Returnboolean false if filing management methods are not authorized, true otherwise
Compliancemandatory This method must be implemented.
Methodoverwrite
Description

Overwrite files if a destination pathname exists.

Parametersbooleanoverwite true if files can be overwritten, false otherwise
Compliancemandatory This method is must be implemented.
MethodcreateMissingPaths
Description

Create any missing directories for a destination path that does not exist.

Parametersbooleancreate true if intermediate directories should be created, false otherwise
Compliancemandatory This method is must be implemented.
MethodmoveFile
Description

Moves a file to another path. The detination path may be a file or directory. If the destination is a file and exists, the destination is only replaced if overwrite() is true. If the destination is a directory and does not exist, the missing directories are only created if createMissingPaths() is true.

Parametersosid.id.Idsrc the source Id of the file
stringdst the destination name or path of the directory or file
ErrorsALREADY_EXISTS dst exists and overwrite() is false
INVALID_ARGUMENT src is not a file
NOT_FOUND src is not found, or the path to dst is not found and createMissingPaths() is false
NULL_ARGUMENT src or dst is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodmoveDirectory
Description

Moves a directory to another path. The destination must be a directory and if exists, the source directory is placed as a child to the given directory. If a path component in the destination does not exist, the path is created is createMissingPaths() is true.

Parametersosid.id.Idsrc the source Id of the directory
stringdst the destination name or path of the directory
ErrorsINVALID_ARGUMENT src is not a directory
NOT_FOUND src is not found, or the path to dst is not found and createMissingPaths() is false
NULL_ARGUMENT src or dst is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcopyFile
Description

Copies a file to another path. The detination path may be a file or directory. If the destination is a file and exists, the destination is only replaced if overwrite() is true. If the destination is a directory and does not exist, the missing directories are only created if createMissingPaths() is true.

Parametersosid.id.Idsrc the source Id of the file
stringdst the destination name or path of the directory or file
Returnosid.filing.File the new file
ErrorsALREADY_EXISTS dst exists and overwrite() is false
INVALID_ARGUMENT src is not a file
NOT_FOUND src is not found, or the path to dst is not found and createMissingPaths() is false
NULL_ARGUMENT src or dst is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcopyDirectory
Description

Copies a directory and all of its contents to another path. The destination must be a directory and if exists, the source directory is placed as a child to the given directory. If a path component in the destination does not exist, the path is created is createMissingPaths() is true.

Parametersosid.id.Idsrc the source Id of the directory
stringdst the destination name or path of the directory
Returnosid.filing.Directory the new file
ErrorsINVALID_ARGUMENT src is not a directory
NOT_FOUND src is not found, or the path to dst is not found and createMissingPaths() is false
NULL_ARGUMENT src or dst is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodlinkFile
Description

Creates a link from one file to another.

Parametersosid.id.IdfileId the Id of a file
stringlink the link path
Returnosid.filing.File the link
ErrorsALREADY_EXISTS link already exists
NOT_FOUND fileId is not found, or the path to link is not found and createMissingPaths() is false
NULL_ARGUMENT fileId or link is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodlinkDirectory
Description

Creates a link from one directory to another.

Parametersosid.id.IddirectoryId the Id of a directory
stringlink the destination path
Returnosid.filing.Directory the link
ErrorsALREADY_EXISTS link already exists
NOT_FOUND directoryId is not found, or the path to link is not found and createMissingPaths() is false
NULL_ARGUMENT directoryId or link is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.