PageRenderTime 114ms CodeModel.GetById 18ms app.highlight 80ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/apache-log4j/site/apidocs/org/apache/log4j/lf5/util/ResourceUtils.html

https://bitbucket.org/arkban/somersault
HTML | 301 lines | 246 code | 33 blank | 22 comment | 0 complexity | b9055a294d5c276c1c354c4dd6da3326 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-3-Clause, Apache-2.0
  1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2<!--NewPage-->
  3<HTML>
  4<HEAD>
  5<!-- Generated by javadoc (build 1.6.0_16) -->
  6<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7<TITLE>
  8ResourceUtils (Apache Log4j 1.2.16 API)
  9</TITLE>
 10
 11<META NAME="date" CONTENT="2010-03-30">
 12
 13<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
 14
 15<SCRIPT type="text/javascript">
 16function windowTitle()
 17{
 18    if (location.href.indexOf('is-external=true') == -1) {
 19        parent.document.title="ResourceUtils (Apache Log4j 1.2.16 API)";
 20    }
 21}
 22</SCRIPT>
 23<NOSCRIPT>
 24</NOSCRIPT>
 25
 26</HEAD>
 27
 28<BODY BGCOLOR="white" onload="windowTitle();">
 29<HR>
 30
 31
 32<!-- ========= START OF TOP NAVBAR ======= -->
 33<A NAME="navbar_top"><!-- --></A>
 34<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
 35<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
 36<TR>
 37<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
 38<A NAME="navbar_top_firstrow"><!-- --></A>
 39<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
 40  <TR ALIGN="center" VALIGN="top">
 41  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
 42  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
 43  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
 44  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ResourceUtils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
 45  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
 46  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
 47  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
 48  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
 49  </TR>
 50</TABLE>
 51</TD>
 52<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
 53</EM>
 54</TD>
 55</TR>
 56
 57<TR>
 58<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
 59&nbsp;<A HREF="../../../../../org/apache/log4j/lf5/util/Resource.html" title="class in org.apache.log4j.lf5.util"><B>PREV CLASS</B></A>&nbsp;
 60&nbsp;<A HREF="../../../../../org/apache/log4j/lf5/util/StreamUtils.html" title="class in org.apache.log4j.lf5.util"><B>NEXT CLASS</B></A></FONT></TD>
 61<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
 62  <A HREF="../../../../../index.html?org/apache/log4j/lf5/util/ResourceUtils.html" target="_top"><B>FRAMES</B></A>  &nbsp;
 63&nbsp;<A HREF="ResourceUtils.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
 64&nbsp;<SCRIPT type="text/javascript">
 65  <!--
 66  if(window==top) {
 67    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
 68  }
 69  //-->
 70</SCRIPT>
 71<NOSCRIPT>
 72  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
 73</NOSCRIPT>
 74
 75
 76</FONT></TD>
 77</TR>
 78<TR>
 79<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
 80  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
 81<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
 82DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
 83</TR>
 84</TABLE>
 85<A NAME="skip-navbar_top"></A>
 86<!-- ========= END OF TOP NAVBAR ========= -->
 87
 88<HR>
 89<!-- ======== START OF CLASS DATA ======== -->
 90<H2>
 91<FONT SIZE="-1">
 92org.apache.log4j.lf5.util</FONT>
 93<BR>
 94Class ResourceUtils</H2>
 95<PRE>
 96<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
 97  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.log4j.lf5.util.ResourceUtils</B>
 98</PRE>
 99<HR>
