code: public void handleMove(HttpServletRequest request, HttpServletResponse response, String pathInContext, Resource resource) throws ServletException, IOException
      {
          if (!resource.exists() || !passConditionalHeaders(request, response, resource))
              return;
  
          String newPath = URI.canonicalPath(request.getHeader("new-uri"));
          if (newPath == null)
          {
              response.sendError(HttpResponse.__400_Bad_Request, "No new-uri");
              return;
          }
  
          String contextPath = _httpContext.getContextPath();
          if (contextPath != null && !newPath.startsWith(contextPath))
          {
              response.sendError(HttpResponse.__405_Method_Not_Allowed, "Not in context");
              return;
          }
  
          try
          {
              String newInfo = newPath;
              if (contextPath != null)
                  newInfo = newInfo.substring(contextPath.length());
              Resource newFile = _httpContext.getBaseResource().addPath(newInfo);
  
              resource.renameTo(newFile);
              response.setStatus(HttpResponse.__204_No_Content);
              response.flushBuffer();
          }
          catch (Exception ex)
          {
              log.warn(LogSupport.EXCEPTION, ex);
              response.sendError(HttpResponse.__500_Internal_Server_Error, "Error:" + ex);
              return;
          }
  
      }
docs: /* -------------------------------------------------------------------