com.novell.service.file.nw
Class DataAccessableParameters

java.lang.Object
  |
  +--com.novell.service.file.nw.DataAccessableParameters

public class DataAccessableParameters
extends java.lang.Object
implements java.lang.Cloneable

Provides a DataAccessor implementation using the custom data openFlags and dataSelector parameters.

DataAccessableParameters is the file system's implementation of the custom data parameter passed as the custom parameter to the various NInputStream, NOutputStream and RandomAccess constructors. This class is used in conjunction with the NFileInputStream, NFileOutputStream and NRandomAccessFile classes. It defines constants that can be used for the various constructors in these classes, or this object can be instantiated and passed into the custom parameter constructors.

When opening a file stream, you can use any of the openFlags outlined in the variable section. However, all streams do not support all of the open flags specified below (extended attributes for example). The only flags that are guaranteed to be supported for any accessor are the READ and WRITE flags (and READ_WRITE for random access).

The dataSelector allows selection of different data forks on a device. For example, a file can have a data fork and a resource fork. To choose the default fork, independent of platform and device type, specify DEFAULT_DATASELECTOR for this parameter.

See Also:
DataAccessable, NInputStream, NOutputStream, RandomAccess, NFileInputStream, NFileOutputStream, NRandomAccessFile, DEFAULT_DATASELECTOR

Field Summary
static int COMPATABILITY
          The openFlag variable allowing the data accessor to be opened in NetWare compatability mode.
static int DEFAULT_DATASELECTOR
          The dataSelector variable with the default value.
static int DEFAULT_INPUT_OPENFLAGS
          The default NFileInputFile openFlags value.
static int DEFAULT_OUTPUT_OPENFLAGS
          The default NFileOutputFile openFlags value.
static int DELETE_FILE_CLOSE
          The openFlag variable allowing the data accessor to be opened in delete-after-close mode.
static int DENY_READ
          The openFlag variable allowing the data accessor to be opened but deny any shared read requests.
static int DENY_WRITE
          The openFlag variable allowing the data accessor to be opened but deny any shared write requests.
static int EA_STREAM_SELECTOR
          The dataSelector variable allowing an EA stream to be opened on a directory entry.
static int OPEN_COMPRESSED
          The openFlag variable allowing the data accessor to be opened in compressed mode.
static int READ
          The openFlag variable allowing the data accessor to be opened in read mode.
static int READ_WRITE
          The openFlag variable allowing the data accessor to be opened in read/write mode.
static int WRITE
          The openFlag variable allowing the data accessor to be opened in write mode.
static int WRITE_THROUGH
          The openFlag variable allowing the data accessor to be opened in a mode where any writes are immediately flushed to the device.
 
Constructor Summary
DataAccessableParameters(int openFlags, int dataSelector)
          Constructs a DataAccessableParameters object.
 
Method Summary
 java.lang.String checkParameters(java.lang.String name, java.lang.String nameSpace)
          Opens a file stream with the passed in subordinate name.
 java.lang.Object clone()
          Returns a clone of this DataAccessableParameters object.
 boolean equals(java.lang.Object obj)
          Compares the input parameter object to this DataAccessableParameters object.
 int getDataSelector()
          Returns the dataSelector value that was set in the constructor.
 int getOpenFlags()
          Returns the openFlags value that was set in the constructor.
 java.lang.String toString()
          Returns a debug string representation of this DataAccessableParameters object.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

READ

public static final int READ
The openFlag variable allowing the data accessor to be opened in read mode.

(READ = 0x0001)


WRITE

public static final int WRITE
The openFlag variable allowing the data accessor to be opened in write mode.

(WRITE = 0x0002)


DENY_READ

public static final int DENY_READ
The openFlag variable allowing the data accessor to be opened but deny any shared read requests.

(DENY_READ = 0x0004)


DENY_WRITE

public static final int DENY_WRITE
The openFlag variable allowing the data accessor to be opened but deny any shared write requests.

(DENY_WRITE = 0x0008)


COMPATABILITY

public static final int COMPATABILITY
The openFlag variable allowing the data accessor to be opened in NetWare compatability mode.

