2.6.1 Introduction
The NetWare File System Provider for JNDI provides contexts
that represent objects in the file system, such as NetWare volumes,
directories and files. It also describes how to access file streams, create
and delete files, and access attributes of the file system.
2.6.2 File System Provider Components
The components (interfaces and classes) of the NetWare File
System are contained in two packages:
The com.novell.java.io streams components are extended in
the com.novell.service.file.nw package to provide NetWare specific
extensions of the various streams interfaces.
The most important interfaces and classes in these packages
are described below. All components of each package may be accessed
by going to the links provided above.
- com.novell.service.file.nw.NameSpace class
provides an interface for getting the default name space for the
platform on which the JVM is executing. It also provides a central
interface for changing NetWare file system name space integer values
into strings and vice versa.
- com.novell.java.io.NFile interface
has been defined in terms of the java.io.File interface. Instances
of the NFile class represent the name of a file or directory on
the host file system. This class is intended to provide an abstraction
that deals with most of the machine dependent complexities of files
and path names in a machine-independent fashion.
- com.novell.service.file.nw.NetwareFile interface
is used for getting the NetWare file system file object attribute
values, which include Directory Entry Information, Extended Attributes,
Effective Rights, and Trustees.
- com.novell.service.file.nw.DirectoryEntryInformation class
results in a mutable object, and provides the NetWareFile interface
with 26 attribute values of Directory Entry Information. A directory entry
can be a file or a directory.
- com.novell.service.file.nw.EffectiveRights class
provides an attribute interface for effective rights of a file or directory.
It contains information about the effective rights for a users name
for which to return effective rights and the rights for the currently
logged or requested user.
- com.novell.service.file.nw.ExtendedAttribute class
provides constructors and methods for the support of an extended
attribute, which is a name and a corresponding byte array of data
associated with a given file. The given file can have multiple extended
attributes, which can be enumerated using the EAEnumerator interface.
- com.novell.service.file.nw.EAEnumerator interface
provides for enumeration of extended attributes of a given file, which
can have multiple extended attributes.
- com.novell.service.file.nw.Trustee class provides
variables, constructors and methods for the support of a trustee,
which is composed of a name identifying the trustee, the rights
associated with the named trustee and a compare string. Trustees
can be associated with a given directory entry (file or directory),
which can have multiple trustees that may be enumerated using the
TrusteeEnumerator interface.
- com.novell.service.file.nw.TrusteeEnumerator interface
provides for enumeration of trustees of a given directory entry
(file or directory), which can have multiple trustees.
- com.novell.service.file.nw.TrusteePathEnumerator interface
provides an attribute for enumeration of all paths on a volume to
which a user is assigned as a trustee. This interface contains the
user name for which to return trustee paths, and the paths for the
currently logged or requested user.
- com.novell.service.file.nw.NetwareDirectory interface
is used for getting the NetWare file system directory object attribute
values, which include Directory Space Information.
- com.novell.service.file.nw.DirectorySpaceInformation class
provides support for NetWare file system directory attribute values
and operations.
- com.novell.service.file.nw.NetwareVolume interface
is used for getting the NetWare file system volume object attribute
values, which include Volume Information, Volume Restriction, Volume
Utilization, and Trustee Path Enumeration.
- com.novell.service.file.nw.VolumeInformation class
provides variables, constructors and methods for accessing volume
information attribute values.
- com.novell.service.file.nw.VolumeRestriction class
provides variables, constructors and methods for accessing volume
restriction attribute values associated with a given volume, which
can have multiple restrictions.
- com.novell.service.file.nw.VolumeRestrictionEnumerator interface
provides for obtaining an enumeration of volume restriction attributes
of a volume, which can have multiple restrictions.
- com.novell.service.file.nw.VolumeUtilization class
provides variables, constructors and methods for accessing the volume
utilization attribute value. This attribute value is unique in that
it requires the objectName to be set by the user before it can obtain
the values. Because of this the attribute value cannot be setup
for searching; only the default constructor is available.
- com.novell.java.io.DataAccessable interface enables
you to read and write streams with JNDI provider contexts by identifying
an object that may support input/output streams and random
access to data. A typical usage of an object of this type is to
pass it to the various constructors of the NInputStream, NOutputStream
and RandomAccess classes (or provider specific extensions of these
classes). These constructors all take a DataAccessable object as
a parameter and then implement themselves in terms of this input
parameter.
- com.novell.service.file.nw.DataAccessableParameters interface
provides the file systems implementation of the custom data parameter
passed as the custom parameter to the various NInputStream, NOutputStream
and RandomAccess constructors. This class 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. The custom parameters associated with file streams
are: openFlags and dataSelector.
- com.novell.java.io.NInputStream class
provides input stream functionality to some data device object,
which implements the DataAccessable interface. The various constructors
of this class open an input stream on (or with) the DataAccessable
object passed into the constructors.
- com.novell.service.file.nw.NFileInputStream class
opens an input stream on a NetWare file or Extended Attribute. It extends
the NInputStream class by adding convenience constructors for the
various custom parameters. The DataAccessableParameters class can
also be used by the user application layer to obtain constant flags
for the various constructors or it can instantiate a DataAccessableParameters
object, which it passes into the NInputStream constructor.
- com.novell.java.io.NOutputStream class provides
output stream functionality to some data device object, which implements
the DataAccessable interface. The various constructors of this class
open an output stream on (or with) the DataAccessable object passed
into the constructors.
- com.novell.service.file.nw.NFileOutputStream class
opens an output stream on a NetWare file or Extended Attribute.
It extends the NOutputStream class by adding convenience constructors
for the various custom parameters. The DataAccessableParameters
class can also be used by the user application layer to obtain constant
flags for the various constructors or it can instantiate a DataAccessableParameters
object, which it passes into the NOutputStream constructor.
- com.novell.java.io.RandomAccess class provides
random access functionality to some data devices, which implement
the DataAccessable interface. The various constructors of this class
open access on (or with) the DataAccessable object passed into the
constructors.
- com.novell.service.file.nw.NRandomAccessFile class
opens a random access on a NetWare file. It extends the RandomAccess
class by adding convenience constructors for the various custom
parameters. The DataAccessableParameters class can also be used
by the user application layer to obtain constant flags for the various
constructors or it can instantiate a DataAccessableParameters object,
which it passes into the RandomAccess constructor.
2.6.3 File System Initial Context Implementations
In order to access the File System interfaces and classes,
you must specify an initial context factory to use. Following is
an example of how the File System initial context factory implementation
might be done.
Hashtable properties = new Hashtable();
property.put(Context.INITIAL_CONTEXT_FACTORY,
"com.novell.service.file.nw.FileSystemInitialContextFactory");
property.put(Context.PROVIDER_URL, <server name>);
DirContext initCtx = new InitialDirContext(properties);
To access the Server through federation you might do the following:
serverDirContext = lookup(<server name>+"/");
After the initial context has been implemented, you can then
get the session environment object using code similar to the following:
InitialContext initCtx = new InitialContext (hash);
hash = initCtx.getEnvironment ();
Session sess = (Session) hash.get (Environment.SESSION.OBJECT);
For a detailed discussion of initial context implementation
see Initial Context Implementations in
the Novell Services Introduction.
2.6.5 Relationship of File System Interfaces
and Classes
Because the com.novell.service.file.nw package components
are extended from the com.novell.java.io streams components to provide
NetWare specific extensions of the various streams interfaces, the
relationships between the NetWare File System components is illustrated
in two diagrams:
NetWare File System Components
The relationship between the NetWare File System interfaces
and classes is illustrated in the diagram below, followed by a brief
description of the relationship each interface and class has with other
interfaces and classes.
In this diagram of interfaces and classes a solid red line
ending with a solid arrow represents an extension of a class. The
dotted black lines ending with a small solid arrow imply some relationships between
the different interfaces and classes. Links are provided to the
Reference Guide documentation for each of these important file system
interfaces and classes.
- com.novell.service.file.nw.NameSpace class
has no direct relationship with other interfaces and classes of
the NetWare file system. Its main purpose is to get the default
name space for the platform on which the JVM is executing.
- com.novell.java.io.NFile interface
is extended by the NetwareFile interface in the com.novell.service.file.nw
package.
- com.novell.service.file.nw.NetwareFile interface
extends the com.novell.java.io.NFile interface. NetwareFile interface
methods are available for obtaining and setting Directory Entry
Information, Effective Rights, Extended Attributes, and Trustee
attribute values associated with a file object.
- com.novell.service.file.nw.DirectoryEntryInformation class
provides the NetWareFile interface with 26 attribute values of Directory
Entry Information associated with a directory entry, which can be
a file or a directory.
- com.novell.service.file.nw.EffectiveRights class
provides the NetWareFile interface with the effective rights for
a file or a directory.
- com.novell.service.file.nw.ExtendedAttribute class
provides the NetWareFile interface with extended attribute information
associated with a given file, which can have multiple extended attributes
that are enumerated using the EAEnumerator interface.
- com.novell.service.file.nw.EAEnumerator interface
enumerates the extended attributes of a given file, which can have
multiple extended attributes.
- com.novell.service.file.nw.Trustee class provides
the NetWareFile interface with information identifying a trustee,
the rights associated with the named trustee, and a compare string
for a given directory entry (file or directory), which can have
multiple trustees that are enumerated using the TrusteeEnumerator
interface.
- com.novell.service.file.nw.TrusteeEnumerator interface
enumerates the trustees of a given directory entry (file or directory),
which can have multiple trustees.
- com.novell.service.file.nw.TrusteePathEnumerator interface
provides information on all paths of a volume to which a user is
assigned as a trustee.
- com.novell.service.file.nw.NetwareDirectory interface
extends the NetwareFile interface and provides methods for obtaining
and setting directory object attribute values, which include directory
space information.
- com.novell.service.file.nw.DirectorySpaceInformation class
provides the NetwareDirectory interface with directory object attribute
values.
- com.novell.service.file.nw.NetwareVolume interface
extends the NetwareDirectory interface. Methods are provided for
getting the NetWare file system volume object attribute values,
which include volume information, volume restriction information,
volume utilization information, and trustee path enumeration information.
- com.novell.service.file.nw.VolumeInformation class
provides the NetwareVolume interface with volume information attribute
values associated with a given volume.
- com.novell.service.file.nw.VolumeRestriction class
provides the NetwareVolume interface with volume restriction attribute
values associated with a given volume, which can have multiple restrictions.
- com.novell.service.file.nw.VolumeRestrictionEnumerator interface
enumerates volume restriction attributes of a volume, which can
have multiple restrictions.
- com.novell.service.file.nw.VolumeUtilization class
provides the NetwareVolume interface with volume utilization attribute
values.
NetWare Stream Accessor Components
The relationship between the NetWare stream accessor interfaces
and classes is illustrated in the diagram below, followed by a brief
description of the relationship each interface and class has with other
interfaces and classes.
In this diagram of interfaces and classes a solid red line
ending with a solid arrow represents an extension of a class. The
dotted black lines ending with a small solid arrow imply some relationships between
the different interfaces and classes. Links are provided to the
Reference Guide documentation for each of these important file stream
interfaces and classes.
- com.novell.java.io.spi.DataAccessor interface
provides an interface that allows read and/or write access
to a given resource. DataAccessor is not used by the user application
layer, but is used by Stream service provider implementors.
- com.novell.java.io.DataAccessable interface provides
a DataAccessable object to the various constructors of the NInputStream, NOutputStream
and RandomAccess classes (or provider specific extensions of these
classes). These constructors all take a DataAccessable object as
a parameter and then implement themselves in terms of this input
parameter.
- com.novell.service.file.nw.DataAccessableParameters interface
passes the custom data parameter through DataAccessable objects
to the various NInputStream, NOutputStream and RandomAccess constructors.
The custom parameters associated with file streams are: openFlags
and dataSelector.
- com.novell.java.io.NInputStream class
is extended by the com.novell.service.file.nw.NFileInputStream class.
The various constructors of the NInputStream class open an input
stream on (or with) the DataAccessable object passed into the constructors.
- com.novell.service.file.nw.NFileInputStream class
extends the com.novell.java.io.NInputStream class by adding convenience
constructors for the various custom parameters.
- com.novell.java.io.NOutputStream class
is extended by the com.novell.service.file.nw.NFileOutputStream
class. The various constructors of the NOutputStream class open
an output stream on (or with) the DataAccessable object passed into
the constructors.
- com.novell.service.file.nw.NFileOutputStream class
extends the com.novell.java.io.NOutputStream class by adding convenience
constructors for the various custom parameters.
- com.novell.java.io.RandomAccess class
is extended by the com.novell.service.file.nw.NRandomAccessFile
class. The various constructors of the RandomAccess class open a
random access file on (or with) the DataAccessable object passed
into the constructors.
- com.novell.service.file.nw.NRandomAccessFile class
extends the com.novell.java.io.RandomAccess class by adding convenience
constructors for the various custom parameters.