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

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

      
    
Rootfs path

      
    
Size
2794 (2.7 KB)
MD5
ac2a48c293c1814165958db6958c34c4
SHA1
3a6a41ef3d17c3ca9e6d1bb4d226e40345f94542
SHA256
248ca1457752acf85c61ad559900948a2d7cc4915816cfdddd29d25e70a0b2d0
SHA512

      
    
SHA1_git
9880da118505bb9156ee2d4180822d610c8d57bf
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
AbstractTestFileResourceSet.java | 2.7 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.Test; import org.apache.catalina.WebResourceRoot; import org.apache.catalina.WebResourceSet; public abstract class AbstractTestFileResourceSet extends AbstractTestResourceSet { private final boolean readOnly; protected AbstractTestFileResourceSet(boolean readOnly) { this.readOnly = readOnly; } protected abstract File getDir2(); @Override public WebResourceRoot getWebResourceRoot() { TesterWebResourceRoot root = new TesterWebResourceRoot(); WebResourceSet webResourceSet = new DirResourceSet(root, "/", getBaseDir().getAbsolutePath(), "/"); webResourceSet.setReadOnly(readOnly); root.setMainResources(webResourceSet); WebResourceSet f1 = new FileResourceSet(root, "/f1.txt", "test/webresources/dir1/f1.txt", "/"); f1.setReadOnly(readOnly); root.addPreResources(f1); WebResourceSet f2 = new FileResourceSet(root, "/f2.txt", "test/webresources/dir1/f2.txt", "/"); f2.setReadOnly(readOnly); root.addPreResources(f2); WebResourceSet d1f1 = new FileResourceSet(root, "/d1/d1-f1.txt", "test/webresources/dir1/d1/d1-f1.txt", "/"); d1f1.setReadOnly(readOnly); root.addPreResources(d1f1); WebResourceSet d2f1 = new FileResourceSet(root, "/d2/d2-f1.txt", "test/webresources/dir1/d2/d2-f1.txt", "/"); d2f1.setReadOnly(readOnly); root.addPreResources(d2f1); return root; } @Override protected boolean isWritable() { return !readOnly; } @Override public File getBaseDir() { return getDir2(); } @Override @Test public void testNoArgConstructor() { @SuppressWarnings("unused") Object obj = new FileResourceSet(); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
41.32
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