Examples of toAbsolutePath()


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

        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

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

     
      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

Examples of java.nio.file.Path.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());
      }
     
      return p;
    }
   
View Full Code Here

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

   */
  @Override
  public URL fileToUrl(final String location, URL url) {
    Path file = Paths.get(location);
    if (!file.isAbsolute())
      file = file.toAbsolutePath();
    if (Files.isReadable(file)) {
      try {
        url = file.normalize().toUri().toURL();
      } catch (MalformedURLException e) {
      }
View Full Code Here

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

        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 static Path getCacheDir() {
        final Path cache;
View Full Code Here

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

            final Path javaHomePath = findJavaHome(getAttribute(ATTR_JAVA_VERSION));
            if (javaHomePath == null) {
                throw new RuntimeException("Could not find Java installation for requested version " + getAttribute(ATTR_JAVA_VERSION)
                        + ". You can override the used Java version with the -D" + PROP_JAVA_HOME + " flag.");
            }
            javaHome = javaHomePath.toAbsolutePath().toString();
        }
        if (javaHome == null)
            javaHome = System.getProperty("java.home");
        return javaHome;
    }
View Full Code Here

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

            final Path depsCache = cacheDir.resolve(DEPS_CACHE_NAME);

            final boolean reset = Boolean.parseBoolean(System.getProperty(PROP_RESET, "false"));
            final DependencyManager dm
                    = new DependencyManager(appId,
                            depsCache.toAbsolutePath().toString(),
                            repositories,
                            reset, verbose);

            return dm;
        } catch (NoClassDefFoundError e) {
View Full Code Here

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

        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

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

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

            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
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.