Edit D:\app\Administrator\product\11.2.0\dbhome_1\owb\lib\int\HTTPClient\doc\api\HTTPClient\Util.html
<!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 May 07 18:52:26 PDT 2001 --> <TITLE> HTTPClient API: Class Util </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="../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="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="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../HTTPClient/URI.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="Util.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> HTTPClient</FONT> <BR> Class Util</H2> <PRE> <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html">java.lang.Object</A> | +--<B>HTTPClient.Util</B> </PRE> <HR> <DL> <DT>public class <B>Util</B><DT>extends <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html">Object</A></DL> <P> This class holds various utility methods. <P> <DL> <DT><B>Version: </B><DD>0.3-3 06/05/2001</DD> <DT><B>Author: </B><DD>Ronald Tschal?</DD> </DL> <HR> <P> <!-- ======== INNER CLASS SUMMARY ======== --> <!-- =========== FIELD SUMMARY =========== --> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <!-- ========== 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 <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/Util.html#assembleHeader(java.util.Vector)">assembleHeader</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/util/Vector.html">Vector</A> pheader)</CODE> <BR> Assembles a Vector of HttpHeaderElements into a full header string.</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="../HTTPClient/Util.html#defaultPort(java.lang.String)">defaultPort</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> protocol)</CODE> <BR> <B>Deprecated.</B> <I>use URI.defaultPort() instead</I></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.2/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/Util.html#dequoteString(java.lang.String)">dequoteString</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> str)</CODE> <BR> Replace quoted characters by their unquoted version.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../HTTPClient/HttpHeaderElement.html">HttpHeaderElement</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/Util.html#getElement(java.util.Vector, java.lang.String)">getElement</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/util/Vector.html">Vector</A> header, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> name)</CODE> <BR> Get the HttpHeaderElement with the name <var>name</var>.</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.2/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/Util.html#getFragment(java.lang.String)">getFragment</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> resource)</CODE> <BR> Extract the fragment part from an http resource.</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.2/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/Util.html#getParameter(java.lang.String, java.lang.String)">getParameter</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> param, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> hdr)</CODE> <BR> retrieves the value associated with the parameter <var>param</var> in a given header string.</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.2/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/Util.html#getParams(java.lang.String)">getParams</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> resource)</CODE> <BR> Extract the params part from an http resource.</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.2/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/Util.html#getPath(java.lang.String)">getPath</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> resource)</CODE> <BR> Extract the path from an http resource.</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.2/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/Util.html#getQuery(java.lang.String)">getQuery</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> resource)</CODE> <BR> Extract the query string from an http resource.</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="../HTTPClient/Util.html#hasToken(java.lang.String, java.lang.String)">hasToken</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> header, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> token)</CODE> <BR> Determines if the given header contains a certain token.</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.2/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/Util.html#httpDate(java.util.Date)">httpDate</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/util/Date.html">Date</A> date)</CODE> <BR> This returns a string containing the date and time in <var>date</var> formatted according to a subset of RFC-1123.</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.2/docs/api/java/util/Vector.html">Vector</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/Util.html#parseHeader(java.lang.String)">parseHeader</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> header)</CODE> <BR> This parses the value part of a header.</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.2/docs/api/java/util/Vector.html">Vector</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/Util.html#parseHeader(java.lang.String, boolean)">parseHeader</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> header, boolean dequote)</CODE> <BR> This parses the value part of a header.</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.2/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/Util.html#quoteString(java.lang.String, java.lang.String)">quoteString</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> str, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> qlist)</CODE> <BR> Replace given characters by their quoted version.</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="../HTTPClient/Util.html#sameHttpURL(java.net.URL, java.net.URL)">sameHttpURL</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/net/URL.html">URL</A> url1, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/net/URL.html">URL</A> url2)</CODE> <BR> Compares two http urls for equality.</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="../HTTPClient/Util.html#wildcardMatch(java.lang.String, java.lang.String)">wildcardMatch</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> pattern, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> name)</CODE> <BR> Match <var>pattern</var> against <var>name</var>, where <var>pattern</var> may contain wildcards ('*').</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.2/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.2/docs/api/java/lang/Object.html#clone()">clone</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#finalize()">finalize</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#getClass()">getClass</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#notify()">notify</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#toString()">toString</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#wait()">wait</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#wait(long)">wait</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#wait(long, int)">wait</A></CODE></TD> </TR> </TABLE> <P> <!-- ============ FIELD DETAIL =========== --> <!-- ========= CONSTRUCTOR DETAIL ======== --> <!-- ============ 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="dequoteString(java.lang.String)"><!-- --></A><H3> dequoteString</H3> <PRE> public static final <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> <B>dequoteString</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> str)</PRE> <DL> <DD>Replace quoted characters by their unquoted version. Quoted characters are characters preceded by a slash. E.g. "\c" would be replaced by "c". This is used in parsing http headers where quoted-characters are allowed in quoted-strings and often used to quote the quote character <">.<DD><DL> <DT><B>Parameters:</B><DD><CODE>str</CODE> - the string do dequote<DT><B>Returns:</B><DD>the string do with all quoted characters replaced by their true value.</DL> </DD> </DL> <HR> <A NAME="quoteString(java.lang.String, java.lang.String)"><!-- --></A><H3> quoteString</H3> <PRE> public static final <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> <B>quoteString</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> str, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> qlist)</PRE> <DL> <DD>Replace given characters by their quoted version. Quoted characters are characters preceded by a slash. E.g. "c" would be replaced by "\c". This is used in generating http headers where certain characters need to be quoted, such as the quote character <">.<DD><DL> <DT><B>Parameters:</B><DD><CODE>str</CODE> - the string do quote<DD><CODE>qlist</CODE> - the list of characters to quote<DT><B>Returns:</B><DD>the string do with all characters replaced by their quoted version.</DL> </DD> </DL> <HR> <A NAME="parseHeader(java.lang.String)"><!-- --></A><H3> parseHeader</H3> <PRE> public static final <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/util/Vector.html">Vector</A> <B>parseHeader</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> header) throws <A HREF="../HTTPClient/ParseException.html">ParseException</A></PRE> <DL> <DD>This parses the value part of a header. All quoted strings are dequoted.<DD><DL> <DT><B>Parameters:</B><DD><CODE>header</CODE> - the value part of the header.<DT><B>Returns:</B><DD>a Vector containing all the elements; each entry is an instance of <var>HttpHeaderElement</var>.<DT><B>Throws:</B><DD><A HREF="../HTTPClient/ParseException.html">ParseException</A> - if the syntax rules are violated.<DT><B>See Also: </B><DD><A HREF="../HTTPClient/Util.html#parseHeader(java.lang.String, boolean)"><CODE>parseHeader(java.lang.String, boolean)</CODE></A></DL> </DD> </DL> <HR> <A NAME="parseHeader(java.lang.String, boolean)"><!-- --></A><H3> parseHeader</H3> <PRE> public static final <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/util/Vector.html">Vector</A> <B>parseHeader</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> header, boolean dequote) throws <A HREF="../HTTPClient/ParseException.html">ParseException</A></PRE> <DL> <DD>This parses the value part of a header. The result is a Vector of HttpHeaderElement's. The syntax the header must conform to is: <PRE> header = [ element ] *( "," [ element ] ) element = name [ "=" [ value ] ] *( ";" [ param ] ) param = name [ "=" [ value ] ] name = token value = ( token | quoted-string ) token = 1*<any char except "=", ",", ";", <"> and white space> quoted-string = <"> *( text | quoted-char ) <"> text = any char except <"> quoted-char = "\" char </PRE> Any amount of white space is allowed between any part of the header, element or param and is ignored. A missing value in any element or param will be stored as the empty string; if the "=" is also missing <var>null</var> will be stored instead.<DD><DL> <DT><B>Parameters:</B><DD><CODE>header</CODE> - the value part of the header.<DD><CODE>dequote</CODE> - if true all quoted strings are dequoted.<DT><B>Returns:</B><DD>a Vector containing all the elements; each entry is an instance of <var>HttpHeaderElement</var>.<DT><B>Throws:</B><DD><A HREF="../HTTPClient/ParseException.html">ParseException</A> - if the above syntax rules are violated.<DT><B>See Also: </B><DD><A HREF="../HTTPClient/HttpHeaderElement.html"><CODE>HttpHeaderElement</CODE></A></DL> </DD> </DL> <HR> <A NAME="hasToken(java.lang.String, java.lang.String)"><!-- --></A><H3> hasToken</H3> <PRE> public static final boolean <B>hasToken</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> header, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> token) throws <A HREF="../HTTPClient/ParseException.html">ParseException</A></PRE> <DL> <DD>Determines if the given header contains a certain token. The header must conform to the rules outlined in parseHeader().<DD><DL> <DT><B>Parameters:</B><DD><CODE>header</CODE> - the header value.<DD><CODE>token</CODE> - the token to find; the match is case-insensitive.<DT><B>Returns:</B><DD>true if the token is present, false otherwise.<DT><B>Throws:</B><DD><A HREF="../HTTPClient/ParseException.html">ParseException</A> - if this is thrown parseHeader().<DT><B>See Also: </B><DD><A HREF="../HTTPClient/Util.html#parseHeader(java.lang.String)"><CODE>parseHeader(java.lang.String)</CODE></A></DL> </DD> </DL> <HR> <A NAME="getElement(java.util.Vector, java.lang.String)"><!-- --></A><H3> getElement</H3> <PRE> public static final <A HREF="../HTTPClient/HttpHeaderElement.html">HttpHeaderElement</A> <B>getElement</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/util/Vector.html">Vector</A> header, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> name)</PRE> <DL> <DD>Get the HttpHeaderElement with the name <var>name</var>.<DD><DL> <DT><B>Parameters:</B><DD><CODE>header</CODE> - a vector of HttpHeaderElement's, such as is returned from <code>parseHeader()</code><DD><CODE>name</CODE> - the name of element to retrieve; matching is case-insensitive<DT><B>Returns:</B><DD>the request element, or null if none found.<DT><B>See Also: </B><DD><A HREF="../HTTPClient/Util.html#parseHeader(java.lang.String)"><CODE>parseHeader(java.lang.String)</CODE></A></DL> </DD> </DL> <HR> <A NAME="getParameter(java.lang.String, java.lang.String)"><!-- --></A><H3> getParameter</H3> <PRE> public static final <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> <B>getParameter</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> param, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> hdr) throws <A HREF="../HTTPClient/ParseException.html">ParseException</A></PRE> <DL> <DD>retrieves the value associated with the parameter <var>param</var> in a given header string. It parses the header using <code>parseHeader()</code> and then searches the first element for the given parameter. This is used especially in headers like 'Content-type' and 'Content-Disposition'. <P>quoted characters ("\x") in a quoted string are dequoted.<DD><DL> <DT><B>Parameters:</B><DD><CODE>param</CODE> - the parameter name<DD><CODE>hdr</CODE> - the header value<DT><B>Returns:</B><DD>the value for this parameter, or null if not found.<DT><B>Throws:</B><DD><A HREF="../HTTPClient/ParseException.html">ParseException</A> - if the above syntax rules are violated.<DT><B>See Also: </B><DD><A HREF="../HTTPClient/Util.html#parseHeader(java.lang.String)"><CODE>parseHeader(java.lang.String)</CODE></A></DL> </DD> </DL> <HR> <A NAME="assembleHeader(java.util.Vector)"><!-- --></A><H3> assembleHeader</H3> <PRE> public static final <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> <B>assembleHeader</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/util/Vector.html">Vector</A> pheader)</PRE> <DL> <DD>Assembles a Vector of HttpHeaderElements into a full header string. The individual header elements are seperated by a ", ".<DD><DL> <DT><B>Parameters:</B><DD><CODE>the</CODE> - parsed header<DT><B>Returns:</B><DD>a string containing the assembled header</DL> </DD> </DL> <HR> <A NAME="sameHttpURL(java.net.URL, java.net.URL)"><!-- --></A><H3> sameHttpURL</H3> <PRE> public static final boolean <B>sameHttpURL</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/net/URL.html">URL</A> url1, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/net/URL.html">URL</A> url2)</PRE> <DL> <DD>Compares two http urls for equality. This exists because the method <code>java.net.URL.sameFile()</code> is broken (an explicit port 80 doesn't compare equal to an implicit port, and it doesn't take escapes into account). <P>Two http urls are considered equal if they have the same protocol (case-insensitive match), the same host (case-insensitive), the same port and the same file (after decoding escaped characters).<DD><DL> <DT><B>Parameters:</B><DD><CODE>url1</CODE> - the first url<DD><CODE>url1</CODE> - the second url<DT><B>Returns:</B><DD>true if <var>url1</var> and <var>url2</var> compare equal</DL> </DD> </DL> <HR> <A NAME="defaultPort(java.lang.String)"><!-- --></A><H3> defaultPort</H3> <PRE> public static final int <B>defaultPort</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> protocol)</PRE> <DL> <DD><B>Deprecated.</B> <I>use URI.defaultPort() instead</I> <P> <DD>Return the default port used by a given protocol.<DD><DL> <DT><B>Parameters:</B><DD><CODE>protocol</CODE> - the protocol<DT><B>Returns:</B><DD>the port number, or 0 if unknown<DT><B>See Also: </B><DD><A HREF="../HTTPClient/URI.html#defaultPort(java.lang.String)"><CODE>URI.defaultPort(java.lang.String)</CODE></A></DL> </DD> </DL> <HR> <A NAME="httpDate(java.util.Date)"><!-- --></A><H3> httpDate</H3> <PRE> public static final <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> <B>httpDate</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/util/Date.html">Date</A> date)</PRE> <DL> <DD>This returns a string containing the date and time in <var>date</var> formatted according to a subset of RFC-1123. The format is defined in the HTTP/1.0 spec (RFC-1945), section 3.3, and the HTTP/1.1 spec (RFC-2616), section 3.3.1. Note that Date.toGMTString() is close, but is missing the weekday and supresses the leading zero if the day is less than the 10th. Instead we use the SimpleDateFormat class. <P>Some versions of JDK 1.1.x are bugged in that their GMT uses daylight savings time... Therefore we use our own timezone definitions.<DD><DL> <DT><B>Parameters:</B><DD><CODE>date</CODE> - the date and time to be converted<DT><B>Returns:</B><DD>a string containg the date and time as used in http</DL> </DD> </DL> <HR> <A NAME="getPath(java.lang.String)"><!-- --></A><H3> getPath</H3> <PRE> public static final <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> <B>getPath</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> resource)</PRE> <DL> <DD>Extract the path from an http resource. <P>The "resource" part of an HTTP URI can contain a number of parts, some of which are not always of interest. These methods here will extract the various parts, assuming the following syntanx (taken from RFC-2616): <PRE> resource = [ "/" ] [ path ] [ ";" params ] [ "?" query ] [ "#" fragment ] </PRE><DD><DL> <DT><B>Parameters:</B><DD><CODE>the</CODE> - resource to split<DT><B>Returns:</B><DD>the path, including any leading "/"<DT><B>See Also: </B><DD><A HREF="../HTTPClient/Util.html#getParams(java.lang.String)"><CODE>getParams(java.lang.String)</CODE></A>, <A HREF="../HTTPClient/Util.html#getQuery(java.lang.String)"><CODE>getQuery(java.lang.String)</CODE></A>, <A HREF="../HTTPClient/Util.html#getFragment(java.lang.String)"><CODE>getFragment(java.lang.String)</CODE></A></DL> </DD> </DL> <HR> <A NAME="getParams(java.lang.String)"><!-- --></A><H3> getParams</H3> <PRE> public static final <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> <B>getParams</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> resource)</PRE> <DL> <DD>Extract the params part from an http resource.<DD><DL> <DT><B>Parameters:</B><DD><CODE>the</CODE> - resource to split<DT><B>Returns:</B><DD>the params, or null if there are none<DT><B>See Also: </B><DD><A HREF="../HTTPClient/Util.html#getPath(java.lang.String)"><CODE>getPath(java.lang.String)</CODE></A></DL> </DD> </DL> <HR> <A NAME="getQuery(java.lang.String)"><!-- --></A><H3> getQuery</H3> <PRE> public static final <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> <B>getQuery</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> resource)</PRE> <DL> <DD>Extract the query string from an http resource.<DD><DL> <DT><B>Parameters:</B><DD><CODE>the</CODE> - resource to split<DT><B>Returns:</B><DD>the query, or null if there was none<DT><B>See Also: </B><DD><A HREF="../HTTPClient/Util.html#getPath(java.lang.String)"><CODE>getPath(java.lang.String)</CODE></A></DL> </DD> </DL> <HR> <A NAME="getFragment(java.lang.String)"><!-- --></A><H3> getFragment</H3> <PRE> public static final <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> <B>getFragment</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> resource)</PRE> <DL> <DD>Extract the fragment part from an http resource.<DD><DL> <DT><B>Parameters:</B><DD><CODE>the</CODE> - resource to split<DT><B>Returns:</B><DD>the fragment, or null if there was none<DT><B>See Also: </B><DD><A HREF="../HTTPClient/Util.html#getPath(java.lang.String)"><CODE>getPath(java.lang.String)</CODE></A></DL> </DD> </DL> <HR> <A NAME="wildcardMatch(java.lang.String, java.lang.String)"><!-- --></A><H3> wildcardMatch</H3> <PRE> public static final boolean <B>wildcardMatch</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> pattern, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> name)</PRE> <DL> <DD>Match <var>pattern</var> against <var>name</var>, where <var>pattern</var> may contain wildcards ('*').<DD><DL> <DT><B>Parameters:</B><DD><CODE>pattern</CODE> - the pattern to match; may contain '*' which match any number (0 or more) of any character (think file globbing)<DD><CODE>name</CODE> - the name to match against the pattern<DT><B>Returns:</B><DD>true if the name matches the pattern; false otherwise</DL> </DD> </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="../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="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="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../HTTPClient/URI.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="Util.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> </BODY> </HTML>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de