ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/catalina/session/TesterStore.java

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

      
    
Rootfs path

      
    
Size
2568 (2.5 KB)
MD5
ca7996b97e270736ce548d97ed485ce8
SHA1
f82ce4ec1d8e60024061576d7763aebe7b3b7c03
SHA256
eca1bc478f151e941bb151a3b417b58547fad2732a9f0b8d58949e18fdb142ea
SHA512

      
    
SHA1_git
412f0289c049a549c4509a90aac1cc9b3fb9a117
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TesterStore.java | 2.5 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.session; import java.beans.PropertyChangeListener; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.catalina.Manager; import org.apache.catalina.Session; import org.apache.catalina.Store; class TesterStore implements Store { private Manager manager; private Map<String, Session> sessions = new HashMap<>(); private List<String> savedIds = new ArrayList<>(); List<String> getSavedIds() { return savedIds; } @Override public Manager getManager() { return this.manager; } @Override public void setManager(Manager manager) { this.manager = manager; } @Override public int getSize() throws IOException { return savedIds.size(); } @Override public void addPropertyChangeListener(PropertyChangeListener listener) { } @Override public String[] keys() throws IOException { return new ArrayList<>(sessions.keySet()).toArray(new String[0]); } @Override public Session load(String id) throws ClassNotFoundException, IOException { return sessions.get(id); } @Override public void remove(String id) throws IOException { sessions.remove(id); } @Override public void clear() throws IOException { } @Override public void removePropertyChangeListener(PropertyChangeListener listener) { } @Override public void save(Session session) throws IOException { sessions.put(session.getId(), session); savedIds.add(session.getId()); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
41.61
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