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

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

CompliancemandatoryThis 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[]fileRecordTypesarray of file record types
Returnboolean true if File creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT fileRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetFileFormForCreate
Description

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

Parametersstringnamename of a file
osid.type.Type[]fileRecordTypesarray of file record types
Returnosid.filing.FileFormthe 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_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateFile
Description

Creates a new file in this directory.

Parametersosid.filing.FileFormfileFormthe file form
Returnosid.filing.Filethe new file
ErrorsILLEGAL_STATE fileForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT fileForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED fileForm did not originate from getFileFormForCreate()
CompliancemandatoryThis 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.FileFormthe file form
ErrorsNOT_FOUND fileId is not found
NULL_ARGUMENT fileId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateFile
Description

Updates an existing file.

Parametersosid.filing.FileFormfileFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE fileForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT fileForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED fileForm did not originate from getFileFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethoddeleteFile
Description

Deletes a file.

Parametersosid.id.IdfileIdthe Id of the file to delete
ErrorsNOT_FOUND fileId is not found
NULL_ARGUMENT fileId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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[]directoryRecordTypesarray of directory record types
Returnboolean true if Directory creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT directoryRecordTypes is null
CompliancemandatoryThis 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.

Parametersstringnamethe name of a subdirectory in this directory
osid.type.Type[]directoryRecordTypesarray of directory record types
Returnosid.filing.DirectoryFormthe directory form
ErrorsALREADY_EXISTSdirectory already exists and overwrite() is false
INVALID_ARGUMENT name is invalid
NULL_ARGUMENT name or directoryRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateDirectory
Description

Creates a new directory.

Parametersosid.filing.DirectoryFormdirectoryFormthe directory form
Returnosid.filing.Directorythe new directory
ErrorsILLEGAL_STATE directoryForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT directoryForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED directoryForm did not originate from getDirectoryFormForCreate()
CompliancemandatoryThis 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.DirectoryFormthe directory form
ErrorsNOT_FOUND directoryId is not found
NULL_ARGUMENT directoryId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateDirectory
Description

Updates an existing directory.

Parametersosid.filing.DirectoryFormdirectoryFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE directoryForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT directoryForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED directoryForm did not originate from getDirectoryFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethoddeleteDirectory
Description

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

Parametersosid.id.IddirectoryIdthe Id of the directory to delete
ErrorsNOT_FOUND directoryId is not found
NULL_ARGUMENT directoryId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodclearDirectory
Description

Deletes all files and subdirectories within the given directory.

Parametersosid.id.IddirectoryIdthe Id of the directory to delete
ErrorsNOT_FOUND directoryId is not found
NULL_ARGUMENT directoryId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.