Serializable
public class QSYSObjectPathName extends Object implements Serializable
QSYSObjectPathName objects generate the following events:
This object can be used in two ways:
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.MBRFor objects or members that reside in QSYS, this format is used:
/QSYS.LIB/object.type /QSYS.LIB/object.FILE/member.MBRFor 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:
QSYSObjectPathName path = new QSYSObjectPathName("/QSYS.LIB/QGPL.LIB/ACCOUNTS.FILE"); System.out.println(path.getLibraryName()); // Will print "QGPL" System.out.println(path.getObjectName()); // Will print "ACCOUNTS" System.out.println(path.getObjectType()); // Will print "FILE"
QSYSObjectPathName path = new QSYSObjectPathName("/QSYS.LIB/QGPL.LIB/ACCOUNTS.FILE/PAYABLE.MBR"); System.out.println(path.getLibraryName()); // Will print "QGPL" System.out.println(path.getObjectName()); // Will print "ACCOUNTS" System.out.println(path.getMemberName()); // Will print "PAYABLE" System.out.println(path.getObjectType()); // Will print "MBR"
QSYSObjectPathName path = new QSYSObjectPathName("QGPL", "ACCOUNTS", "FILE"); // Will print "/QSYS.LIB/QGPL.LIB/ACCOUNTS.FILE" System.out.println(path.getPath());
QSYSObjectPathName path = new QSYSObjectPathName("QGPL", "ACCOUNTS", "PAYABLE", "MBR"); // Will print "/QSYS.LIB/QGPL.LIB/ACCOUNTS.FILE/PAYABLE.MBR" System.out.println(path.getPath());
Constructor | Description |
---|---|
QSYSObjectPathName() |
Constructs a QSYSObjectPathName object.
|
QSYSObjectPathName(String path) |
Constructs a QSYSObjectPathName object.
|
QSYSObjectPathName(String libraryName,
String objectName,
String objectType) |
Constructs a QSYSObjectPathName object.
|
QSYSObjectPathName(String libraryName,
String objectName,
String memberName,
String objectType) |
Constructs a QSYSObjectPathName object.
|
QSYSObjectPathName(String aspName,
String libraryName,
String objectName,
String memberName,
String objectType) |
Constructs a QSYSObjectPathName object.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener) |
Adds a listener to be notified when the value of any bound property is changed.
|
void |
addVetoableChangeListener(VetoableChangeListener listener) |
Adds a listener to be notified when the value of any constrained property is changed.
|
String |
getAspName() |
Returns the ASP on which the object resides.
|
String |
getLibraryName() |
Returns the library in which the object resides.
|
String |
getMemberName() |
Returns the name of the member.
|
String |
getObjectName() |
Returns the name of the object this path name represents.
|
String |
getObjectType() |
Returns type of object this path name represents.
|
String |
getPath() |
Returns the fully qualified integrated file system path name.
|
void |
removePropertyChangeListener(PropertyChangeListener listener) |
Removes a listener from the change list.
|
void |
removeVetoableChangeListener(VetoableChangeListener listener) |
Removes a listener from the veto list.
|
void |
setAspName(String aspName) |
Sets the IASP in which the object resides.
|
void |
setLibraryName(String libraryName) |
Sets the library in which the object resides.
|
void |
setMemberName(String memberName) |
Sets the name of the member.
|
void |
setObjectName(String objectName) |
Sets the name of the object this path name represents.
|
void |
setObjectType(String objectType) |
Sets type of object this path name represents.
|
void |
setPath(String path) |
Sets the integrated file system path name for this object.
|
static String |
toPath(String libraryName,
String objectName,
String objectType) |
Builds an integrated file system path name to represent the object.
|
static String |
toPath(String libraryName,
String objectName,
String memberName,
String objectType) |
Builds an integrated file system path name to represent the member.
|
static String |
toPath(String aspName,
String libraryName,
String objectName,
String memberName,
String objectType) |
Builds an integrated file system path name to represent the member.
|
static String |
toQSYSName(String name) |
Utility method for selectively uppercasing the characters in a string, for use as an IBM i *NAME value.
|
String |
toQualifiedObjectName() |
Returns a qualified object name, for use in API parameters.
|
public QSYSObjectPathName()
public QSYSObjectPathName(String path)
path
- The fully qualified integrated file system name of an object in the QSYS file system.public QSYSObjectPathName(String libraryName, String objectName, String objectType)
QSYSObjectPathName ifsName = new QSYSObjectPathName("library", "name", "type"); // This line will print "/QSYS.LIB/LIBRARY.LIB/NAME.TYPE". System.out.println(ifsName.getPath());
libraryName
- The library in which the object exists. It must be 1-10 characters.objectName
- The name of the object. It must be 1-10 characters.objectType
- The type of the object. It must be 1-6 characters. This is the IBM i system 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.public QSYSObjectPathName(String libraryName, String objectName, String memberName, String objectType)
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());
libraryName
- The library in which the object exists. It must be 1-10 characters.objectName
- The name of the object. It must be 1-10 characters.memberName
- The name of the member. It must be 1-10 characters.objectType
- The type of the object. This must be "MBR".public QSYSObjectPathName(String aspName, String libraryName, String objectName, String memberName, String objectType)
QSYSObjectPathName ifsName = new QSYSObjectPathName("iasp1", "library", "name", "member", "MBR"); // This line will print "/IASP1/QSYS.LIB/LIBRARY.LIB/NAME.FILE/MEMBER.MBR". System.out.println(ifsName.getPath());
aspName
- The IASP on which the object exists. It must be 1-10 characters.libraryName
- The library in which the object exists. It must be 1-10 characters.objectName
- The name of the object. It must be 1-10 characters.memberName
- The name of the member. It must be 1-10 characters.objectType
- The type of the object. This must be "MBR".public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The listener object.public void addVetoableChangeListener(VetoableChangeListener listener)
listener
- The listener object.public String getAspName()
public String getLibraryName()
public String getMemberName()
public String getObjectName()
public String getObjectType()
public String getPath()
public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The listener object.public void removeVetoableChangeListener(VetoableChangeListener listener)
listener
- The listener object.public void setAspName(String aspName) throws PropertyVetoException
aspName
- The IASP in which the object exists. It must be 1-10 characters.PropertyVetoException
- If the change was vetoed.public void setLibraryName(String libraryName) throws PropertyVetoException
libraryName
- The library in which the object exists. It must be 1-10 characters.PropertyVetoException
- If the change was vetoed.public void setMemberName(String memberName) throws PropertyVetoException
memberName
- 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.PropertyVetoException
- If the change was vetoed.public void setObjectName(String objectName) throws PropertyVetoException
objectName
- The name of the object. It must be 1-10 characters.PropertyVetoException
- If the change was vetoed.public void setObjectType(String objectType) throws PropertyVetoException
objectType
- The type of the object. It must be 1-6 characters. This is the IBM i system 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.PropertyVetoException
- If the change was vetoed.public void setPath(String path) throws PropertyVetoException
path
- The fully qualified integrated file system name of an object in the QSYS file system.PropertyVetoException
- If the change was vetoed.public static String toPath(String libraryName, String objectName, String objectType)
libraryName
- The library the object is in. It must be 1-10 characters.objectName
- The name of the object. It must be 1-10 characters.objectType
- The type of the object. It must be 1-6 characters. This is the IBM i system 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.public static String toPath(String libraryName, String objectName, String memberName, String objectType)
libraryName
- The library the object is in. It must be 1-10 characters.objectName
- The name of the object. It must be 1-10 characters.memberName
- The name of the member. It must be 1-10 characters.objectType
- The type of the object. This must be "MBR".public static String toPath(String aspName, String libraryName, String objectName, String memberName, String objectType)
aspName
- The IASP on which the object exists. It must be 1-10 characters.libraryName
- The library the object is in. It must be 1-10 characters.objectName
- The name of the object. It must be 1-10 characters.memberName
- The name of the member. It must be 1-10 characters.objectType
- The type of the object. This must be "MBR".public static final String toQSYSName(String name)
name
- The name to be uppercased.public String toQualifiedObjectName()
Copyright © 2024. All rights reserved.