Examples of IllegalFileLocation


Examples of org.hive2hive.core.exceptions.IllegalFileLocation

    } else if (!file.exists()) {
      throw new IllegalArgumentException("File does not exist.");
    } else if (session.getRoot().toFile().equals(file)) {
      throw new IllegalArgumentException("Root cannot be added.");
    } else if (!FileUtil.isInH2HDirectory(file, session)) {
      throw new IllegalFileLocation();
    }

    IProcessComponent addProcess;
    if (file.isDirectory() && file.listFiles().length > 0) {
      // add the files recursively
View Full Code Here

Examples of org.hive2hive.core.exceptions.IllegalFileLocation

      NoPeerConnectionException {
    // verify
    if (!folder.isDirectory())
      throw new IllegalArgumentException("File has to be a folder.");
    if (!folder.exists())
      throw new IllegalFileLocation("Folder does not exist.");

    H2HSession session = networkManager.getSession();
    Path root = session.getRoot();

    // folder must be in the given root directory
    if (!folder.toPath().toString().startsWith(root.toString()))
      throw new IllegalFileLocation("Folder must be in root of the H2H directory.");

    // sharing root folder is not allowed
    if (folder.toPath().toString().equals(root.toString()))
      throw new IllegalFileLocation("Root folder of the H2H directory can't be shared.");

    IProcessComponent shareProcess = ProcessFactory.instance().createShareProcess(folder,
        new UserPermission(userId, permission), networkManager);

    AsyncComponent asyncProcess = new AsyncComponent(shareProcess);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.