Package java.nio.file

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


      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();
        log.debug(String.format("Extracted working directory %1$s from application path %2$s", workingPath, appPath));
        appPath = workingPath;
      }
      if (subDirectory != null) {
View Full Code Here


   
    int pathCount = appPath.getNameCount();
   
    if(pathCount > 1)
    {
      matchLocation = appPath.subpath(1, pathCount).toString();
    }
   
    List<AssetLocation> assetLocations = new ArrayList<AssetLocation>();
   
    for(Aspect asp : app.aspects())
View Full Code Here

        assertTrue(path + ".endsWith(" + other + ") should be true",
            path.endsWith(other));
        assertTrue(path + ".endsWith(" + other + ") should be true",
            path.endsWith(other.toString()));
        if (other.getRoot() != null && other.getNameCount() > 0) {
          other = other.subpath(0, other.getNameCount());
        } else if (other.getNameCount() > 1) {
          other = other.subpath(1, other.getNameCount());
        } else {
          other = null;
        }
View Full Code Here

        assertTrue(path + ".endsWith(" + other + ") should be true",
            path.endsWith(other.toString()));
        if (other.getRoot() != null && other.getNameCount() > 0) {
          other = other.subpath(0, other.getNameCount());
        } else if (other.getNameCount() > 1) {
          other = other.subpath(1, other.getNameCount());
        } else {
          other = null;
        }
      }
    }
View Full Code Here

    System.out.println("Number of Name Elements in the Path ["
        + listing.getNameCount() + "]");
    System.out.println("Parent Path [" + listing.getParent() + "]");
    System.out.println("Root of Path [" + listing.getRoot() + "]");
    System.out.println("Subpath from Root, 2 elements deep ["
        + listing.subpath(0, 2) + "]");
  }
}
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.