1 /* 2 * ==================================================================== 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * ==================================================================== 20 * 21 * This software consists of voluntary contributions made by many 22 * individuals on behalf of the Apache Software Foundation. For more 23 * information on the Apache Software Foundation, please see 24 * <http://www.apache.org/>. 25 * 26 */ 27 28 package org.apache.hc.core5.http.message; 29 30 import org.apache.hc.core5.http.ClassicHttpRequest; 31 import org.apache.hc.core5.http.HttpEntity; 32 import org.apache.hc.core5.http.HttpHost; 33 import org.apache.hc.core5.http.Method; 34 import org.apache.hc.core5.net.URIAuthority; 35 36 import java.net.URI; 37 38 /** 39 * Basic implementation of {@link ClassicHttpRequest}. 40 * 41 * @since 5.0 42 */ 43 public class BasicClassicHttpRequest extends BasicHttpRequest implements ClassicHttpRequest { 44 45 private static final long serialVersionUID = 1L; 46 47 private HttpEntity entity; 48 49 /** 50 * Creates request message with the given method, host and request path. 51 * 52 * @param method request method. 53 * @param scheme request scheme. 54 * @param authority request authority. 55 * @param path request path. 56 * 57 * @since 5.1 58 */ 59 public BasicClassicHttpRequest(final String method, final String scheme, final URIAuthority authority, final String path) { 60 super(method, scheme, authority, path); 61 } 62 63 /** 64 * Creates request message with the given method and request path. 65 * 66 * @param method request method. 67 * @param path request path. 68 */ 69 public BasicClassicHttpRequest(final String method, final String path) { 70 super(method, path); 71 } 72 73 /** 74 * Creates request message with the given method, host and request path. 75 * 76 * @param method request method. 77 * @param host request host. 78 * @param path request path. 79 */ 80 public BasicClassicHttpRequest(final String method, final HttpHost host, final String path) { 81 super(method, host, path); 82 } 83 84 /** 85 * Creates request message with the given method, request URI. 86 * 87 * @param method request method. 88 * @param requestUri request URI. 89 */ 90 public BasicClassicHttpRequest(final String method, final URI requestUri) { 91 super(method, requestUri); 92 } 93 94 /** 95 * Creates request message with the given method and request path. 96 * 97 * @param method request method. 98 * @param path request path. 99 */ 100 public BasicClassicHttpRequest(final Method method, final String path) { 101 super(method, path); 102 } 103 104 /** 105 * Creates request message with the given method, host and request path. 106 * 107 * @param method request method. 108 * @param host request host. 109 * @param path request path. 110 */ 111 public BasicClassicHttpRequest(final Method method, final HttpHost host, final String path) { 112 super(method, host, path); 113 } 114 115 /** 116 * Creates request message with the given method, request URI. 117 * 118 * @param method request method. 119 * @param requestUri request URI. 120 */ 121 public BasicClassicHttpRequest(final Method method, final URI requestUri) { 122 super(method, requestUri); 123 } 124 125 @Override 126 public HttpEntity getEntity() { 127 return this.entity; 128 } 129 130 @Override 131 public void setEntity(final HttpEntity entity) { 132 this.entity = entity; 133 } 134 135 }