com.ibm.as400.access
Class QSYSObjectPathName

java.lang.Object
  |
  +--com.ibm.as400.access.QSYSObjectPathName
All Implemented Interfaces:
java.io.Serializable

public class QSYSObjectPathName
extends java.lang.Object
implements java.io.Serializable

The QSYSObjectPathName class provides an integrated file system path name that represents an object in the QSYS library file system.

QSYSObjectPathName objects generate the following events: PropertyChangeEvent.

This object can be used in two ways:

IllegalPathNameExceptions are thrown if errors are found.

Objects in the QSYS file system have integrated file system names with the following format for objects or members in a library other than QSYS:

/QSYS.LIB/library.LIB/object.type
/QSYS.LIB/library.LIB/object.FILE/member.MBR
For objects or members that reside in QSYS, this format is used:
/QSYS.LIB/object.type
/QSYS.LIB/object.FILE/member.MBR
For example:
/QSYS.LIB/QGPL.LIB/CRTLIB.CMD
/QSYS.LIB/QGPL.LIB/ACCOUNTS.FILE/PAYABLE.MBR
/QSYS.LIB/CRTLIB.CMD
/QSYS.LIB/ACCOUNTS.FILE/PAYABLE.MBR

In an integrated file system path name, special values, such as *ALL, that begin with an asterisk are not depicted with an asterisk but with leading and trailing percent signs (%ALL%). In the integrated file system, an asterisk is a wildcard character. The following special values are recognized by this class:

Library name: %ALL%(*ALL), %ALLUSR%(*ALLUSR), %CURLIB%(*CURLIB),
%LIBL%(*LIBL), %USRLIBL%(*USRLIBL)
Object name:  %ALL%(*ALL)
Member name:  %ALL%(*ALL), %FILE%(*FILE), %FIRST%(*FIRST), %LAST%(*LAST)
%NONE%(*NONE)

The path name will be in uppercase. If case needs to be preserved for a library, object, or member name, quotation marks should be used around the names. For example,

QSYSObjectPathName path = new
QSYSObjectPathName("/QSYS.LIB/\"MixedCase\".LIB/\"lowercase\".FILE");
Examples:

See Also:
Serialized Form

Constructor Summary
QSYSObjectPathName()
          Constructs an QSYSObjectPathName object.
QSYSObjectPathName(java.lang.String path)
          Constructs an QSYSObjectPathName object.
QSYSObjectPathName(java.lang.String library, java.lang.String object, java.lang.String type)
          Constructs an QSYSObjectPathName object.
QSYSObjectPathName(java.lang.String library, java.lang.String object, java.lang.String member, java.lang.String type)
          Constructs an QSYSObjectPathName object.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a listener to be notified when the value of any bound property is changed.
 void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Adds a listener to be notified when the value of any constrained property is changed.
 java.lang.String getLibraryName()
          Returns the library in which the object resides.
 java.lang.String getMemberName()
          Returns the name of the member.
 java.lang.String getObjectName()
          Returns the name of the object this path name represents.
 java.lang.String getObjectType()
          Returns type of object this path name represents.
 java.lang.String getPath()
          Returns the fully qualified integrated file system path name.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a listener from the change list.
 void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Removes a listener from the veto list.
 void setLibraryName(java.lang.String library)
          Sets the library in which the object resides.
 void setMemberName(java.lang.String member)
          Sets the name of the member.
 void setObjectName(java.lang.String object)
          Sets the name of the object this path name represents.
 void setObjectType(java.lang.String type)
          Sets type of object this path name represents.
 void setPath(java.lang.String path)
          Sets the integrated file system path name for this object.
static java.lang.String toPath(java.lang.String library, java.lang.String object, java.lang.String type)
          Builds an integrated file system path name to represent the object.
static java.lang.String toPath(java.lang.String library, java.lang.String object, java.lang.String member, java.lang.String type)
          Builds an integrated file system path name to represent the member.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QSYSObjectPathName

public QSYSObjectPathName()
Constructs an QSYSObjectPathName object. It creates an integrated file system path name for an object in the QSYS file system.

QSYSObjectPathName

public QSYSObjectPathName(java.lang.String path)
Constructs an QSYSObjectPathName object. It creates an integrated file system path name for an object in the QSYS file system.
Parameters:
path - The fully qualified integrated file system name of an object in the QSYS file system.

QSYSObjectPathName

public QSYSObjectPathName(java.lang.String library,
                          java.lang.String object,
                          java.lang.String type)
Constructs an QSYSObjectPathName object. It builds an integrated file system path name to represent the object.
QSYSObjectPathName ifsName = new
QSYSObjectPathName("library", "name", "type");
// This line will print "/QSYS.LIB/LIBRARY.LIB/NAME.TYPE".
System.out.println(ifsName.getPath());
Parameters:
library - The library in which the object exists. It must be 1-10 characters.
object - The name of the object. It must be 1-10 characters.
type - The type of the object. It must be 1-6 characters. This is the AS/400 abbreviation for the type of object, for example, LIB for library, or CMD for command. Types can be found by prompting for the OBJTYPE parameter on commands such as WRKOBJ.

QSYSObjectPathName

public QSYSObjectPathName(java.lang.String library,
                          java.lang.String object,
                          java.lang.String member,
                          java.lang.String type)
