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

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

      
    
Rootfs path

      
    
Size
1986 (1.9 KB)
MD5
9c6439677826988ada5681b3eccad483
SHA1
6f3167563b160e5c238884177e14a9194517ddd4
SHA256
d82da04fded21e538b151e84b08717e27994a19e46b8c87bb20dae636fe5486b
SHA512

      
    
SHA1_git
fc9ccc806e08cfdfa042666c7335069484579396
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestResourceJars.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.File; import org.junit.Assert; import org.junit.Test; import org.apache.catalina.WebResource; import org.apache.catalina.WebResourceSet; public class TestResourceJars { @Test public void testNonStaticResources() { File empty = new File("test/webresources/dir3"); File jar = new File("test/webresources/non-static-resources.jar"); TesterWebResourceRoot root = new TesterWebResourceRoot(); // Use empty dir for root of web app. WebResourceSet webResourceSet = new DirResourceSet(root, "/", empty.getAbsolutePath(), "/"); root.setMainResources(webResourceSet); // If this JAR was in a web application, this is equivalent to how it // would be added JarResourceSet test = new JarResourceSet(root, "/", jar.getAbsolutePath(), "/META-INF/resources"); test.setStaticOnly(true); root.addJarResources(test); WebResource resource = root.getClassLoaderResource("/org/apache/tomcat/unittest/foo.txt"); Assert.assertFalse(resource.exists()); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
50.21
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