Package org.apache.hadoop.fs.http.server
Class HttpFSServer
java.lang.Object
org.apache.hadoop.fs.http.server.HttpFSServer
Main class of HttpFSServer server.
The HttpFSServer class uses Jersey JAX-RS to binds HTTP requests to the
different operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected URIcreateUploadRedirectionURL(javax.ws.rs.core.UriInfo uriInfo, Enum<?> uploadOperation) Creates the URL for an upload operation (create or append).javax.ws.rs.core.Responsedelete(String path, HttpFSParametersProvider.OperationParam op, javax.servlet.http.HttpServletRequest request) Binding to handle DELETE requests.javax.ws.rs.core.Responseget(String path, javax.ws.rs.core.UriInfo uriInfo, HttpFSParametersProvider.OperationParam op, javax.servlet.http.HttpServletRequest request) Binding to handle GET requests, supported operations arejavax.ws.rs.core.ResponsegetRoot(javax.ws.rs.core.UriInfo uriInfo, HttpFSParametersProvider.OperationParam op, javax.servlet.http.HttpServletRequest request) Special binding for '/' as it is not handled by the wildcard binding.javax.ws.rs.core.Responsepost(InputStream is, javax.ws.rs.core.UriInfo uriInfo, String path, HttpFSParametersProvider.OperationParam op, javax.servlet.http.HttpServletRequest request) Binding to handle POST requests.javax.ws.rs.core.ResponsepostRoot(InputStream is, javax.ws.rs.core.UriInfo uriInfo, HttpFSParametersProvider.OperationParam op, javax.servlet.http.HttpServletRequest request) Special binding for '/' as it is not handled by the wildcard binding.javax.ws.rs.core.Responseput(InputStream is, javax.ws.rs.core.UriInfo uriInfo, String path, HttpFSParametersProvider.OperationParam op, javax.servlet.http.HttpServletRequest request) Binding to handle PUT requests.javax.ws.rs.core.ResponseputRoot(InputStream is, javax.ws.rs.core.UriInfo uriInfo, HttpFSParametersProvider.OperationParam op, javax.servlet.http.HttpServletRequest request) Special binding for '/' as it is not handled by the wildcard binding.
-
Constructor Details
-
HttpFSServer
public HttpFSServer()
-
-
Method Details
-
getRoot
@GET @Produces("application/json; charset=utf-8") public javax.ws.rs.core.Response getRoot(@Context javax.ws.rs.core.UriInfo uriInfo, @QueryParam("op") HttpFSParametersProvider.OperationParam op, @Context javax.servlet.http.HttpServletRequest request) throws IOException, FileSystemAccessException Special binding for '/' as it is not handled by the wildcard binding.- Parameters:
uriInfo- uri info of the request.op- the HttpFS operation of the request.- Returns:
- the request response.
- Throws:
IOException- thrown if an IO error occurred. Thrown exceptions are handled byHttpFSExceptionProvider.FileSystemAccessException- thrown if a FileSystemAccess releated error occurred. Thrown exceptions are handled byHttpFSExceptionProvider.
-
get
@GET @Path("{path:.*}") @Produces({"application/octet-stream; charset=utf-8","application/json; charset=utf-8"}) public javax.ws.rs.core.Response get(@PathParam("path") String path, @Context javax.ws.rs.core.UriInfo uriInfo, @QueryParam("op") HttpFSParametersProvider.OperationParam op, @Context javax.servlet.http.HttpServletRequest request) throws IOException, FileSystemAccessException Binding to handle GET requests, supported operations are- Parameters:
path- the path for operation.uriInfo- uri info of the request.op- the HttpFS operation of the request.- Returns:
- the request response.
- Throws:
IOException- thrown if an IO error occurred. Thrown exceptions are handled byHttpFSExceptionProvider.FileSystemAccessException- thrown if a FileSystemAccess releated error occurred. Thrown exceptions are handled byHttpFSExceptionProvider.
-
delete
@DELETE @Path("{path:.*}") @Produces("application/json; charset=utf-8") public javax.ws.rs.core.Response delete(@PathParam("path") String path, @QueryParam("op") HttpFSParametersProvider.OperationParam op, @Context javax.servlet.http.HttpServletRequest request) throws IOException, FileSystemAccessException Binding to handle DELETE requests.- Parameters:
path- the path for operation.op- the HttpFS operation of the request.- Returns:
- the request response.
- Throws:
IOException- thrown if an IO error occurred. Thrown exceptions are handled byHttpFSExceptionProvider.FileSystemAccessException- thrown if a FileSystemAccess releated error occurred. Thrown exceptions are handled byHttpFSExceptionProvider.
-
postRoot
@POST @Produces("application/json; charset=utf-8") public javax.ws.rs.core.Response postRoot(InputStream is, @Context javax.ws.rs.core.UriInfo uriInfo, @QueryParam("op") HttpFSParametersProvider.OperationParam op, @Context javax.servlet.http.HttpServletRequest request) throws IOException, FileSystemAccessException Special binding for '/' as it is not handled by the wildcard binding.- Parameters:
is- the inputstream for the request payload.uriInfo- the of the request.op- the HttpFS operation of the request.request- the HttpFS request.- Returns:
- the request response.
- Throws:
IOException- thrown if an IO error occurred. Thrown exceptions are handled byHttpFSExceptionProvider.FileSystemAccessException- thrown if a FileSystemAccess related error occurred. Thrown exceptions are handled byHttpFSExceptionProvider.
-
post
@POST @Path("{path:.*}") @Consumes("*/*") @Produces("application/json; charset=utf-8") public javax.ws.rs.core.Response post(InputStream is, @Context javax.ws.rs.core.UriInfo uriInfo, @PathParam("path") String path, @QueryParam("op") HttpFSParametersProvider.OperationParam op, @Context javax.servlet.http.HttpServletRequest request) throws IOException, FileSystemAccessException Binding to handle POST requests.- Parameters:
is- the inputstream for the request payload.uriInfo- the of the request.path- the path for operation.op- the HttpFS operation of the request.- Returns:
- the request response.
- Throws:
IOException- thrown if an IO error occurred. Thrown exceptions are handled byHttpFSExceptionProvider.FileSystemAccessException- thrown if a FileSystemAccess releated error occurred. Thrown exceptions are handled byHttpFSExceptionProvider.
-
createUploadRedirectionURL
Creates the URL for an upload operation (create or append).- Parameters:
uriInfo- uri info of the request.uploadOperation- operation for the upload URL.- Returns:
- the URI for uploading data.
-
putRoot
@PUT @Produces("application/json; charset=utf-8") public javax.ws.rs.core.Response putRoot(InputStream is, @Context javax.ws.rs.core.UriInfo uriInfo, @QueryParam("op") HttpFSParametersProvider.OperationParam op, @Context javax.servlet.http.HttpServletRequest request) throws IOException, FileSystemAccessException Special binding for '/' as it is not handled by the wildcard binding.- Parameters:
is- the inputstream for the request payload.uriInfo- the of the request.op- the HttpFS operation of the request.request- the HttpFS request.- Returns:
- the request response.
- Throws:
IOException- thrown if an IO error occurred. Thrown exceptions are handled byHttpFSExceptionProvider.FileSystemAccessException- thrown if a FileSystemAccess related error occurred. Thrown exceptions are handled byHttpFSExceptionProvider.
-
put
@PUT @Path("{path:.*}") @Consumes("*/*") @Produces("application/json; charset=utf-8") public javax.ws.rs.core.Response put(InputStream is, @Context javax.ws.rs.core.UriInfo uriInfo, @PathParam("path") String path, @QueryParam("op") HttpFSParametersProvider.OperationParam op, @Context javax.servlet.http.HttpServletRequest request) throws IOException, FileSystemAccessException Binding to handle PUT requests.- Parameters:
is- the inputstream for the request payload.uriInfo- the of the request.path- the path for operation.op- the HttpFS operation of the request.- Returns:
- the request response.
- Throws:
IOException- thrown if an IO error occurred. Thrown exceptions are handled byHttpFSExceptionProvider.FileSystemAccessException- thrown if a FileSystemAccess releated error occurred. Thrown exceptions are handled byHttpFSExceptionProvider.
-