Constructs an QSYSObjectPathName object. It builds an integrated file system path name to represent the member.
QSYSObjectPathName ifsName = new
QSYSObjectPathName("library", "name", "member", "MBR");
// This line will print "/QSYS.LIB/LIBRARY.LIB/NAME.FILE/MEMBER.MBR".
System.out.println(ifsName.getPath());
Parameters:
library - The library in which the object exists. It must be 1-10 characters.
object - The name of the object. It must be 1-10 characters.
member - The name of the member. It must be 1-10 characters.
type - The type of the object. This must be MBR.
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener to be notified when the value of any bound property is changed. The propertyChange method will be called.
Parameters:
listener - The PropertyChangeListener.
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener)

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a listener to be notified when the value of any constrained property is changed. The vetoableChange method will be called.
Parameters:
listener - The VetoableChangeListener.
See Also:
removeVetoableChangeListener(java.beans.VetoableChangeListener)

getLibraryName

public java.lang.String getLibraryName()
Returns the library in which the object resides.
Returns:
The name of the library.

getMemberName

public java.lang.String getMemberName()
Returns the name of the member. If this object does not represent a member, an empty string is returned.
Returns:
The name of the member.

getObjectName

public java.lang.String getObjectName()
Returns the name of the object this path name represents. If this object represents a member, the object name is the name of the file in which the member exists.
Returns:
The name of the object.

getObjectType

public java.lang.String getObjectType()
Returns type of object this path name represents. Type is the AS/400 abbreviation for the type of object, for example, LIB for library, or CMD for command. Types can be found by prompting for the OBJTYPE parameter on commands such as WRKOBJ.
Returns:
The type of the object.

getPath

public java.lang.String getPath()
Returns the fully qualified integrated file system path name.
Returns:
The fully qualified integrated file system path name.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a listener from the change list. If the listener is not on the list, do nothing.
Parameters:
listener - The PropertyChangeListener.
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes a listener from the veto list. If the listener is not on the list, do nothing.
Parameters:
listener - The VetoableChangeListener.
See Also:
addVetoableChangeListener(java.beans.VetoableChangeListener)

setLibraryName

public void setLibraryName(java.lang.String library)
                    throws java.beans.PropertyVetoException
Sets the library in which the object resides. This is a bound and constrained property. Note that changes to this property also affect the pathName property.
Parameters:
library - The library in which the object exists. It must be 1-10 characters.
Throws:
java.beans.PropertyVetoException - If the change was vetoed.

setMemberName

public void setMemberName(java.lang.String member)
                   throws java.beans.PropertyVetoException
Sets the name of the member. If a value other than an empty String ("") is specified, the object type is set to MBR. This is a bound and constrained property. Note that changes to this property also affect the objectType and pathName properties.
Parameters:
member - The name of the member. It must be 10 characters or less. An empty String ("") can be passed to indicate this object does not represent a member.
Throws:
java.beans.PropertyVetoException - If the change was vetoed.

setObjectName

public void setObjectName(java.lang.String object)
                   throws java.beans.PropertyVetoException
Sets the name of the object this path name represents. If this object represents a member, the object name is the name of the file that the member is in. This is a bound and constrained property. Note that changes to this property also affect the pathName property.
Parameters:
object - The name of the object. It must be 1-10 characters.
Throws:
java.beans.PropertyVetoException - If the change was vetoed.

setObjectType

public void setObjectType(java.lang.String type)
                   throws java.beans.PropertyVetoException
Sets type of object this path name represents. If the type is not MBR, the member name property will be set to an empty string. The value will be uppercased. This is a bound and constrained property. Note that changes to this property also affect the memberName and pathName properties.
Parameters:
type - The type of the object. It must be 1-6 characters. This is the AS/400 abbreviation for the type of object, for example, LIB for library, or CMD for command. Types can be found by prompting for the OBJTYPE parameter on commands such as WRKOBJ.
Throws:
java.beans.PropertyVetoException - If the change was vetoed.

setPath

public void setPath(java.lang.String path)
             throws java.beans.PropertyVetoException
Sets the integrated file system path name for this object. This is a bound and constrained property. Note that changes to this property also affect the libraryName, memberName, objectName, and objectType properties.
Parameters:
path - The fully qualified integrated file system name of an object in the QSYS file system.
Throws:
java.beans.PropertyVetoException - If the change was vetoed.

toPath

public static java.lang.String toPath(java.lang.String library,
                                      java.lang.String object,
                                      java.lang.String type)
Builds an integrated file system path name to represent the object.
Parameters:
library - The library the object is in. It must be 1-10 characters.
object - The name of the object. It must be 1-10 characters.
type - The type of the object. It must be 1-6 characters. This is the AS/400 abbreviation for the type of object, for example, LIB for library, or CMD for command. Types can be found by prompting for the OBJTYPE parameter on commands such as WRKOBJ.
Returns:
The integrated file system name for the object.

toPath

public static java.lang.String toPath(java.lang.String library,
                                      java.lang.String object,
                                      java.lang.String member,
                                      java.lang.String type)
Builds an integrated file system path name to represent the member.
Parameters:
library - The library the object is in. It must be 1-10 characters.
object - The name of the object. It must be 1-10 characters.
member - The name of the member. It must be 1-10 characters.
type - The type of the object. This must be MBR.
Returns:
The integrated file system name for the object.