Package org.elfinder.servlets

Examples of org.elfinder.servlets.ConnectorException


      File newDir = getNewFile(getParam("name"), dirCurrent, FileActionEnum.WRITE);

      try {
        getFs().createFolder(newDir);
      } catch (Exception e) {
        throw new ConnectorException("Unable to create folder");
      }

      putResponse("select", _hash(newDir));

      _content(dirCurrent, true);
View Full Code Here


      closeWriter(getResponseWriter());
      setResponseOutputDone(true);
    } catch (Exception e) {
      logger.error("", e);
      throw new ConnectorException("Unknown error");
    } finally {
      if (is != null) {
        try {
          is.close();
        } catch (IOException e) {
View Full Code Here

  public void execute() throws ConnectorException {
    File dirCurrent = getExistingDir(getParam("current"), FileActionEnum.WRITE);
    if (dirCurrent != null) {
      List<String> targets = (List<String>) getParamObject("targets[]");
      if (targets == null || targets.isEmpty()) {
        throw new ConnectorException("Invalid parameters");
      }

      for (String targetHash : targets) {
        File fileTarget = getExistingFile(targetHash, dirCurrent, FileActionEnum.DELETE);
        if (fileTarget == null) {
          throw new ConnectorException("File not found");
        }
        _remove(fileTarget, false);
      }

      _content(dirCurrent, true);
View Full Code Here

  /**
   * Remove file or folder (recursively)
   **/
  protected void _remove(File path, boolean fromRecursive) throws ConnectorException {
    if (path == null || !path.exists()) {
      throw new ConnectorException("Invalid parameters");
    }
    if (!path.isDirectory()) {
      if (!getConfig()._isAllowedExistingDir(path, FileActionEnum.DELETE)) {
        throw new ConnectorException("Access denied");
      }
      try {
        getFs().removeFile(path);
      } catch (FsException e) {
        throw new ConnectorException("Unable to remove file", e);
      }
    } else {
      if (!getConfig()._isAllowedExistingFile(path, FileActionEnum.DELETE)) {
        throw new ConnectorException("Access denied");
      }
      removeDirectory(path, fromRecursive);
    }
  }
View Full Code Here

    }

    try {
      getFs().removeEmptyDirectory(path);
    } catch (FsException e) {
      throw new ConnectorException("Unable to remove file", e);
    }
  }
View Full Code Here

TOP

Related Classes of org.elfinder.servlets.ConnectorException

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.