Class CopyResourceHandler


  • public class CopyResourceHandler
    extends Object
    Allows to copy one single resource to another destination.
    Author:
    https://github.com/ljucam [Mario Ljuca]
    • Constructor Detail

      • CopyResourceHandler

        public CopyResourceHandler​(io.vertx.core.http.HttpClient selfClient,
                                   GateleenExceptionFactory exceptionFactory,
                                   String copyPath)
    • Method Detail

      • handle

        public boolean handle​(io.vertx.core.http.HttpServerRequest request)
        Handles the copy task.
        Parameters:
        request - - the request
        Returns:
        true if the request was handled, false otherwise
      • validTask

        protected boolean validTask​(io.vertx.core.http.HttpServerRequest request,
                                    CopyTask task)
        Checks if the copy task is valid (simple resource, not a collection).
        Parameters:
        request - - the original request
        task - - the copy task
        Returns:
        true if the task is valid otherwise false
      • performGETRequest

        protected void performGETRequest​(io.vertx.core.http.HttpServerRequest request,
                                         CopyTask task)
        Performs the initial GET request to the source.
        Parameters:
        request - - the original request
        task - - the task which has to be performed
      • performPUTRequest

        protected void performPUTRequest​(io.vertx.core.http.HttpServerRequest request,
                                         io.vertx.core.http.HttpClientResponse getResponse,
                                         CopyTask task)
        Performs the PUT request to the target.
        Parameters:
        request - - the original request
        getResponse - - the GET response
        task - - the task