<!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 Tue Dec 04 15:40:27 EST 2001 --> <TITLE> Perforce API: Class Utils </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/Utils.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/User.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Utils.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 Utils</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.Utils</B> </PRE> <HR> <DL> <DT>public final class <B>Utils</B><DT>extends <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html">Object</A></DL> <P> Class that contains static utility methods. <P> <DL> <DT><B>Version: </B><DD>$Date: 2001/12/04 $ $Revision: #3 $</DD> <DT><B>Author: </B><DD><a href="mailto:david@markley.cc">David Markley</a></DD> <DT><B>See Also: </B><DD><A HREF="../../../com/perforce/api/HashDecay.html"><CODE>HashDecay</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/Utils.html#Utils()">Utils</A></B>()</CODE> <BR> </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>static void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Utils.html#cleanUp()">cleanUp</A></B>()</CODE> <BR> Cleans up after the package has been used.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <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/Utils.html#commonPrefix(java.util.Enumeration)">commonPrefix</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/util/Enumeration.html">Enumeration</A> en)</CODE> <BR> Returns common prefix for an Enumeration of strings.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <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/Utils.html#commonPrefix(java.util.Vector)">commonPrefix</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/util/Vector.html">Vector</A> v)</CODE> <BR> Returns common prefix for a Vector of strings.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Utils.html#getChangeFromPath(java.lang.String)">getChangeFromPath</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> path)</CODE> <BR> Returns the change number portion of a depot path, if there is a valid one found.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <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/Utils.html#HTMLEncode(java.lang.String)">HTMLEncode</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> str)</CODE> <BR> Returns the string encoded for HTML use.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Utils.html#initPackage()">initPackage</A></B>()</CODE> <BR> Initializes the package, in order to avoid some arbitrary JVM problems that have been encountered.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Utils.html#isMSJVM()">isMSJVM</A></B>()</CODE> <BR> Check to see if the current Java Virtual Machine is made by Microsoft</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Utils.html#isWindows()">isWindows</A></B>()</CODE> <BR> Check to see if the current operating system is a Windows OS</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/perforce/api/Utils.html#wildPathMatch(java.lang.String, java.lang.String)">wildPathMatch</A></B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> wildpath, <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> path)</CODE> <BR> Returns true if the <code>path</code> matches the <code>wildpath</code>.</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#toString()">toString</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="Utils()"><!-- --></A><H3> Utils</H3> <PRE> public <B>Utils</B>()</PRE> <DL> </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="cleanUp()"><!-- --></A><H3> cleanUp</H3> <PRE> public static void <B>cleanUp</B>()</PRE> <DL> <DD>Cleans up after the package has been used. This stops any running threads and releases any objects for garbage collection.</DL> <HR> <A NAME="commonPrefix(java.util.Enumeration)"><!-- --></A><H3> commonPrefix</H3> <PRE> public static <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> <B>commonPrefix</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/util/Enumeration.html">Enumeration</A> en)</PRE> <DL> <DD>Returns common prefix for an Enumeration of strings.</DL> <HR> <A NAME="commonPrefix(java.util.Vector)"><!-- --></A><H3> commonPrefix</H3> <PRE> public static <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> <B>commonPrefix</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/util/Vector.html">Vector</A> v)</PRE> <DL> <DD>Returns common prefix for a Vector of strings. This is very useful for determining a commong prefix for a set of paths.</DL> <HR> <A NAME="getChangeFromPath(java.lang.String)"><!-- --></A><H3> getChangeFromPath</H3> <PRE> public static final int <B>getChangeFromPath</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> path)</PRE> <DL> <DD>Returns the change number portion of a depot path, if there is a valid one found. Otherwise, it returns -1.</DL> <HR> <A NAME="HTMLEncode(java.lang.String)"><!-- --></A><H3> HTMLEncode</H3> <PRE> public static <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> <B>HTMLEncode</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> str)</PRE> <DL> <DD>Returns the string encoded for HTML use.<p> > becomes > and < becomes <</DL> <HR> <A NAME="initPackage()"><!-- --></A><H3> initPackage</H3> <PRE> public static void <B>initPackage</B>()</PRE> <DL> <DD>Initializes the package, in order to avoid some arbitrary JVM problems that have been encountered. This is a hack and should not have to be done if certain overbearing empires starting with the letter M built a fully compliant JVM.</DL> <HR> <A NAME="isMSJVM()"><!-- --></A><H3> isMSJVM</H3> <PRE> public static boolean <B>isMSJVM</B>()</PRE> <DL> <DD>Check to see if the current Java Virtual Machine is made by Microsoft<DD><DL> <DT><B>Returns:</B><DD>boolean true if the java.vendor property comtains the word 'Microsoft'</DL> </DD> </DL> <HR> <A NAME="isWindows()"><!-- --></A><H3> isWindows</H3> <PRE> public static boolean <B>isWindows</B>()</PRE> <DL> <DD>Check to see if the current operating system is a Windows OS<DD><DL> <DT><B>Returns:</B><DD>boolean true if the os.name property comtains the word 'Windows'</DL> </DD> </DL> <HR> <A NAME="wildPathMatch(java.lang.String, java.lang.String)"><!-- --></A><H3> wildPathMatch</H3> <PRE> public static boolean <B>wildPathMatch</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> wildpath, <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/String.html">String</A> path)</PRE> <DL> <DD>Returns true if the <code>path</code> matches the <code>wildpath</code>. Only perforce wildcards are considered in the <code>wildpath</code>.</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/Utils.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/User.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Utils.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 | |
---|---|---|---|---|---|
#8 | 2001 | David Markley | Updated package documentation. | ||
#7 | 1887 | David Markley | Updated the class docs. | ||
#6 | 1387 | David Markley |
Added the ability to reopen files, add them to changelists, and updated the documentation to reflect these changes. |
||
#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 | 1147 | David Markley | Added the ability to clean up threads after the package has been used. | ||
#2 | 1037 | David Markley | Updated the documentation. | ||
#1 | 1020 | David Markley |
Added Perforce Java API documentation. This is generated using JavaDoc. |