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

This session creates and removes files and directories under the directory associated with this session.

The view of the administrative methods defined in this session is determined by the provider. For an instance of this session where no path has been specified, it may not be parallel to the DirectoryLookupSession. For example, a default DirectoryLookupSession may view the entire directory hierarchy while the default DirectoryAdminSession uses an isolated Directory to create new entries. Another scenario is a federated provider who does not wish to permit administrative operations for the federation unaware.

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.
MethodcanModifyDirectory
Description

Tests if this user can create or remove entries in this directory. A return of true does not guarantee successful authorization. A return of false indicates that it is known modifying this directory will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.

Returnboolean false if modifying this directory is not authorized, true otherwise
Compliancemandatory This method must be implemented.
Methodoverwrite
Description

Overwrite files if a destination pathname exists and is a file.

Compliancemandatory This method is must be implemented.
MethodcanCreateFileWithRecordTypes
Description

Tests if this user can create a single File using the desired record types. While FilingManager.getFileRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific File. Providing an empty array tests if a File can be created with no records.

Parametersosid.type.Type[]fileRecordTypes array of file record types
Returnboolean true if File creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT fileRecordTypes is null
Compliancemandatory This method must be implemented.
MethodgetFileFormForCreate
Description

Gets the file form for creating new files. A new form should be requested for each create transaction.

Parametersstringname name of a file
osid.type.Type[]fileRecordTypes array of file record types
Returnosid.filing.FileForm the file form
ErrorsALREADY_EXISTS name already exists as a file in this direrctory and overwrite() is false
INVALID_ARGUMENT name is invalid
NULL_ARGUMENT name or fileRecordTypes is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED unable to get form for requested record types
Compliancemandatory This method must be implemented.
MethodcreateFile
Description

Creates a new file in this directory.

Parametersosid.filing.FileFormfileForm the file form
Returnosid.filing.File the new file
ErrorsILLEGAL_STATE fileForm already used in a create transaction
INVALID_ARGUMENT one or more of the form elements is invalid
NULL_ARGUMENT fileForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED fileForm did not originate from getFileFormForCreate()
Compliancemandatory This method must be implemented.
MethodgetFileFormForUpdate
Description

Gets the file form for updating an existing files. A new file form should be requested for each update transaction.

Parametersosid.id.IdfileId Id of the file to update
Returnosid.filing.FileForm the file form
ErrorsNOT_FOUND fileId is not found
NULL_ARGUMENT fileId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodupdateFile
Description

Updates an existing file.

Parametersosid.filing.FileFormfileForm the form containing the elements to be updated
ErrorsILLEGAL_STATE fileForm already used in an update transaction
INVALID_ARGUMENT the form contains an invalid value
NULL_ARGUMENT fileForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED fileForm did not originate from getFileFormForUpdate()
Compliancemandatory This method must be implemented.
MethoddeleteFile
Description

Deletes a file.

Parametersosid.id.IdfileId the Id of the file to delete
ErrorsNOT_FOUND fileId is not found
NULL_ARGUMENT fileId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanCreateDirectoryWithRecordTypes
Description

Tests if this user can create a single Directory using the desired record types. While FilingManager.getDiectoryRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Directory. Providing an empty array tests if a Directory can be created with no records.

Parametersosid.type.Type[]directoryRecordTypes array of directory record types
Returnboolean true if Directory creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT directoryRecordTypes is null
Compliancemandatory This method must be implemented.
MethodgetDirectoryFormForCreate
Description

Gets the file form for creating new directories. A new form should be requested for each create transaction. This method is used for creating new Directories where only the Directory Type is known.

Parametersstringname the name of a subdirectory in this directory
osid.type.Type[]directoryRecordTypes array of directory record types
Returnosid.filing.DirectoryForm the directory form
ErrorsALREADY_EXISTS directory already exists and overwrite() is false
INVALID_ARGUMENT name is invalid
NULL_ARGUMENT name or directoryRecordTypes is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED unable to get form for requested record types
Compliancemandatory This method must be implemented.
MethodcreateDirectory
Description

Creates a new directory.

Parametersosid.filing.DirectoryFormdirectoryForm the directory form
Returnosid.filing.Directory the new directory
ErrorsILLEGAL_STATE directoryForm already used in a create transaction
INVALID_ARGUMENT one or more of the form elements is invalid
NULL_ARGUMENT directoryForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED directoryForm did not originate from getDirectoryFormForCreate()
Compliancemandatory This method must be implemented.
MethodgetDirectoryFormForUpdate
Description

Gets the directory form for updating an existing files. A new directory form should be requested for each update transaction. This method is used when the Directory to be updated is known and is desired to access any metadata specific to the Directory being updated.

Parametersosid.id.IddirectoryId Id of the directory to update
Returnosid.filing.DirectoryForm the directory form
ErrorsNOT_FOUND directoryId is not found
NULL_ARGUMENT directoryId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodupdateDirectory
Description

Updates an existing directory.

Parametersosid.filing.DirectoryFormdirectoryForm the form containing the elements to be updated
ErrorsILLEGAL_STATE directoryForm already used in an update transaction
INVALID_ARGUMENT the form contains an invalid value
NULL_ARGUMENT directoryForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED directoryForm did not originate from getDirectoryFormForUpdate()
Compliancemandatory This method must be implemented.
MethoddeleteDirectory
Description

Deletes a directory in this directory. The directory to remove must be empty.

Parametersosid.id.IddirectoryId the Id of the directory to delete
ErrorsNOT_FOUND directoryId is not found
NULL_ARGUMENT directoryId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodclearDirectory
Description

Deletes all files and subdirectories within the given directory.

Parametersosid.id.IddirectoryId the Id of the directory to delete
ErrorsNOT_FOUND directoryId is not found
NULL_ARGUMENT directoryId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.