Top Inners Fields Constructors Methods
com.sun.faces.facelets.util

public final Class Classpath

extends Object
Class Inheritance
Static Imports
java.nio.charset.StandardCharsets.UTF_8

Authors
Jacob Hookom, Roland Huss, Ales Justin ([email protected])

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
private static final String[]
private static final String[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static JarFile
getAlternativeJarFile(URL url)

For URLs to JARs that do not use JarURLConnection - allowed by the servlet spec - attempt to produce a JarFile object all the same.

pack-priv static JarFile
private static InputStream

Returns:

input stream or null if not possible
getInputStream
(URL
the url to open
url
)

Open input stream from url.

private static String

Returns:

joined tokens
join
(String[]
the tokens
tokens
,
boolean
do we exclude last token
excludeLast
)

Join tokens, exlude last if param equals true.

public static URL[]
search(String prefix, String suffix)

public static URL[]
search(ClassLoader cl, String prefix, String suffix)

public static URL[]
search(ClassLoader cl, String prefix, String suffix, Classpath.SearchAdvice advice)

private static boolean
searchDir(Set<URL> result, File file, String suffix)

private static void
searchFromURL(Set<URL>
the result urls
result
,
String
the current prefix
prefix
,
String
the suffix to match
suffix
,
URL
the current url to start search
url
)

Search from URL.

private static void
searchJar(ClassLoader cl, Set<URL> result, JarFile file, String prefix, String suffix, Classpath.SearchAdvice advice)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EXTENSIONS_TO_EXCLUDEback to summary
private static final String[] EXTENSIONS_TO_EXCLUDE
PREFIXES_TO_EXCLUDEback to summary
private static final String[] PREFIXES_TO_EXCLUDE

Constructor Detail

Classpathback to summary
public Classpath()

Method Detail

getAlternativeJarFileback to summary
private static JarFile getAlternativeJarFile(URL url) throws IOException

For URLs to JARs that do not use JarURLConnection - allowed by the servlet spec - attempt to produce a JarFile object all the same. Known servlet engines that function like this include Weblogic and OC4J. This is not a full solution, since an unpacked WAR or EAR will not have JAR "files" as such.

getAlternativeJarFileback to summary
pack-priv static JarFile getAlternativeJarFile(String urlFile) throws IOException
getInputStreamback to summary
private static InputStream getInputStream(URL url)

Open input stream from url. Ignore any errors.

Parameters
url:URL

the url to open

Returns:InputStream

input stream or null if not possible

joinback to summary
private static String join(String[] tokens, boolean excludeLast)

Join tokens, exlude last if param equals true.

Parameters
tokens:String[]

the tokens

excludeLast:boolean

do we exclude last token

Returns:String

joined tokens

searchback to summary
public static URL[] search(String prefix, String suffix) throws IOException
searchback to summary
public static URL[] search(ClassLoader cl, String prefix, String suffix) throws IOException
searchback to summary
public static URL[] search(ClassLoader cl, String prefix, String suffix, Classpath.SearchAdvice advice) throws IOException
searchDirback to summary
private static boolean searchDir(Set<URL> result, File file, String suffix) throws IOException
searchFromURLback to summary
private static void searchFromURL(Set<URL> result, String prefix, String suffix, URL url) throws IOException

Search from URL. Fall back on prefix tokens if not able to read from original url param.

Parameters
result:Set<URL>

the result urls

prefix:String

the current prefix

suffix:String

the suffix to match

url:URL

the current url to start search

Exceptions
IOException:
for any error
searchJarback to summary
private static void searchJar(ClassLoader cl, Set<URL> result, JarFile file, String prefix, String suffix, Classpath.SearchAdvice advice) throws IOException
com.sun.faces.facelets.util back to summary

public final Enum Classpath.SearchAdvice

extends Enum<Classpath.SearchAdvice>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final Classpath.SearchAdvice
public static final Classpath.SearchAdvice

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Classpath.SearchAdvice
public static Classpath.SearchAdvice[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

AllMatchesback to summary
public static final Classpath.SearchAdvice AllMatches
FirstMatchOnlyback to summary
public static final Classpath.SearchAdvice FirstMatchOnly

Constructor Detail

SearchAdviceback to summary
private SearchAdvice()

Method Detail

valueOfback to summary
public static Classpath.SearchAdvice valueOf(String name)
valuesback to summary
public static Classpath.SearchAdvice[] values()