<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc on Mon Jan 28 16:39:33 EST 2002 --> <TITLE> Perforce API: Class Env </TITLE> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> </HEAD> <BODY BGCOLOR="white"> <!-- ========== START OF NAVBAR ========== --> <A NAME="navbar_top"><!-- --></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Env.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <a target="_top" href="http://www.perforce.com/"><img alt="Perforce" border="0" height="44" width="151" src="doc-files/perforce_logo.gif"></a></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../com/perforce/api/DirEntry.html"><B>PREV CLASS</B></A> <A HREF="../../../com/perforce/api/EventLog.html"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Env.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.perforce.api</FONT> <BR> Class Env</H2> <PRE> <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html">java.lang.Object</A> | +--<B>com.perforce.api.Env</B> </PRE> <HR> <DL> <DT>public class <B>Env</B><DT>extends <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html">Object</A></DL> <P> Representation of a source control environment. This information is typically passed to a <code>P4Process</code> instance by the <code>SourceControlObject</code> instances. It can also be set in the <A HREF="../../../com/perforce/api/P4Process.html#getBase()"><CODE>base</CODE></A> P4Process instance. This will cause it to be used as the default environment for all command execution. <P> Values for the environment can be easily loaded from a <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/util/Properties.html"><CODE>Properties</CODE></A> file. This makes configuration of the environment much simpler. <P> <DL> <DT><B>Version: </B><DD>$Date: 2002/01/28 $ $Revision: #6 $</DD> <DT><B>Author: </B><DD><a href="mailto:david@markley.cc">David Markley</a></DD> <DT><B>See Also: </B><DD><A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/util/Properties.html"><CODE>Properties</CODE></A></DL> <HR> <P> <!-- ======== INNER CLASS SUMMARY ======== --> <!-- =========== FIELD SUMMARY =========== --> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#Env()">Env</A></B>()</CODE> <BR> Default, no-argument constructor.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#Env(com.perforce.api.Env)">Env</A></B>(<A HREF="../../../com/perforce/api/Env.html">Env</A> base)</CODE> <BR> Constructor that uses another environment as its basis.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#Env(java.util.Properties)">Env</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/util/Properties.html">Properties</A> props)</CODE> <BR> Constructor that uses a set of <code>Properties</code> to set up the environment.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#Env(java.lang.String)">Env</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> propfile)</CODE> <BR> Constructs an environment from a properties file.</TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Method Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#checkValidity()">checkValidity</A></B>()</CODE> <BR> Checks the environment to see if it is valid.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#getClient()">getClient</A></B>()</CODE> <BR> Returns the P4CLIENT.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A>[]</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#getEnvp()">getEnvp</A></B>()</CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#getExecutable()">getExecutable</A></B>()</CODE> <BR> Returns the path to the executable.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#getPassword()">getPassword</A></B>()</CODE> <BR> Returns the P4PASSWORD.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#getPath()">getPath</A></B>()</CODE> <BR> Returns the PATH.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#getPort()">getPort</A></B>()</CODE> <BR> Returns the P4PORT.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/util/Properties.html">Properties</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#getProperties()">getProperties</A></B>()</CODE> <BR> Returns a new <code>Properties</code> instance that is set using the environments properties as its default.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#getProperty(java.lang.String)">getProperty</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> key)</CODE> <BR> Searches for the property with the specified key in this property list.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#getProperty(java.lang.String, java.lang.String)">getProperty</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> key, <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> defaultValue)</CODE> <BR> Searches for the property with the specified key in this property list.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> long</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#getServerTimeout()">getServerTimeout</A></B>()</CODE> <BR> Return the server timeout threshold.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#getUser()">getUser</A></B>()</CODE> <BR> Returns the P4USER.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#setClient(java.lang.String)">setClient</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> client)</CODE> <BR> Sets the P4CLIENT in the class information.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#setExecutable(java.lang.String)">setExecutable</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> exe)</CODE> <BR> Sets up the path to reach the p4 executable.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#setFromProperties(java.util.Properties)">setFromProperties</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/util/Properties.html">Properties</A> props)</CODE> <BR> Uses a set of <code>Properties</code> to set up the environment.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#setPassword(java.lang.String)">setPassword</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> password)</CODE> <BR> Sets the P4PASSWD in the class information.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#setPath(java.lang.String)">setPath</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> path)</CODE> <BR> Sets the PATH in the class information.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#setPort(java.lang.String)">setPort</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> port)</CODE> <BR> Sets the P4PORT in the class information.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#setProperty(java.lang.String, java.lang.String)">setProperty</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> key, <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> value)</CODE> <BR> Calls the hashtable method put.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#setServerTimeout(long)">setServerTimeout</A></B>(long threshold)</CODE> <BR> Set the server timeout threshold.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#setSystemDrive(java.lang.String)">setSystemDrive</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> drive)</CODE> <BR> Sets the SystemDrive in the class information.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#setSystemRoot(java.lang.String)">setSystemRoot</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> root)</CODE> <BR> Sets the SystemRoot in the class information.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#setUser(java.lang.String)">setUser</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> user)</CODE> <BR> Sets the P4USER in the class information.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#toString()">toString</A></B>()</CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Env.html#toXML()">toXML</A></B>()</CODE> <BR> Returns an XML representation of the environment.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html">Object</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html#clone()">clone</A>, <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html#finalize()">finalize</A>, <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html#getClass()">getClass</A>, <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html#notify()">notify</A>, <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html#wait()">wait</A>, <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html#wait(long)">wait</A>, <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html#wait(long, int)">wait</A></CODE></TD> </TR> </TABLE> <P> <!-- ============ FIELD DETAIL =========== --> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TD> </TR> </TABLE> <A NAME="Env()"><!-- --></A><H3> Env</H3> <PRE> public <B>Env</B>()</PRE> <DL> <DD>Default, no-argument constructor.</DL> <HR> <A NAME="Env(com.perforce.api.Env)"><!-- --></A><H3> Env</H3> <PRE> public <B>Env</B>(<A HREF="../../../com/perforce/api/Env.html">Env</A> base)</PRE> <DL> <DD>Constructor that uses another environment as its basis. This is useful for cloning environments and then changing a few attributes.<DD><DL> <DT><B>Parameters:</B><DD><CODE>base</CODE> - Environment to be copied into the new environment.</DL> </DD> </DL> <HR> <A NAME="Env(java.util.Properties)"><!-- --></A><H3> Env</H3> <PRE> public <B>Env</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/util/Properties.html">Properties</A> props)</PRE> <DL> <DD>Constructor that uses a set of <code>Properties</code> to set up the environment.<DD><DL> <DT><B>Parameters:</B><DD><CODE>props</CODE> - Used to construct the environment.<DT><B>See Also: </B><DD><A HREF="../../../com/perforce/api/Env.html#setFromProperties(java.util.Properties)"><CODE>setFromProperties(Properties)</CODE></A></DL> </DD> </DL> <HR> <A NAME="Env(java.lang.String)"><!-- --></A><H3> Env</H3> <PRE> public <B>Env</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> propfile) throws <A HREF="../../../com/perforce/api/PerforceException.html">PerforceException</A></PRE> <DL> <DD>Constructs an environment from a properties file.<DD><DL> <DT><B>Parameters:</B><DD><CODE>propfile</CODE> - full path to a properties file.</DL> </DD> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Method Detail</B></FONT></TD> </TR> </TABLE> <A NAME="checkValidity()"><!-- --></A><H3> checkValidity</H3> <PRE> public void <B>checkValidity</B>() throws <A HREF="../../../com/perforce/api/PerforceException.html">PerforceException</A></PRE> <DL> <DD>Checks the environment to see if it is valid. To check the validity of the environment, the user information is accessed. This ensures that the server can be contacted and that the password is set properly. <p> If the environment is valid, this method will return quietly. Otherwise, it will throw a <code>PerforceException</code> with a message regarding the failure.</DL> <HR> <A NAME="getClient()"><!-- --></A><H3> getClient</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> <B>getClient</B>()</PRE> <DL> <DD>Returns the P4CLIENT.</DL> <HR> <A NAME="getEnvp()"><!-- --></A><H3> getEnvp</H3> <PRE> protected <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A>[] <B>getEnvp</B>()</PRE> <DL> </DL> <HR> <A NAME="getExecutable()"><!-- --></A><H3> getExecutable</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> <B>getExecutable</B>()</PRE> <DL> <DD>Returns the path to the executable.</DL> <HR> <A NAME="getPassword()"><!-- --></A><H3> getPassword</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> <B>getPassword</B>()</PRE> <DL> <DD>Returns the P4PASSWORD.</DL> <HR> <A NAME="getPath()"><!-- --></A><H3> getPath</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> <B>getPath</B>()</PRE> <DL> <DD>Returns the PATH.</DL> <HR> <A NAME="getPort()"><!-- --></A><H3> getPort</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> <B>getPort</B>()</PRE> <DL> <DD>Returns the P4PORT.</DL> <HR> <A NAME="getProperties()"><!-- --></A><H3> getProperties</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/util/Properties.html">Properties</A> <B>getProperties</B>()</PRE> <DL> <DD>Returns a new <code>Properties</code> instance that is set using the environments properties as its default.</DL> <HR> <A NAME="getProperty(java.lang.String)"><!-- --></A><H3> getProperty</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> <B>getProperty</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> key)</PRE> <DL> <DD>Searches for the property with the specified key in this property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns null if the property is not found.<DD><DL> <DT><B>Parameters:</B><DD><CODE>key</CODE> - the property key<DT><B>Returns:</B><DD>the value in this property list with the specified key value<DT><B>See Also: </B><DD><A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/util/Properties.html"><CODE>Properties</CODE></A></DL> </DD> </DL> <HR> <A NAME="getProperty(java.lang.String, java.lang.String)"><!-- --></A><H3> getProperty</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> <B>getProperty</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> key, <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> defaultValue)</PRE> <DL> <DD>Searches for the property with the specified key in this property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns the default value argument if the property is not found.<DD><DL> <DT><B>Parameters:</B><DD><CODE>key</CODE> - the property key<DD><CODE>defaultValue</CODE> - a default value<DT><B>Returns:</B><DD>the value in this property list with the specified key value<DT><B>See Also: </B><DD><A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/util/Properties.html"><CODE>Properties</CODE></A></DL> </DD> </DL> <HR> <A NAME="getServerTimeout()"><!-- --></A><H3> getServerTimeout</H3> <PRE> public long <B>getServerTimeout</B>()</PRE> <DL> <DD>Return the server timeout threshold.</DL> <HR> <A NAME="getUser()"><!-- --></A><H3> getUser</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> <B>getUser</B>()</PRE> <DL> <DD>Returns the P4USER.</DL> <HR> <A NAME="setClient(java.lang.String)"><!-- --></A><H3> setClient</H3> <PRE> public void <B>setClient</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> client)</PRE> <DL> <DD>Sets the P4CLIENT in the class information.<DD><DL> <DT><B>Parameters:</B><DD><CODE>user</CODE> - P4CLIENT value.</DL> </DD> </DL> <HR> <A NAME="setExecutable(java.lang.String)"><!-- --></A><H3> setExecutable</H3> <PRE> public void <B>setExecutable</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> exe)</PRE> <DL> <DD>Sets up the path to reach the p4 executable. The full path passed in must contain the executable or at least end in the system's file separator character. This gotten from the file.separator property. For example: <pre> p4.executable=/usr/bin/p4 # This will work p4.executable=/usr/bin/ # This will work <font color=Red>p4.executable=/usr/bin # This won't work</font> </pre><DD><DL> <DT><B>Parameters:</B><DD><CODE>exe</CODE> - Full path to the p4 executable.</DL> </DD> </DL> <HR> <A NAME="setFromProperties(java.util.Properties)"><!-- --></A><H3> setFromProperties</H3> <PRE> public void <B>setFromProperties</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/util/Properties.html">Properties</A> props)</PRE> <DL> <DD>Uses a set of <code>Properties</code> to set up the environment. The properties that are used used by this method are: <table border="1"> <thead><tr><th>Property</th><th>Value Set</th></tr></thead><tbody> <tr><td>p4.user</td><td>P4USER</td></tr> <tr><td>p4.client</td><td>P4CLIENT</td></tr> <tr><td>p4.port</td><td>P4PORT</td></tr> <tr><td>p4.password</td><td>P4PASSWORD</td></tr> <tr><td>p4.executable</td><td>Executable</td></tr> <tr><td>p4.sysdrive</td><td>SystemDrive</td></tr> <tr><td>p4.sysroot</td><td>SystemRoot</td></tr> <tr><td>p4.threshold</td><td>Server Timeout Threshold</td></tr> </tbody></table><DD><DL> <DT><B>Parameters:</B><DD><CODE>props</CODE> - Used to construct the environment.<DT><B>See Also: </B><DD><A HREF="../../../com/perforce/api/Env.html#setFromProperties(java.util.Properties)"><CODE>setFromProperties(Properties)</CODE></A></DL> </DD> </DL> <HR> <A NAME="setPassword(java.lang.String)"><!-- --></A><H3> setPassword</H3> <PRE> public void <B>setPassword</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> password)</PRE> <DL> <DD>Sets the P4PASSWD in the class information.<DD><DL> <DT><B>Parameters:</B><DD><CODE>user</CODE> - P4PASSWD value.</DL> </DD> </DL> <HR> <A NAME="setPath(java.lang.String)"><!-- --></A><H3> setPath</H3> <PRE> public void <B>setPath</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> path)</PRE> <DL> <DD>Sets the PATH in the class information.<DD><DL> <DT><B>Parameters:</B><DD><CODE>user</CODE> - PATH value.</DL> </DD> </DL> <HR> <A NAME="setPort(java.lang.String)"><!-- --></A><H3> setPort</H3> <PRE> public void <B>setPort</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> port)</PRE> <DL> <DD>Sets the P4PORT in the class information.<DD><DL> <DT><B>Parameters:</B><DD><CODE>user</CODE> - P4PORT value.</DL> </DD> </DL> <HR> <A NAME="setProperty(java.lang.String, java.lang.String)"><!-- --></A><H3> setProperty</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> <B>setProperty</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> key, <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> value)</PRE> <DL> <DD>Calls the hashtable method put. Provided for parallelism with the getProperty method. Enforces use of strings for property keys and values.<DD><DL> <DT><B>Parameters:</B><DD><CODE>key</CODE> - the key to be placed into this property list.<DD><CODE>value</CODE> - the value corresponding to key.<DT><B>See Also: </B><DD><A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/util/Properties.html#setProperty(java.lang.String, java.lang.String)"><CODE>Properties.setProperty(String,String)</CODE></A></DL> </DD> </DL> <HR> <A NAME="setServerTimeout(long)"><!-- --></A><H3> setServerTimeout</H3> <PRE> public void <B>setServerTimeout</B>(long threshold)</PRE> <DL> <DD>Set the server timeout threshold.</DL> <HR> <A NAME="setSystemDrive(java.lang.String)"><!-- --></A><H3> setSystemDrive</H3> <PRE> public void <B>setSystemDrive</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> drive)</PRE> <DL> <DD>Sets the SystemDrive in the class information. This is only meaningful under Windows.<DD><DL> <DT><B>Parameters:</B><DD><CODE>user</CODE> - SystemDrive value.</DL> </DD> </DL> <HR> <A NAME="setSystemRoot(java.lang.String)"><!-- --></A><H3> setSystemRoot</H3> <PRE> public void <B>setSystemRoot</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> root)</PRE> <DL> <DD>Sets the SystemRoot in the class information. This is only meaningful under Windows.<DD><DL> <DT><B>Parameters:</B><DD><CODE>user</CODE> - SystemRoot value.</DL> </DD> </DL> <HR> <A NAME="setUser(java.lang.String)"><!-- --></A><H3> setUser</H3> <PRE> public void <B>setUser</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> user)</PRE> <DL> <DD>Sets the P4USER in the class information.<DD><DL> <DT><B>Parameters:</B><DD><CODE>user</CODE> - P4USER value.</DL> </DD> </DL> <HR> <A NAME="toString()"><!-- --></A><H3> toString</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> <B>toString</B>()</PRE> <DL> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html#toString()">toString</A></CODE> in class <CODE><A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html">Object</A></CODE></DL> </DD> </DL> <HR> <A NAME="toXML()"><!-- --></A><H3> toXML</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> <B>toXML</B>()</PRE> <DL> <DD>Returns an XML representation of the environment.</DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ========== START OF NAVBAR ========== --> <A NAME="navbar_bottom"><!-- --></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Env.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <a target="_top" href="http://www.perforce.com/"><img alt="Perforce" border="0" height="44" width="151" src="doc-files/perforce_logo.gif"></a></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../com/perforce/api/DirEntry.html"><B>PREV CLASS</B></A> <A HREF="../../../com/perforce/api/EventLog.html"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Env.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> <i><a href="doc-files/LICENSE.TXT">Copyright</a> © 2001, Perforce Software, All rights reserved.</i> </BODY> </HTML>
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#7 | 2001 | David Markley | Updated package documentation. | ||
#6 | 1386 | David Markley | Updated the documentation. | ||
#5 | 1360 | David Markley | Updated Env class. | ||
#4 | 1332 | David Markley |
Added more example code. Added the Counter class. Corrected the filelog methods for the FileEntry class. |
||
#3 | 1148 | David Markley | Added a few examples and a server connection timeout threshold. | ||
#2 | 1037 | David Markley | Updated the documentation. | ||
#1 | 1020 | David Markley |
Added Perforce Java API documentation. This is generated using JavaDoc. |