Package java.nio.file

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


        AssetUri uri = tree.getURI();
        if (BEHAVIORS.equals(uri.getModuleName())) {
            savePath = PathManager.getInstance().getHomeModPath().resolve(BEHAVIORS.toString()).resolve("assets").resolve("behaviors");
        } else {
            Path overridesPath = PathManager.getInstance().getHomeModPath().resolve(BEHAVIORS.toString()).resolve("overrides");
            savePath = overridesPath.resolve(uri.getModuleName().toString()).resolve("behaviors");
        }
        BehaviorTreeLoader loader = new BehaviorTreeLoader();
        try {
            Files.createDirectories(savePath);
            Path file = savePath.resolve(uri.getAssetName() + ".behavior");
View Full Code Here


        try {
            Path codePath = Paths.get(sourceUrl.toURI());
            if (Files.isRegularFile(codePath)) {
                source = new ArchiveSource(id, codePath.toFile(), baseAssetsPath, baseOverridesPath, baseDeltasPath);
            } else {
                source = new DirectorySource(id, codePath.resolve(baseAssetsPath), codePath.resolve(baseOverridesPath), codePath.resolve(baseDeltasPath));
            }
        } catch (Throwable e) {
            throw new IllegalStateException("Error loading assets: " + e.getMessage(), e);
        }
    }
View Full Code Here

        try {
            Path codePath = Paths.get(sourceUrl.toURI());
            if (Files.isRegularFile(codePath)) {
                source = new ArchiveSource(id, codePath.toFile(), baseAssetsPath, baseOverridesPath, baseDeltasPath);
            } else {
                source = new DirectorySource(id, codePath.resolve(baseAssetsPath), codePath.resolve(baseOverridesPath), codePath.resolve(baseDeltasPath));
            }
        } catch (Throwable e) {
            throw new IllegalStateException("Error loading assets: " + e.getMessage(), e);
        }
    }
View Full Code Here

        try {
            Path codePath = Paths.get(sourceUrl.toURI());
            if (Files.isRegularFile(codePath)) {
                source = new ArchiveSource(id, codePath.toFile(), baseAssetsPath, baseOverridesPath, baseDeltasPath);
            } else {
                source = new DirectorySource(id, codePath.resolve(baseAssetsPath), codePath.resolve(baseOverridesPath), codePath.resolve(baseDeltasPath));
            }
        } catch (Throwable e) {
            throw new IllegalStateException("Error loading assets: " + e.getMessage(), e);
        }
    }
View Full Code Here

        try {
            Path codePath = Paths.get(url.toURI());
            if (Files.isRegularFile(codePath)) {
                source = new ArchiveSource(id, codePath.toFile(), baseAssetsPath, baseOverridesPath, baseDeltasPath);
            } else {
                source = new DirectorySource(id, codePath.resolve(baseAssetsPath), codePath.resolve(baseOverridesPath), codePath.resolve(baseDeltasPath));
            }
        } catch (Throwable e) {
            throw new IllegalStateException("Error loading assets: " + e.getMessage(), e);
        }
    }
View Full Code Here

        try {
            Path codePath = Paths.get(url.toURI());
            if (Files.isRegularFile(codePath)) {
                source = new ArchiveSource(id, codePath.toFile(), baseAssetsPath, baseOverridesPath, baseDeltasPath);
            } else {
                source = new DirectorySource(id, codePath.resolve(baseAssetsPath), codePath.resolve(baseOverridesPath), codePath.resolve(baseDeltasPath));
            }
        } catch (Throwable e) {
            throw new IllegalStateException("Error loading assets: " + e.getMessage(), e);
        }
    }
View Full Code Here

        try {
            Path codePath = Paths.get(url.toURI());
            if (Files.isRegularFile(codePath)) {
                source = new ArchiveSource(id, codePath.toFile(), baseAssetsPath, baseOverridesPath, baseDeltasPath);
            } else {
                source = new DirectorySource(id, codePath.resolve(baseAssetsPath), codePath.resolve(baseOverridesPath), codePath.resolve(baseDeltasPath));
            }
        } catch (Throwable e) {
            throw new IllegalStateException("Error loading assets: " + e.getMessage(), e);
        }
    }
View Full Code Here

                Files2.untgz(tmpFile, jvmFolder);
            } else {
                throw new IllegalStateException("Unsupported JVM url, expected suffix '.zip', '.tgz' or '.tar.gz'");
            }

            if (Files.exists(jvmFolder.resolve("bin/java"))) {
                return jvmFolder;
            }

            Path childDir;
            try {
View Full Code Here

                childDir = Files2.findUniqueChildDirectory(jvmFolder);

            } catch (RuntimeException e) {
                throw new IllegalStateException("JAVA_HOME with JAVA_HOME/bin/java not found in " + jvmPackageUrl, e);
            }
            if (Files.exists(childDir.resolve("bin/java"))) {
                return childDir;
            }
            throw new IllegalStateException("JAVA_HOME with JAVA_HOME/bin/java not found in dir " + childDir.getFileName() + " of " + jvmPackageUrl);
        } finally {
            Files.delete(tmpFile);
View Full Code Here

  @Test
  public void testDeleteRecursively() throws IOException {
    Path testDir = createTestDirs();
    IOUtils.deleteRecursively(testDir);
    assertFalse(Files.exists(testDir));
    assertFalse(Files.exists(testDir.resolve("subFile1")));
  }

  @Test
  public void testListFiles() throws IOException {
    Path testDir = createTestDirs();
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.