ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/catalina/webresources/ClasspathURLStreamHandler.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/catalina/webresources/ClasspathURLStreamHandler.java
Status
scanned
Type
file
Name
ClasspathURLStreamHandler.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
1920 (1.9 KB)
MD5
5bfbe73b644516c846e14bb12c365320
SHA1
b95ea0181133c8df6c18e855b0f56416b0ec387b
SHA256
f486ad6e232cd229ed1d116d26503e6fd2f476c4ad15f27758c5a5a5f3d32e39
SHA512

      
    
SHA1_git
b87b324afda03cc1515bb0c66b2a1cea9cab3088
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
ClasspathURLStreamHandler.java | 1.9 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.catalina.webresources; import java.io.FileNotFoundException; import java.io.IOException; import java.net.URL; import java.net.URLConnection; import java.net.URLStreamHandler; import org.apache.tomcat.util.res.StringManager; public class ClasspathURLStreamHandler extends URLStreamHandler { private static final StringManager sm = StringManager.getManager(ClasspathURLStreamHandler.class); @Override protected URLConnection openConnection(URL u) throws IOException { String path = u.getPath(); // Thread context class loader first URL classpathUrl = Thread.currentThread().getContextClassLoader().getResource(path); if (classpathUrl == null) { // This class's class loader if no joy with the tccl classpathUrl = ClasspathURLStreamHandler.class.getResource(path); } if (classpathUrl == null) { throw new FileNotFoundException(sm.getString("classpathUrlStreamHandler.notFound", u)); } return classpathUrl.openConnection(); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
55.09
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9