100<DL>
101<DT><PRE>public class <B>ResourceUtils</B><DT>extends <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
102</PRE>
103
104<P>
105ResourceUtils.  Provide a set of convenience methods for working with
106 Resources.
107<P>
108
109<P>
110<DL>
111<DT><B>Author:</B></DT>
112  <DD>Michael J. Sikorsky, Robert Shaw</DD>
113<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/log4j/lf5/util/Resource.html" title="class in org.apache.log4j.lf5.util"><CODE>Resource</CODE></A></DL>
114<HR>
115
116<P>
117
118<!-- ======== CONSTRUCTOR SUMMARY ======== -->
119
120<A NAME="constructor_summary"><!-- --></A>
121<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
122<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
123<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
124<B>Constructor Summary</B></FONT></TH>
125</TR>
126<TR BGCOLOR="white" CLASS="TableRowColor">
127<TD><CODE><B><A HREF="../../../../../org/apache/log4j/lf5/util/ResourceUtils.html#ResourceUtils()">ResourceUtils</A></B>()</CODE>
128
129<BR>
130&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
131</TR>
132</TABLE>
133&nbsp;
134<!-- ========== METHOD SUMMARY =========== -->
135
136<A NAME="method_summary"><!-- --></A>
137<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
138<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
139<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
140<B>Method Summary</B></FONT></TH>
141</TR>
142<TR BGCOLOR="white" CLASS="TableRowColor">
143<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
144<CODE>static&nbsp;<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A></CODE></FONT></TD>
145<TD><CODE><B><A HREF="../../../../../org/apache/log4j/lf5/util/ResourceUtils.html#getResourceAsStream(java.lang.Object, org.apache.log4j.lf5.util.Resource)">getResourceAsStream</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;object,
146                    <A HREF="../../../../../org/apache/log4j/lf5/util/Resource.html" title="class in org.apache.log4j.lf5.util">Resource</A>&nbsp;resource)</CODE>
147
148<BR>
149&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the InputStream for this resource.</TD>
150</TR>
151<TR BGCOLOR="white" CLASS="TableRowColor">
152<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
153<CODE>static&nbsp;<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net">URL</A></CODE></FONT></TD>
154<TD><CODE><B><A HREF="../../../../../org/apache/log4j/lf5/util/ResourceUtils.html#getResourceAsURL(java.lang.Object, org.apache.log4j.lf5.util.Resource)">getResourceAsURL</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;object,
155                 <A HREF="../../../../../org/apache/log4j/lf5/util/Resource.html" title="class in org.apache.log4j.lf5.util">Resource</A>&nbsp;resource)</CODE>
156
157<BR>
158&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the URL for this resource.</TD>
159</TR>
160</TABLE>
161&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
162<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
163<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
164<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
165</TR>
166<TR BGCOLOR="white" CLASS="TableRowColor">
167<TD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
168</TR>
169</TABLE>
170&nbsp;
171<P>
172
173<!-- ========= CONSTRUCTOR DETAIL ======== -->
174
175<A NAME="constructor_detail"><!-- --></A>
176<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
177<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
178<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
179<B>Constructor Detail</B></FONT></TH>
180</TR>
181</TABLE>
182
183<A NAME="ResourceUtils()"><!-- --></A><H3>
184ResourceUtils</H3>
185<PRE>
186public <B>ResourceUtils</B>()</PRE>
187<DL>
188</DL>
189
190<!-- ============ METHOD DETAIL ========== -->
191
192<A NAME="method_detail"><!-- --></A>
193<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
194<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
195<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
196<B>Method Detail</B></FONT></TH>
197</TR>
198</TABLE>
199
200<A NAME="getResourceAsStream(java.lang.Object, org.apache.log4j.lf5.util.Resource)"><!-- --></A><H3>
201getResourceAsStream</H3>
202<PRE>
203public static <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A> <B>getResourceAsStream</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;object,
204                                              <A HREF="../../../../../org/apache/log4j/lf5/util/Resource.html" title="class in org.apache.log4j.lf5.util">Resource</A>&nbsp;resource)</PRE>
205<DL>
206<DD>Get the InputStream for this resource.  Note: to convert an InputStream
207 into an InputReader, use: new InputStreamReader(InputStream).
208<P>
209<DD><DL>
210<DT><B>Parameters:</B><DD><CODE>object</CODE> - The object to grab the Classloader from.
211                 This parameter is quite important from a
212                 visibility of resources standpoint as the
213                 hierarchy of Classloaders plays a role.<DD><CODE>resource</CODE> - The resource to load.
214<DT><B>Returns:</B><DD>If the Resource was found, the InputStream, otherwise null.<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/log4j/lf5/util/Resource.html" title="class in org.apache.log4j.lf5.util"><CODE>Resource</CODE></A>, 
215<A HREF="../../../../../org/apache/log4j/lf5/util/ResourceUtils.html#getResourceAsURL(java.lang.Object, org.apache.log4j.lf5.util.Resource)"><CODE>getResourceAsURL(Object,Resource)</CODE></A>, 
216<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><CODE>InputStream</CODE></A></DL>
217</DD>
218</DL>
219<HR>
220
221<A NAME="getResourceAsURL(java.lang.Object, org.apache.log4j.lf5.util.Resource)"><!-- --></A><H3>
222getResourceAsURL</H3>
223<PRE>
224public static <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net">URL</A> <B>getResourceAsURL</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;object,
225                                   <A HREF="../../../../../org/apache/log4j/lf5/util/Resource.html" title="class in org.apache.log4j.lf5.util">Resource</A>&nbsp;resource)</PRE>
226<DL>
227<DD>Get the URL for this resource.
228<P>
229<DD><DL>
230<DT><B>Parameters:</B><DD><CODE>object</CODE> - The object to grab the Classloader from.
231                 This parameter is quite important from a
232                 visibility of resources standpoint as the
233                 hierarchy of Classloaders plays a role.<DD><CODE>resource</CODE> - The resource to load.
234<DT><B>Returns:</B><DD>If the Resource was found, the URL, otherwise null.<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/log4j/lf5/util/Resource.html" title="class in org.apache.log4j.lf5.util"><CODE>Resource</CODE></A>, 
235<A HREF="../../../../../org/apache/log4j/lf5/util/ResourceUtils.html#getResourceAsStream(java.lang.Object, org.apache.log4j.lf5.util.Resource)"><CODE>getResourceAsStream(Object,Resource)</CODE></A></DL>
236</DD>
237</DL>
238<!-- ========= END OF CLASS DATA ========= -->
239<HR>
240
241
242<!-- ======= START OF BOTTOM NAVBAR ====== -->
243<A NAME="navbar_bottom"><!-- --></A>
244<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
245<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
246<TR>
247<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
248<A NAME="navbar_bottom_firstrow"><!-- --></A>
249<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
250  <TR ALIGN="center" VALIGN="top">
251  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
252  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
253  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
254  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ResourceUtils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
255  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
256  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
257  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
258  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
259  </TR>
260</TABLE>
261</TD>
262<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
263</EM>
264</TD>
265</TR>
266
267<TR>
268<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
269&nbsp;<A HREF="../../../../../org/apache/log4j/lf5/util/Resource.html" title="class in org.apache.log4j.lf5.util"><B>PREV CLASS</B></A>&nbsp;
270&nbsp;<A HREF="../../../../../org/apache/log4j/lf5/util/StreamUtils.html" title="class in org.apache.log4j.lf5.util"><B>NEXT CLASS</B></A></FONT></TD>
271<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
272  <A HREF="../../../../../index.html?org/apache/log4j/lf5/util/ResourceUtils.html" target="_top"><B>FRAMES</B></A>  &nbsp;
273&nbsp;<A HREF="ResourceUtils.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
274&nbsp;<SCRIPT type="text/javascript">
275  <!--
276  if(window==top) {
277    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
278  }
279  //-->
280</SCRIPT>
281<NOSCRIPT>
282  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
283</NOSCRIPT>
284
285
286</FONT></TD>
287</TR>
288<TR>
289<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
290  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
291<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
292DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
293</TR>
294</TABLE>
295<A NAME="skip-navbar_bottom"></A>
296<!-- ======== END OF BOTTOM NAVBAR ======= -->
297
298<HR>
299Copyright &#169; 1999-2010 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved.
300</BODY>
301</HTML>