Package org.apache.webdav.lib.methods

Examples of org.apache.webdav.lib.methods.CopyMethod


     */
    public boolean copyMethod(String source, String destination)
        throws HttpException, IOException {

        setClient();
        CopyMethod method = new CopyMethod(URIUtil.encodePath(source),
                                           URIUtil.encodePath(destination));
        generateIfHeader(method);
        method.setOverwrite(overwrite);
        int statusCode = client.executeMethod(method);

        // Possbile COPY Status Codes => SC_CREATED, SC_NO_CONTENT
        // WebdavStatus.SC_FORBIDDEN, SC_CONFLICT, SC_PRECONDITION_FAILED,
        // SC_LOCKED, SC_BAD_GATEWAY, SC_INSUFFICIENT_STORAGE
View Full Code Here


   public static void copyResource(HttpClient client, HttpURL url,
                                   String destination, int depth, boolean overwrite)
      throws IOException, HttpException
   {
      CopyMethod copy = new CopyMethod(
              url.getURI(),
              destination,
              overwrite,
              depth);
      copy.setFollowRedirects(true);
      int status = client.executeMethod(copy);
      switch (status) {
         case WebdavStatus.SC_OK:
         case WebdavStatus.SC_CREATED:
         case WebdavStatus.SC_NO_CONTENT:
             return;
        
         default:
             HttpException ex = new HttpException();
             ex.setReasonCode(status);
             ex.setReason(copy.getStatusText());
             throw ex;
      }
   }
View Full Code Here

     */
    public boolean copyMethod(String source, String destination)
        throws HttpException, IOException {

        setClient();
        CopyMethod method = new CopyMethod(URIUtil.encodePath(source),
                                           URIUtil.encodePath(destination));
        generateIfHeader(method);
        method.setOverwrite(overwrite);
        int statusCode = client.executeMethod(method);

        // Possbile COPY Status Codes => SC_CREATED, SC_NO_CONTENT
        // WebdavStatus.SC_FORBIDDEN, SC_CONFLICT, SC_PRECONDITION_FAILED,
        // SC_LOCKED, SC_BAD_GATEWAY, SC_INSUFFICIENT_STORAGE
View Full Code Here

TOP

Related Classes of org.apache.webdav.lib.methods.CopyMethod

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.