44 | * This class represents a call-back mechanism that will notify implementations 45 | * as HTTP request data becomes available to read without blocking. 46 | *
47 | * 48 | * @since 2.0 49 | * 50 | * @deprecated please use {@link org.glassfish.grizzly.ReadHandler} 51 | */ 52 | public interface ReadHandler extends org.glassfish.grizzly.ReadHandler { 53 | } 54 | -------------------------------------------------------------------------------- /modules/http-server/src/main/java/org/glassfish/grizzly/http/server/io/WriteHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2010-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package org.glassfish.grizzly.http.server.io; 42 | 43 | 44 | /** 45 | * Callback notification mechanism that signals the developer it's possible 46 | * to write content. 47 | * 48 | * @since 2.0 49 | * 50 | * @deprecated please use {@link org.glassfish.grizzly.WriteHandler} 51 | */ 52 | public interface WriteHandler extends org.glassfish.grizzly.WriteHandler { 53 | } 54 | -------------------------------------------------------------------------------- /modules/http-server/src/main/java/org/glassfish/grizzly/http/server/naming/DirContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2013-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package org.glassfish.grizzly.http.server.naming; 42 | 43 | /** 44 | * The directory service interface, containing 45 | * methods for examining and updating attributes 46 | * associated with objects, and for searching the directory. 47 | * 48 | * @see javax.naming.directory.DirContext 49 | * 50 | * @author Grizzly Team 51 | */ 52 | public interface DirContext extends NamingContext { 53 | } 54 | -------------------------------------------------------------------------------- /modules/http-server/src/main/java/org/glassfish/grizzly/http/server/util/DispatcherHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2011-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package org.glassfish.grizzly.http.server.util; 42 | 43 | import org.glassfish.grizzly.http.HttpRequestPacket; 44 | import org.glassfish.grizzly.http.util.DataChunk; 45 | 46 | /** 47 | * Interface simplifies by path or name mapping. 48 | * 49 | * @author Alexey Stashok 50 | */ 51 | public interface DispatcherHelper { 52 | void mapPath(HttpRequestPacket requestPacket, DataChunk path, MappingData mappingData) 53 | throws Exception; 54 | 55 | void mapName(DataChunk name, MappingData mappingData) throws Exception; 56 | } 57 | -------------------------------------------------------------------------------- /modules/http-server/src/main/resources/META-INF/LICENSE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/grizzly/c704aa684f47abd38a7a8ac9f044e65e928270ef/modules/http-server/src/main/resources/META-INF/LICENSE.txt -------------------------------------------------------------------------------- /modules/http-server/src/test/resources/clhandler/a/index.html: -------------------------------------------------------------------------------- 1 | 42 | 43 | Welcome file from a folder #2 44 | -------------------------------------------------------------------------------- /modules/http-server/src/test/resources/clhandler/index.html: -------------------------------------------------------------------------------- 1 | 42 | 43 | Welcome file from a folder #1 44 | -------------------------------------------------------------------------------- /modules/http-server/src/test/resources/clhandler/welcome.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/grizzly/c704aa684f47abd38a7a8ac9f044e65e928270ef/modules/http-server/src/test/resources/clhandler/welcome.jar -------------------------------------------------------------------------------- /modules/http-server/src/test/resources/ssltest-cacerts.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/grizzly/c704aa684f47abd38a7a8ac9f044e65e928270ef/modules/http-server/src/test/resources/ssltest-cacerts.jks -------------------------------------------------------------------------------- /modules/http-server/src/test/resources/ssltest-keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/grizzly/c704aa684f47abd38a7a8ac9f044e65e928270ef/modules/http-server/src/test/resources/ssltest-keystore.jks -------------------------------------------------------------------------------- /modules/http-servlet/src/main/java/org/glassfish/grizzly/servlet/FilterChainInvoker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2011-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package org.glassfish.grizzly.servlet; 42 | 43 | import javax.servlet.ServletException; 44 | import javax.servlet.ServletRequest; 45 | import javax.servlet.ServletResponse; 46 | import java.io.IOException; 47 | 48 | public interface FilterChainInvoker { 49 | 50 | void invokeFilterChain(ServletRequest request, ServletResponse response) 51 | throws IOException, ServletException; 52 | 53 | } 54 | -------------------------------------------------------------------------------- /modules/http-servlet/src/test/resources/jsps/index.jsp: -------------------------------------------------------------------------------- 1 | 42 | 43 | <%=request.getRequestURI()%> 44 | -------------------------------------------------------------------------------- /modules/http-servlet/src/test/resources/test-keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/grizzly/c704aa684f47abd38a7a8ac9f044e65e928270ef/modules/http-servlet/src/test/resources/test-keystore.jks -------------------------------------------------------------------------------- /modules/http-servlet/src/test/resources/test-truststore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/grizzly/c704aa684f47abd38a7a8ac9f044e65e928270ef/modules/http-servlet/src/test/resources/test-truststore.jks -------------------------------------------------------------------------------- /modules/http/src/main/java/org/glassfish/grizzly/http/ContentEncodingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2010-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package org.glassfish.grizzly.http; 42 | 43 | /** 44 | * 45 | * @author oleksiys 46 | */ 47 | public class ContentEncodingException extends IllegalStateException { 48 | public ContentEncodingException() { 49 | } 50 | 51 | public ContentEncodingException(String s) { 52 | super(s); 53 | } 54 | 55 | public ContentEncodingException(Throwable cause) { 56 | super(cause); 57 | } 58 | 59 | public ContentEncodingException(String message, Throwable cause) { 60 | super(message, cause); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /modules/http/src/main/java/org/glassfish/grizzly/http/EncodingFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2010-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package org.glassfish.grizzly.http; 42 | 43 | /** 44 | * 45 | * @author oleksiys 46 | */ 47 | public interface EncodingFilter { 48 | boolean applyEncoding(final HttpHeader httpPacket); 49 | boolean applyDecoding(final HttpHeader httpPacket); 50 | } 51 | -------------------------------------------------------------------------------- /modules/http/src/main/java/org/glassfish/grizzly/http/HttpPacketParsing.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2010-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package org.glassfish.grizzly.http; 42 | 43 | import org.glassfish.grizzly.http.util.MimeHeaders; 44 | 45 | /** 46 | * 47 | * @author oleksiys 48 | */ 49 | public interface HttpPacketParsing { 50 | boolean isHeaderParsed(); 51 | 52 | void setHeaderParsed(boolean isHeaderParsed); 53 | 54 | HttpCodecFilter.HeaderParsingState getHeaderParsingState(); 55 | 56 | HttpCodecFilter.ContentParsingState getContentParsingState(); 57 | 58 | MimeHeaders getHeaders(); 59 | } 60 | -------------------------------------------------------------------------------- /modules/http/src/main/java/org/glassfish/grizzly/http/Note.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2011-2017 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * The contents of this file are subject to the terms of either the GNU 7 | * General Public License Version 2 only ("GPL") or the Common Development 8 | * and Distribution License("CDDL") (collectively, the "License"). You 9 | * may not use this file except in compliance with the License. You can 10 | * obtain a copy of the License at 11 | * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 | * or LICENSE.txt. See the License for the specific 13 | * language governing permissions and limitations under the License. 14 | * 15 | * When distributing the software, include this License Header Notice in each 16 | * file and include the License file at LICENSE.txt. 17 | * 18 | * GPL Classpath Exception: 19 | * Oracle designates this particular file as subject to the "Classpath" 20 | * exception as provided by Oracle in the GPL Version 2 section of the License 21 | * file that accompanied this code. 22 | * 23 | * Modifications: 24 | * If applicable, add the following below the License Header, with the fields 25 | * enclosed by brackets [] replaced by your own identifying information: 26 | * "Portions Copyright [year] [name of copyright owner]" 27 | * 28 | * Contributor(s): 29 | * If you wish your version of this file to be governed by only the CDDL or 30 | * only the GPL Version 2, indicate your decision by adding "[Contributor] 31 | * elects to include this software in this distribution under the [CDDL or GPL 32 | * Version 2] license." If you don't indicate a single choice of license, a 33 | * recipient has the option to distribute your version of this file under 34 | * either the CDDL, the GPL Version 2 or to extend the choice of license to 35 | * its licensees as provided above. However, if you add GPL Version 2 code 36 | * and therefore, elected the GPL Version 2 license, then the option applies 37 | * only if the new code is made subject to such option by the copyright 38 | * holder. 39 | */ 40 | 41 | package org.glassfish.grizzly.http; 42 | 43 | import org.glassfish.grizzly.attributes.Attribute; 44 | 45 | /** 46 | * The Note value associated with HttpRequestPacket. 47 | * 48 | * @author Alexey Stashok 49 | */ 50 | public final class Note