OSID Logo
OSID Specifications
filing package
Version 3.0.0
Release Candidate Preview
Interfaceosid.filing.FileSystemManagementSession
Implementsosid.OsidSession
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.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.
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
CompliancemandatoryThis method must be implemented.
Methodoverwrite
Description

Overwrite files if a destination pathname exists.

Parametersbooleanoverwite true if files can be overwritten, false otherwise
CompliancemandatoryThis 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
CompliancemandatoryThis 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.Idsrcthe source Id of the file
stringdstthe 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_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.Idsrcthe source Id of the directory
stringdstthe 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_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.Idsrcthe source Id of the file
stringdstthe destination name or path of the directory or file
Returnosid.filing.Filethe 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_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.Idsrcthe source Id of the directory
stringdstthe destination name or path of the directory
Returnosid.filing.Directorythe 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_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodlinkFile
Description

Creates a link from one file to another.

Parametersosid.id.IdfileIdthe Id of a file
stringlinkthe link path
Returnosid.filing.Filethe 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_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodlinkDirectory
Description

Creates a link from one directory to another.

Parametersosid.id.IddirectoryIdthe Id of a directory
stringlinkthe destination path
Returnosid.filing.Directorythe 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_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.