Package java.nio.file

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


    boolean directory = Files.isDirectory(path);

    Set<Path> results = new HashSet<>();
    results.add(path);
    if (path.isAbsolute()) {
      results.add(workingDir.relativize(path));
    } else {
      results.add(workingDir.resolve(path));
    }
    if (directory) {
      for (Path p : ImmutableList.copyOf(results)) {
View Full Code Here


  public static GoPackageName getGoPackageForPath(Path goPathEntry, Path dirFullPath) {
    Path sourceRoot = goPathEntry.resolve(SRC_DIR);
    if(!dirFullPath.startsWith(goPathEntry)) {
      return null;
    }
    return GoPackageName.fromPath(sourceRoot.relativize(dirFullPath));
  }
 
  public boolean isEmpty() {
    return goPathElements.size() == 0;
  }
View Full Code Here

                if (Files.isDirectory(child)) {
                    scanOverrides(child, basePath);
                } else if (Files.isRegularFile(child)) {
                    Path relativePath = basePath.relativize(child);
                    Path modulePath = relativePath.subpath(0, 1);
                    AssetUri uri = getUri(new Name(modulePath.toString()), modulePath.relativize(relativePath));
                    if (uri != null) {
                        try {
                            addOverride(uri, child.toUri().toURL());
                        } catch (MalformedURLException e) {
                            logger.warn("Failed to load override {}", child, e.getMessage());
View Full Code Here

                if (Files.isDirectory(child)) {
                    scanDeltas(child, basePath);
                } else if (Files.isRegularFile(child)) {
                    Path relativePath = basePath.relativize(child);
                    Path modulePath = relativePath.subpath(0, 1);
                    AssetUri uri = getUri(new Name(modulePath.toString()), modulePath.relativize(relativePath));
                    if (uri != null) {
                        try {
                            setDelta(uri, child.toUri().toURL());
                        } catch (MalformedURLException e) {
                            logger.warn("Failed to load delta {}", child, e.getMessage());
View Full Code Here

            if (convert.isEmpty()) {
                shell.println("no mathing file found. module descriptors should be named `md.restx.json`");
            } else {
                shell.println("converted:");
                for (Path path : convert) {
                    shell.println("\t" + currentLocationAbsolutePath.relativize(path));
                }
            }
        }
    }
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.