Class HttpFSServer

java.lang.Object
org.apache.hadoop.fs.http.server.HttpFSServer

@Path("/v1") @Private public class HttpFSServer extends Object
Main class of HttpFSServer server.

The HttpFSServer class uses Jersey JAX-RS to binds HTTP requests to the different operations.

  • 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 by HttpFSExceptionProvider.
      FileSystemAccessException - thrown if a FileSystemAccess releated error occurred. Thrown exceptions are handled by HttpFSExceptionProvider.
    • 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 by HttpFSExceptionProvider.
      FileSystemAccessException - thrown if a FileSystemAccess releated error occurred. Thrown exceptions are handled by HttpFSExceptionProvider.
    • 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 by HttpFSExceptionProvider.
      FileSystemAccessException - thrown if a FileSystemAccess releated error occurred. Thrown exceptions are handled by HttpFSExceptionProvider.
    • 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 by HttpFSExceptionProvider.
      FileSystemAccessException - thrown if a FileSystemAccess related error occurred. Thrown exceptions are handled by HttpFSExceptionProvider.
    • 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 by HttpFSExceptionProvider.
      FileSystemAccessException - thrown if a FileSystemAccess releated error occurred. Thrown exceptions are handled by HttpFSExceptionProvider.
    • createUploadRedirectionURL

      protected URI createUploadRedirectionURL(javax.ws.rs.core.UriInfo uriInfo, Enum<?> uploadOperation)
      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 by HttpFSExceptionProvider.
      FileSystemAccessException - thrown if a FileSystemAccess related error occurred. Thrown exceptions are handled by HttpFSExceptionProvider.
    • 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 by HttpFSExceptionProvider.
      FileSystemAccessException - thrown if a FileSystemAccess releated error occurred. Thrown exceptions are handled by HttpFSExceptionProvider.