Package net.sf.webdav.exceptions

Examples of net.sf.webdav.exceptions.WebdavException


      try {
         String[] childrenNames = null;
         if (file.isDirectory()) {
            File[] children = file.listFiles();
            if (children == null)
               throw new WebdavException("IO error while listing files for " + file);
            List<String> childList = new ArrayList<String>();
            for (int i = 0; i < children.length; i++) {
               String name = children[i].getName();
               childList.add(name);
               log.trace("Child " + i + ": " + name);
            }
            childrenNames = new String[childList.size()];
            childrenNames = childList.toArray(childrenNames);
         }
         return childrenNames;
      } catch (Exception e) {
         log.error("GridStore.getChildrenNames(" + uri + ") failed", e);
         throw new WebdavException(e);
      }
   }
View Full Code Here


      uri = normalizeURI(uri);
      File file = fs.getFile(root, uri);
      boolean success = file.delete();
      log.tracef("GridStore.removeObject(%s)=%s", uri, success);
      if (!success)
         throw new WebdavException("cannot delete object: " + uri);
   }
View Full Code Here

      try {
         // in=new BufferedInputStream(fs.getInput(file));
         in = fs.getInput(file);
      } catch (IOException e) {
         log.error("GridStore.getResourceContent(" + uri + ") failed");
         throw new WebdavException(e);
      }
      return in;
   }
View Full Code Here

    public void begin(Principal principal) throws WebdavException {
  log.trace("LocalFileSystemStore.begin()");
  if (!root.exists()) {
      if (!root.mkdirs()) {
    throw new WebdavException("root path: "
      + root.getAbsolutePath()
      + " does not exist and could not be created");
      }
  }
    }
View Full Code Here

    public void createFolder(String uri) throws WebdavException {
  log.trace("LocalFileSystemStore.createFolder(" + uri + ")");
  File file = new File(root, uri);
  if (!file.mkdir())
      throw new WebdavException("cannot create folder: " + uri);
    }
View Full Code Here

    public void createResource(String uri) throws WebdavException {
  log.trace("LocalFileSystemStore.createResource(" + uri + ")");
  File file = new File(root, uri);
  try {
      if (!file.createNewFile())
    throw new WebdavException("cannot create file: " + uri);
  } catch (IOException e) {
      log
        .error("LocalFileSystemStore.createResource(" + uri
          + ") failed");
      throw new WebdavException(e);
  }
    }
View Full Code Here

    }
      }
  } catch (IOException e) {
      log.error("LocalFileSystemStore.setResourceContent(" + uri
        + ") failed");
      throw new WebdavException(e);
  }
    }
View Full Code Here

      in = new BufferedInputStream(new FileInputStream(file));
  } catch (IOException e) {
      log.error("LocalFileSystemStore.getResourceContent(" + uri
        + ") failed");

      throw new WebdavException(e);
  }
  return in;
    }
View Full Code Here

    public void removeObject(String uri) throws WebdavException {
  File file = new File(root, uri);
  boolean success = file.delete();
  log.trace("LocalFileSystemStore.removeObject(" + uri + ")=" + success);
  if (!success) {
      throw new WebdavException("cannot delete object: " + uri);
  }

    }
View Full Code Here

TOP

Related Classes of net.sf.webdav.exceptions.WebdavException

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.