Examples of toAbsolutePath()


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

    // getImageExtension();
    final String imgFileName = getCreatedTimeString().replaceAll(":", "-")
        + '.' + getImageExtension();
    final Path imgRootPath = RS.workingDirectoryPath(
        Paths.get(getRemoteNode().getWorkingDir()), null);
    return Paths.get(imgRootPath.toAbsolutePath().toString(), imgFileName);
  }

  /**
   * Adds a segment of image data to the image
   *
 
View Full Code Here

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

      final Path commLibPath = Paths.get(RS.class.getProtectionDomain().getCodeSource().getLocation().getPath(),
          rxtxFileName);
      final Path tempLibPath = Files.createTempFile(libName, suffix);
      try {
        Files.copy(commLibPath, tempLibPath, StandardCopyOption.REPLACE_EXISTING);
        System.load(tempLibPath.toAbsolutePath().toString());
        System.loadLibrary(libName);
        // test
        getSerialPorts();
      } finally {
        try {
View Full Code Here

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

          fs = FileSystems.newFileSystem(appPath, null);
          final Path resourcePath = fs.getPath(RS.class.getPackage().getName().replace(".", fs.getSeparator()), resourceName);
          if (resourcePath != null && validate && Files.notExists(resourcePath)) {
            return null;
          }
          log.debug(String.format("Extracting application resource from ZIP path %1$s in %2$s", resourcePath.toAbsolutePath(),
              appPath.toAbsolutePath()));
          return resourcePath;
        } catch (final Throwable e2) {
          log.error("Unable to get application path (ZIP source)", e2);
        } finally {
View Full Code Here

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

  public static Path workingDirectoryPath(final Path subDirectory, final String fileName) {
    Path workingPath = null;
    try {
      Path appPath = new File(applicationUri()).toPath();
      if (Files.isDirectory(appPath)) {
        workingPath = Files.createDirectories(appPath.toAbsolutePath());
      } else {
        // must be running from within a JAR- get the working directory excluding the file name of the archive
        workingPath = appPath.getParent();
        workingPath = workingPath == null ? appPath.subpath(0, 1).toAbsolutePath() :
          workingPath.toAbsolutePath();
View Full Code Here

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

    } catch (IOException e) {
      LOG.warn("Unable to create security directory");
      return null;
    }

    return new StringBuilder().append(workDir.toAbsolutePath())
        .append(File.separator)
        .append(SliderKeys.SECURITY_DIR)
        .append(File.separator)
        .append(SliderKeys.KEYSTORE_FILE_NAME).toString();
  }
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()

            if (!Files.exists(cache.resolve(DEPS_CACHE_NAME)))
                Files.createDirectory(cache.resolve(DEPS_CACHE_NAME));

            return cache;
        } catch (IOException e) {
            throw new RuntimeException("Error opening cache directory " + cache.toAbsolutePath(), e);
        }
    }

    private static Path getCacheHome() {
        final Path userHome = Paths.get(System.getProperty(PROP_USER_HOME));
View Full Code Here

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

                throw new RuntimeException("Could not find Java installation for requested version "
                        + getAttribute(ATTR_MIN_JAVA_VERSION) + " / " + getAttribute(ATTR_JAVA_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 boolean isMatchingJavaVersion(String javaVersion) {
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 DependencyManager(localRepo.toAbsolutePath(), repositories, reset, offline);

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

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