Examples of subpath()


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) {

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

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

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

        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;
        }

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

        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;
        }
      }
    }

Examples of org.apache.jackrabbit.spi.Path.subPath()

        for (JcrPath test : tests) {
            if (test.isValid() && test.isNormalized()) {
                Path p = resolver.getQPath(test.path);

                // subpath between 0 and length -> equal path
                assertEquals(p, p.subPath(0, p.getLength()));

                // subpath a single element
                if (p.getLength() > 2) {
                    Path expected = factory.create(new Path.Element[]{p.getElements()[1]});
                    assertEquals(expected, p.subPath(1, 2));

Examples of org.apache.jackrabbit.spi.Path.subPath()

    public void testSubPathInvalid() throws RepositoryException {
        Path p = resolver.getQPath("/a/b/c/d/e");

        try {
            p.subPath(2,2);
            fail("Path.subPath with identical from/to must throw IllegalArumentException");
        } catch (IllegalArgumentException e) {
            // ok
        }
        try {

Examples of org.apache.jackrabbit.spi.Path.subPath()

            fail("Path.subPath with identical from/to must throw IllegalArumentException");
        } catch (IllegalArgumentException e) {
            // ok
        }
        try {
            p.subPath(3,2);
            fail("Path.subPath with from > to must throw IllegalArumentException");
        } catch (IllegalArgumentException e) {
            // ok
        }
        try {

Examples of org.apache.jackrabbit.spi.Path.subPath()

            fail("Path.subPath with from > to must throw IllegalArumentException");
        } catch (IllegalArgumentException e) {
            // ok
        }
        try {
            p.subPath(-1, 2);
            fail("Path.subPath with from == -1 to must throw IllegalArumentException");
        } catch (IllegalArgumentException e) {
            // ok
        }
        try {

Examples of org.apache.jackrabbit.spi.Path.subPath()

            fail("Path.subPath with from == -1 to must throw IllegalArumentException");
        } catch (IllegalArgumentException e) {
            // ok
        }
        try {
            p.subPath(1, p.getLength()+1);
            fail("Path.subPath with to > length to must throw IllegalArumentException");
        } catch (IllegalArgumentException e) {
            // ok
        }
    }

Examples of org.apache.jackrabbit.spi.Path.subPath()

        JcrPath[] tests = JcrPath.getTests();
        for (int i = 0; i < tests.length; i++) {
            if (tests[i].isValid() && !tests[i].isNormalized()) {
                Path p = resolver.getQPath(tests[i].path);
                try {
                    p.subPath(0, p.getLength());
                    fail("Path.subPath on a non-normalized path to must throw IllegalArumentException");
                } catch (RepositoryException e) {
                    // ok
                }
            }
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.