ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahh_5.4.0.1/qsyspath.htm

109 lines
5.7 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="QSYSObjectPathName class" />
<meta name="abstract" content="" />
<meta name="description" content="" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="qsyspath" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>QSYSObjectPathName class</title>
</head>
<body id="qsyspath"><a name="qsyspath"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">QSYSObjectPathName class</h1>
<div><p></p>
<div class="section"><p>You can use the <a href="javadoc/com/ibm/as400/access/QSYSObjectPathName.html#NAVBAR_TOP"> QSYSObjectPathName</a> class to represent an object in the
integrated file system. Use this class to build an integrated file system
name or to parse an integrated file system name into its components.</p>
<p>Several
of the IBM<sup>®</sup> Toolbox
for Java™ classes
require an integrated file system path name in order to be used. Use a QSYSObjectPathName
object to build the name.</p>
<div class="note"><span class="notetitle">Note:</span> Read the <a href="codedisclaimer.htm#codedisclaimer">Code
example disclaimer</a> for important legal information.</div>
<p>The following
examples show how to use the QSYSObjectPathName class:</p>
</div>
<div class="section"><p><strong>Example 1:</strong> <span class="synph" id="qsyspath__qsysex1"><a name="qsyspath__qsysex1"><!-- --></a><span class="kwd"></span></span>The
ProgramCall object requires the integrated file system name of the server
program to call. A QSYSObjectPathName object is used to build the name. To
call program PRINT_IT in library REPORTS using a QSYSObjectPathName:</p>
<div class="p"><pre> // Create an AS400 object.
AS400 sys = new AS400("mySystem.myCompany.com");
// Create a program call object.
ProgramCall pgm = new ProgramCall(sys);
// Create a path name object that
// represents program PRINT_IT in
// library REPORTS.
QSYSObjectPathName pgmName = new QSYSObjectPathName("REPORTS",
"PRINT_IT",
"PGM");
// Use the path name object to set
// the name on the program call
// object.
pgm.setProgram(pgmName.getPath());
// ... run the program, process the
// results</pre>
</div>
</div>
<div class="section"><p><strong>Example 2:</strong> <span class="synph" id="qsyspath__qsysex2"><a name="qsyspath__qsysex2"><!-- --></a><span class="kwd"></span></span>If the
name of the AS400 object is used just once, the Java program can use the <a href="javadoc/com/ibm/as400/access/QSYSObjectPathName.html#TOPATH(JAVA.LANG.STRING, JAVA.LANG.STRING, JAVA.LANG.STRING)"> toPath()</a> method to build the name. This method is more
efficient than creating a QSYSObjectPathName object.</p>
<div class="p"><pre> // Create an AS400 object.
AS400 sys = new AS400("mySystem.myCompany.com");
// Create a program call object.
ProgramCall pgm = new ProgramCall(sys);
// Use the toPath method to create
// the name that represents program
// PRINT_IT in library REPORTS.
pgm.setProgram(QSYSObjectPathName.toPath("REPORTS",
"PRINT_IT",
"PGM"));
// ... run the program, process the
// results</pre>
</div>
</div>
<div class="section"><p><strong>Example 3:</strong> <span class="synph" id="qsyspath__qsysex3"><a name="qsyspath__qsysex3"><!-- --></a><span class="kwd"></span></span>In this
example, a Java program was given an integrated file system path.
The QSYSObjectPathName class can be used to parse this name into its components:</p>
<div class="p"><pre> // Create a path name object from
// the fully qualified integrated
// file system name.
QSYSObjectPathName ifsName = new QSYSObjectPathName(pathName);
// Use the path name object to get
// the library, name and type of
// server object.
String library = ifsName.getLibraryName();
String name = ifsName.getObjectName();
String type = ifsName.getObjectType();</pre>
</div>
</div>
</div>
</body>
</html>