public interface FileContentSession extends OsidSession
This session defines methods forreading and writing files. The directory associated with this session is the current working directory and any relative path names provided are with respect to this directory.
Modifier and Type | Method and Description |
---|---|
boolean |
canReadFiles()
Tests if this user can access files in this directory.
|
boolean |
canWriteFiles()
Tests if this user can update this file.
|
DataInputStream |
getBlockingInputStream(java.lang.String name)
Gets the input stream for reading this file.
|
Directory |
getDirectory()
Gets the directory associated with this session.
|
Id |
getDirectoryId()
Gets the
Id of this directory. |
DataInputStream |
getInputStream(java.lang.String name)
Gets the input stream for reading a file.
|
DataOutputStream |
getOutputStream(java.lang.String name)
Gets an output stream for writing to this file, replacing any existing
contents.
|
DataOutputStream |
getOutputStreamForAppend(java.lang.String name)
Gets an output stream for appending to this file.
|
void |
touch(java.lang.String name)
Updates the modified time of a file to be the current time.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getDirectoryId()
Id
of this directory. Id
of this directorymandatory
- This method must be implemented. Directory getDirectory() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canReadFiles()
PERMISSION_DENIED.
This is intended as a hint to an
application that may not wish to offer read operations to unauthorized
users. false
if file access is not authorized,
true
otherwisemandatory
- This method must be implemented. DataInputStream getInputStream(java.lang.String name) throws NotFoundException, OperationFailedException, PermissionDeniedException
name
- the relative or absolute path nameNotFoundException
- name
is not foundNullArgumentException
- name
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DataInputStream getBlockingInputStream(java.lang.String name) throws NotFoundException, OperationFailedException, PermissionDeniedException
name
- the relative or absolute path nameNotFoundException
- name
is not foundNullArgumentException
- name
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canWriteFiles()
PERMISSION_DENIED.
This is intended as a hint to an
application that may not wish to offer write operations to
unauthorized users. false
if file writing is not authorized,
true
otherwisemandatory
- This method must be implemented. DataOutputStream getOutputStream(java.lang.String name) throws NotFoundException, OperationFailedException, PermissionDeniedException
name
- the relative or absolute path nameNotFoundException
- name
is not foundNullArgumentException
- name
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DataOutputStream getOutputStreamForAppend(java.lang.String name) throws NotFoundException, OperationFailedException, PermissionDeniedException
name
- the relative or absolute path nameNotFoundException
- name
is not foundNullArgumentException
- name
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void touch(java.lang.String name) throws NotFoundException, OperationFailedException, PermissionDeniedException
name
- the relative or absolute path nameNotFoundException
- name
is not foundNullArgumentException
- name
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.