Interface FileSystemManagementSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can perform functions in this session.copyDirectory(Id src, String dst) Copies a directory and all of its contents to another path.Copies a file to another path.voidcreateMissingPaths(boolean create) Create any missing directories for a destination path that does not exist.Gets the directory associated with this session.Gets theIdof this directory.linkDirectory(Id directoryId, String link) Creates a link from one directory to another.Creates a link from one file to another.voidmoveDirectory(Id src, String dst) Moves a directory to another path.voidMoves a file to another path.voidoverwrite(boolean overwite) Overwrite files if a destination pathname exists.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getDirectoryId
Id getDirectoryId()Gets theIdof this directory.- Returns:
- the
Idof this directory - Compliance:
mandatory- This method must be implemented.
-
getDirectory
Gets the directory associated with this session.- Returns:
- the directory associated with this session
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageFiling
boolean canManageFiling()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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.- Returns:
falseif filing management methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
overwrite
void overwrite(boolean overwite) Overwrite files if a destination pathname exists.- Parameters:
overwite-trueif files can be overwritten,falseotherwise- Compliance:
mandatory- This method is must be implemented.
-
createMissingPaths
void createMissingPaths(boolean create) Create any missing directories for a destination path that does not exist.- Parameters:
create-trueif intermediate directories should be created,falseotherwise- Compliance:
mandatory- This method is must be implemented.
-
moveFile
void moveFile(Id src, String dst) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException 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 ifoverwrite()istrue. If the destination is a directory and does not exist, the missing directories are only created ifcreateMissingPaths()istrue.- Parameters:
src- the sourceIdof the filedst- the destination name or path of the directory or file- Throws:
AlreadyExistsException-dstexists andoverwrite()isfalseInvalidArgumentException-srcis not a fileNotFoundException-srcis not found, or the path todstis not found andcreateMissingPaths()isfalseNullArgumentException-srcordstisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
moveDirectory
void moveDirectory(Id src, String dst) throws NotFoundException, OperationFailedException, PermissionDeniedException 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 iscreateMissingPaths()istrue.- Parameters:
src- the sourceIdof the directorydst- the destination name or path of the directory- Throws:
InvalidArgumentException-srcis not a directoryNotFoundException-srcis not found, or the path todstis not found andcreateMissingPaths()isfalseNullArgumentException-srcordstisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
copyFile
File copyFile(Id src, String dst) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException 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 ifoverwrite()istrue. If the destination is a directory and does not exist, the missing directories are only created ifcreateMissingPaths()istrue.- Parameters:
src- the sourceIdof the filedst- the destination name or path of the directory or file- Returns:
- the new file
- Throws:
AlreadyExistsException-dstexists andoverwrite()isfalseInvalidArgumentException-srcis not a fileNotFoundException-srcis not found, or the path todstis not found andcreateMissingPaths()isfalseNullArgumentException-srcordstisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
copyDirectory
Directory copyDirectory(Id src, String dst) throws NotFoundException, OperationFailedException, PermissionDeniedException 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 iscreateMissingPaths()istrue.- Parameters:
src- the sourceIdof the directorydst- the destination name or path of the directory- Returns:
- the new file
- Throws:
InvalidArgumentException-srcis not a directoryNotFoundException-srcis not found, or the path todstis not found andcreateMissingPaths()isfalseNullArgumentException-srcordstisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
linkFile
File linkFile(Id fileId, String link) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Creates a link from one file to another.- Parameters:
fileId- theIdof a filelink- the link path- Returns:
- the link
- Throws:
AlreadyExistsException-link alreadyexistsNotFoundException-fileIdis not found, or the path tolinkis not found andcreateMissingPaths()isfalseNullArgumentException-fileIdorlinkisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
linkDirectory
Directory linkDirectory(Id directoryId, String link) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Creates a link from one directory to another.- Parameters:
directoryId- theIdof a directorylink- the destination path- Returns:
- the link
- Throws:
AlreadyExistsException-link alreadyexistsNotFoundException-directoryIdis not found, or the path tolinkis not found andcreateMissingPaths()isfalseNullArgumentException-directoryIdorlinkisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-