MCPcopy Index your code
hub / github.com/apache/tomcat / newInstance

Method newInstance

java/org/apache/tomcat/util/scan/JarFactory.java:45–61  ·  view source on GitHub ↗

Create a new Jar instance for the given URL. @param url the URL of the JAR file @return the new Jar instance @throws IOException if an I/O error occurs

(URL url)

Source from the content-addressed store, hash-verified

43 * @throws IOException if an I/O error occurs
44 */
45 public static Jar newInstance(URL url) throws IOException {
46 String urlString = url.toString();
47 if (urlString.startsWith("jar:file:")) {
48 if (urlString.endsWith("!/")) {
49 return new JarFileUrlJar(url, true);
50 } else {
51 return new JarFileUrlNestedJar(url);
52 }
53 } else if (urlString.startsWith("war:file:")) {
54 URL jarUrl = UriUtil.warToJar(url);
55 return new JarFileUrlNestedJar(jarUrl);
56 } else if (urlString.startsWith("file:")) {
57 return new JarFileUrlJar(url, false);
58 } else {
59 return new UrlJar(url);
60 }
61 }
62
63
64 /**

Callers 11

scanMethod · 0.95
isOutDatedMethod · 0.95
scanForResourceJARsMethod · 0.95
getResourceMethod · 0.95
getResourcePathsMethod · 0.95
openMethod · 0.95
processMethod · 0.95
processResourceJARsMethod · 0.95
processAnnotationsJarMethod · 0.95

Calls 4

warToJarMethod · 0.95
endsWithMethod · 0.80
toStringMethod · 0.65
startsWithMethod · 0.45

Tested by 3

scanMethod · 0.76