Package java.nio.file

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


            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

    }

    Path extraDir = extractDir.resolve(EXTRA_RESOURCES_DIR);
    if (Files.exists(extraDir)) {
      System.setProperty("EXTRA_RESOURCES_DIR", extraDir.toAbsolutePath().toString());
    }

    if (isWin) {
      String libraryPath = System.getProperty("java.library.path");
      libraryPath = extractDir.toString() + ";" + libraryPath;
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 static Path getCacheDir() {
        final Path cache;
View Full Code Here

            if (javaHomePath == null) {
                throw new RuntimeException("Could not find Java installation for requested version "
                        + getAttribute(ATTR_MIN_JAVA_VERSION) + " / " + getAttribute(ATTR_JAVA_VERSION)
                        + ". You can override the used Java version with the -D" + PROP_CAPSULE_JAVA_HOME + " flag.");
            }
            javaHome = javaHomePath.toAbsolutePath().toString();
        }
        return javaHome;
    }

    private boolean isMatchingJavaVersion(String javaVersion) {
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 DependencyManager(appId, localRepo.toAbsolutePath(), repositories, reset, offline);

            return dm;
        } catch (NoClassDefFoundError e) {
            throw new RuntimeException("Jar " + jar.getName()
                    + " contains a " + ATTR_DEPENDENCIES + " attribute or a " + ATTR_APP_ARTIFACT
View Full Code Here

  public void test() throws Exception
  {
    try
    {
      Path testPath = File_IO.getFilePath(testFile);
      testPath = testPath.toAbsolutePath().normalize();
      testPath = File_IO.getRelativePath(testPath);
      assertTrue(testPath.toString().equals(testFile));
      System.out.println("File_IO_createPathRel-\tPASS");
    }
    catch (AssertionError e)
View Full Code Here

    private void readPipelinesConfigurationFile() {
        try {
            PlatformUtil.extractResourceToUserConfigDir(IngestPipelinesConfiguration.class, PIPELINES_CONFIG_FILE, false);

            Path configFilePath = Paths.get(PlatformUtil.getUserConfigDirectory(), PIPELINES_CONFIG_FILE);
            Document doc = XMLUtil.loadDoc(IngestPipelinesConfiguration.class, configFilePath.toAbsolutePath().toString());
            if (doc == null) {
                return;
            }

            // Get the document root element.
View Full Code Here

            // Scan the file with Unallocated Carver.
            ProcessBuilder processAndSettings = new ProcessBuilder(
                    "\"" + executableFile + "\"",
                    "/d",
                    "\"" + outputDirPath.toAbsolutePath() + File.separator + PHOTOREC_RESULTS_BASE + "\"",
                    "/cmd",
                    "\"" + tempFilePath.toFile() + "\"",
                    "search")// NON_NLS

            // Add environment variable to force PhotoRec to run with the same permissions Autopsy uses
View Full Code Here

        Path start = Paths.get(dir);
        try {
            watchService = FileSystems.getDefault().newWatchService();
            registerTree(start);
        } catch (IOException ex) {
            LOG.error("监控目录失败:" + start.toAbsolutePath(), ex);
            LOG.error("Failed to monitor directory:" + start.toAbsolutePath(), ex, Locale.ENGLISH);
            return;
        }
        LOG.info("开始监控目录:" + start.toAbsolutePath());
        LOG.info("Start to monitor directory:" + start.toAbsolutePath(), Locale.ENGLISH);
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.