(COMPATABILITY = 0x0010)


WRITE_THROUGH

public static final int WRITE_THROUGH
The openFlag variable allowing the data accessor to be opened in a mode where any writes are immediately flushed to the device.

(WRITE_THROUGH = 0x0040)


OPEN_COMPRESSED

public static final int OPEN_COMPRESSED
The openFlag variable allowing the data accessor to be opened in compressed mode.

(OPEN_COMPRESSED = 0x0100)


DELETE_FILE_CLOSE

public static final int DELETE_FILE_CLOSE
The openFlag variable allowing the data accessor to be opened in delete-after-close mode.

Beginning with NetWare 4.10, a file can be opened as a temporary file that will be deleted when the file is closed. To create a temporary file, the caller must set the DELETE_FILE_CLOSE bit, the DENY_READ bit, and the DENY_WRITE bit in the mode parameter of openStream(). Temporary files by definition do not allow shared I/O access. This file will exist until the caller closes the file, which will cause the file to be deleted. NetWare will create temporary files with the HIDDEN bit set so that they will not be visible.

(DELETE_FILE_CLOSE = 0x0400)


READ_WRITE

public static final int READ_WRITE
The openFlag variable allowing the data accessor to be opened in read/write mode.

(READ_WRITE = READ | WRITE)


DEFAULT_INPUT_OPENFLAGS

public static final int DEFAULT_INPUT_OPENFLAGS
The default NFileInputFile openFlags value.

(DEFAULT_INPUT_OPENFLAGS = READ)


DEFAULT_OUTPUT_OPENFLAGS

public static final int DEFAULT_OUTPUT_OPENFLAGS
The default NFileOutputFile openFlags value.

(DEFAULT_OUTPUT_OPENFLAGS = WRITE)


EA_STREAM_SELECTOR

public static final int EA_STREAM_SELECTOR
The dataSelector variable allowing an EA stream to be opened on a directory entry. Pass this constant in as the dataSelector on an open relative to a directory or any directory entry and an EA stream will be opened. This is valid for use only with the various subordinate constructors.

(EA_STREAM_SELECTOR = 0xFF)


DEFAULT_DATASELECTOR

public static final int DEFAULT_DATASELECTOR
The dataSelector variable with the default value.

(DEFAULT_DATASELECTOR = -1)

Constructor Detail

DataAccessableParameters

public DataAccessableParameters(int openFlags,
                                int dataSelector)
Constructs a DataAccessableParameters object.

The DataAccessableParameters object is suitable for the custom parameter of the various NInputStream, NOutputStream, RandomAccess, NFileInputStream, NFileOutputStream and NRandomAccessFile class constructors.

Parameters:
openFlags - The open flags to use when opening the stream.
dataSelector - The dataSelector to use when opening the stream.
Method Detail

getOpenFlags

public int getOpenFlags()
Returns the openFlags value that was set in the constructor.
Returns:
The openFlags value.

getDataSelector

public int getDataSelector()
Returns the dataSelector value that was set in the constructor.
Returns:
The dataSelector value.

equals

public boolean equals(java.lang.Object obj)
Compares the input parameter object to this DataAccessableParameters object.
Returns:
A boolean set to TRUE if the objects are the same; otherwise, FALSE is returned if they are different.
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Returns a debug string representation of this DataAccessableParameters object.

The debug string is in the following format: nameSpace: s, openFlags: i, dataSelector: i.

Returns:
The debug string representation.
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Returns a clone of this DataAccessableParameters object.
Returns:
The cloned DataAccessableParameters object.

checkParameters

public java.lang.String checkParameters(java.lang.String name,
                                        java.lang.String nameSpace)
Opens a file stream with the passed in subordinate name. Set up default parameters as needed.

This method should be used only by SPI provider developers; it is not intended for the user application interface. The implementors of the DataAccessable openStream custom data methods should call this method on the custom data object received before accessing any of the custom data paramters.

Parameters:
name - The subordinate name to be opened, or NULL for non-subordinate opens.
Returns:
The subordinate name that should be used to open the stream, or NULL for non-subordinate opens.