Microsoft SDK for Java

openWritable

The openWritable method of the ClientStore Class contains the following signatures:

openWritable(String stgfilename, int flags)
openWritable(String stgfilename)
openWritable(String stgfilename, boolean append)

openWritable(String stgfilename, int flags)

Opens a file for writing. If the file already exists, it is truncated unless the OPEN_FL_APPEND flag is provided.

Syntax

public OutputStream openWritable(String stgfilename, int flags) throws IOException;

Return Value

Returns the output stream that is open for writing.

Parameters

stgfilename The name of the file to open for writing.
flags A value that indicates the requested type of file accessibility. It can be any combination of the following accessibilities:

OPEN_FL_SHARED
STORE_FL_ROAMING
OPEN_FL_APPEND
OPEN_FL_EXPENDABLE
OPEN_FL_WRITABLE
STORE_FL_LOCAL


Exceptions

IOException if the method fails to create the file or if there is an error while attempting to truncate an existing file.

openWritable(String stgfilename)

Opens a file for writing. If the file already exists, it is truncated.

Syntax

public OutputStream openWritable(String stgfilename) throws IOException;

Return Value

Returns the output stream that is open for writing.

Parameters

stgfilename The name of the file to open for writing.

Exceptions

IOException if the method fails to create the file or if there is an error while attempting to truncate an existing file.

openWritable(String stgfilename, boolean append)

Opens a file for writing. If the file already exists, it is truncated or appended, depending on the value of append.

Syntax

public OutputStream openWritable(String stgfilename, boolean append) throws IOException;

Return Value

Returns the output stream that is open for writing.

Parameters

stgfilename The storage file to open.
append The value that determines whether to append to an existing file. If true, appends to an existing file; otherwise, truncates an existing file.

Exceptions

IOException if the file could not be created or truncated.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.