ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/tomcat/websocket/TransformationFactory.java

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

      
    
Rootfs path

      
    
Size
2416 (2.4 KB)
MD5
399c8672da4fd4186748dc974f170fb8
SHA1
f38d9b216577a46d19b8e1850356edaf68cffbb4
SHA256
cec806132f81604d9a7d4fe0a05f233199b5c74f1a1636171aeeed4d2e5086b0
SHA512

      
    
SHA1_git
96c6f176a8420aabb15978bd89937ef728c1e55d
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TransformationFactory.java | 2.4 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.tomcat.websocket; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import jakarta.websocket.Extension; public class TransformationFactory { private static final TransformationFactory factory = new TransformationFactory(); private Map<String,TransformationBuilder> builders = new HashMap<>(); private TransformationFactory() { // Hide default constructor // Configure the built-in transformations builders.put(PerMessageDeflate.NAME, PerMessageDeflate.BUILDER); } public static TransformationFactory getInstance() { return factory; } public Transformation create(String name, List<List<Extension.Parameter>> preferences, boolean isServer) { TransformationBuilder builder = builders.get(name); if (builder != null) { return builder.build(preferences, isServer); } return null; } public void registerExtension(String name, TransformationBuilder builder) { builders.put(name, builder); } public Set<String> getInstalledExtensionNames() { return new HashSet<>(builders.keySet()); } public Set<Extension> getInstalledExtensions() { Set<Extension> result = new HashSet<>(); for (String extensionName : builders.keySet()) { result.add(new WsExtension(extensionName)); } return Collections.unmodifiableSet(result); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
45.77
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