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

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.

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

Tests if this user can access files in this directory. A return of true does not guarantee successful authorization. A return of false indicates that it is known accessing this file will result in a PERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer read operations to unauthorized users.

Returnboolean false if file access is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodgetInputStream
Description

Gets the input stream for reading a file. The input stream reads until the end of the file.

Parametersstringname the relative or absolute path name
Returnosid.transport.DataInputStream the input stream for reading this file
ErrorsNOT_FOUND name is not found
NULL_ARGUMENT name is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodgetBlockingInputStream
Description

Gets the input stream for reading this file. The returned input stream, once it reaches the end of the file, blocks for new content that may be later appended to the file.

Parametersstringname the relative or absolute path name
Returnosid.transport.DataInputStream the input stream for reading this file
ErrorsNOT_FOUND name is not found
NULL_ARGUMENT name is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanWriteFiles
Description

Tests if this user can update this file. A return of true does not guarantee successful authorization. A return of false indicates that it is known writing to this this file will result in a PERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer write operations to unauthorized users.

Returnboolean false if file writing is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodgetOutputStream
Description

Gets an output stream for writing to this file, replacing any existing contents.

Parametersstringname the relative or absolute path name
Returnosid.transport.DataOutputStream the output stream for writing to this file
ErrorsNOT_FOUND name is not found
NULL_ARGUMENT name is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodgetOutputStreamForAppend
Description

Gets an output stream for appending to this file.

Parametersstringname the relative or absolute path name
Returnosid.transport.DataOutputStream the output stream for appending to this file
ErrorsNOT_FOUND name is not found
NULL_ARGUMENT name is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
Methodtouch
Description

Updates the modified time of a file to be the current time.

Parametersstringname the relative or absolute path name
ErrorsNOT_FOUND name is not found
NULL_ARGUMENT name is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.