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

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

Parametersstringnamethe relative or absolute path name
Returnosid.transport.DataInputStreamthe input stream for reading this file
ErrorsNOT_FOUND name is not found
NULL_ARGUMENT name is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.

Parametersstringnamethe relative or absolute path name
Returnosid.transport.DataInputStreamthe input stream for reading this file
ErrorsNOT_FOUND name is not found
NULL_ARGUMENT name is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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
CompliancemandatoryThis method must be implemented.
MethodgetOutputStream
Description

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

Parametersstringnamethe relative or absolute path name
Returnosid.transport.DataOutputStreamthe output stream for writing to this file
ErrorsNOT_FOUND name is not found
NULL_ARGUMENT name is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetOutputStreamForAppend
Description

Gets an output stream for appending to this file.

Parametersstringnamethe relative or absolute path name
Returnosid.transport.DataOutputStreamthe output stream for appending to this file
ErrorsNOT_FOUND name is not found
NULL_ARGUMENT name is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
Methodtouch
Description

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

Parametersstringnamethe relative or absolute path name
ErrorsNOT_FOUND name is not found
NULL_ARGUMENT name is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.