Package java.nio.file

Examples of java.nio.file.Path.toAbsolutePath()


                        + " JavaVersion: " + getAttribute(ATTR_JAVA_VERSION)
                        + " Min. update version: " + getAttribute(ATTR_MIN_UPDATE_VERSION) + ']'
                        + " (JDK required: " + jdk + ")"
                        + ". You can override the used Java version with the -D" + PROP_CAPSULE_JAVA_HOME + " flag.");
            }
            jhome = javaHomePath.toAbsolutePath().toString();
        }
        return jhome;
    }

    private Path findJavaHome(boolean jdk) {
View Full Code Here


            debug("Local repo: " + localRepo);

            final boolean offline = "".equals(System.getProperty(PROP_OFFLINE)) || Boolean.parseBoolean(System.getProperty(PROP_OFFLINE));
            debug("Offline: " + offline);

            final DependencyManager dm = new DependencyManagerImpl(localRepo.toAbsolutePath(), repositories, reset, offline);

            return dm;
        } catch (NoClassDefFoundError e) {
            throw new RuntimeException("Jar " + jarFile
                    + " specifies dependencies, while the necessary dependency management classes are not found in the jar");
View Full Code Here

     */
    public HackController(HackSimulator simulator, String scriptFileName) {

        try {
            Path scriptFilePath = FileSystems.getDefault().getPath(scriptFileName);
            File file = new File(scriptFilePath.toAbsolutePath().toString());
            if (!file.exists()) {
                throw new InvalidPathException(scriptFilePath.toAbsolutePath().toString(),
                        "file doesn't exist");
            }

View Full Code Here

        try {
            Path scriptFilePath = FileSystems.getDefault().getPath(scriptFileName);
            File file = new File(scriptFilePath.toAbsolutePath().toString());
            if (!file.exists()) {
                throw new InvalidPathException(scriptFilePath.toAbsolutePath().toString(),
                        "file doesn't exist");
            }

            this.simulator = simulator;
            animationMode = NO_DISPLAY_CHANGES;
View Full Code Here

        moreString[moreString.length - 1] = path;
        p = Paths.get(this.relativeToFirst, moreString);
      }
     
      if (this.exists && !Files.exists(p)) {
        throw new JuRuntimeException("Path doesn't exist: %s (absolute: %s)", p, p.toAbsolutePath());
      }
      if (this.file && !Files.isRegularFile(p)) {
        throw new JuRuntimeException("Path is not a file: %s (absolute: %s)", p, p.toAbsolutePath());
      }
      if (this.directory && !Files.isDirectory(p)) {
View Full Code Here

     
      if (this.exists && !Files.exists(p)) {
        throw new JuRuntimeException("Path doesn't exist: %s (absolute: %s)", p, p.toAbsolutePath());
      }
      if (this.file && !Files.isRegularFile(p)) {
        throw new JuRuntimeException("Path is not a file: %s (absolute: %s)", p, p.toAbsolutePath());
      }
      if (this.directory && !Files.isDirectory(p)) {
        throw new JuRuntimeException("Path is not a directory: %s (absolute: %s)", p, p.toAbsolutePath());
      }
     
View Full Code Here

      }
      if (this.file && !Files.isRegularFile(p)) {
        throw new JuRuntimeException("Path is not a file: %s (absolute: %s)", p, p.toAbsolutePath());
      }
      if (this.directory && !Files.isDirectory(p)) {
        throw new JuRuntimeException("Path is not a directory: %s (absolute: %s)", p, p.toAbsolutePath());
      }
     
      return p;
    }
   
View Full Code Here

        try {
            if (!Files.exists(appDir))
                Files.createDirectory(appDir);
            return appDir;
        } catch (IOException e) {
            throw new RuntimeException("Application cache directory " + appDir.toAbsolutePath() + " could not be created.");
        }
    }

    private boolean needsAppCache() {
        if (isEmptyCapsule())
View Full Code Here

                        + " Min. update version: " + getAttribute(ATTR_MIN_UPDATE_VERSION) + ']'
                        + " (JDK required: " + jdk + ")"
                        + ". You can override the used Java version with the -D" + PROP_CAPSULE_JAVA_HOME + " flag.");
            }
        }
        return jhome != null ? jhome.toAbsolutePath() : jhome;
    }

    private Path findJavaHome(boolean jdk) {
        Map<String, Path> homes = getJavaHomes();
        if (jdk)
View Full Code Here

            log(LOG_DEBUG, "Local repo: " + localRepo);

            final boolean allowSnapshots = hasAttribute(ATTR_ALLOW_SNAPSHOTS) && Boolean.parseBoolean(getAttribute(ATTR_ALLOW_SNAPSHOTS));
            log(LOG_DEBUG, "Allow snapshots: " + allowSnapshots);

            return new DependencyManagerImpl(localRepo.toAbsolutePath(), repositories, reset, allowSnapshots, logLevel);
        } catch (NoClassDefFoundError e) {
            throw new RuntimeException("Jar " + jarFile
                    + " specifies dependencies, while the necessary dependency management classes are not found in the jar");
        }
    }
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.