Examples of RelativePath


Examples of org.gradle.api.file.RelativePath

        assertFalse(matcher.isSatisfiedBy(path));
    }

    @Test public void testCase() {
        matcher = new DefaultPatternMatcher(true, true, "a", "b");
        assertTrue(matcher.isSatisfiedBy(new RelativePath(true, "a", "b")));
        assertFalse(matcher.isSatisfiedBy(new RelativePath(true, "A", "B")));

        matcher = new DefaultPatternMatcher(true, false, "a", "b");
        assertTrue(matcher.isSatisfiedBy(new RelativePath(true, "a", "b")));
        assertTrue(matcher.isSatisfiedBy(new RelativePath(true, "A", "B")));
    }
View Full Code Here

Examples of org.gradle.api.file.RelativePath

    }

    @Test public void testNameOnly() {
        matcher = PatternMatcherFactory.getPatternMatcher(true, true, "**/*.jsp");
        assertTrue(matcher instanceof NameOnlyPatternMatcher);
        path = new RelativePath(true, "fred.jsp");
        assertTrue(matcher.isSatisfiedBy(path));
    }
View Full Code Here

Examples of org.gradle.api.file.RelativePath

        assertThat(matcher, not(matchesDir("a", "c", "b", "c")));
        assertThat(matcher, not(matchesDir("d", "a", "b")));
    }

    private Matcher<Spec<RelativePath>> matchesFile(String... paths) {
        return matches(new RelativePath(true, paths));
    }
View Full Code Here

Examples of org.gradle.api.file.RelativePath

    private Matcher<Spec<RelativePath>> matchesFile(String... paths) {
        return matches(new RelativePath(true, paths));
    }

    private Matcher<Spec<RelativePath>> matchesDir(String... paths) {
        return matches(new RelativePath(false, paths));
    }
View Full Code Here

Examples of org.gradle.api.file.RelativePath

    @Test
    public void plainCopy() {
        visitor.startVisit(action(destDir));

        visitor.visitDir(file(new RelativePath(false)));

        visitor.visitFile(file(new RelativePath(true, "rootfile.txt"), new File(destDir, "rootfile.txt")));

        RelativePath subDirPath = new RelativePath(false, "subdir");
        visitor.visitDir(file(subDirPath));

        visitor.visitFile(file(new RelativePath(true, "subdir", "anotherfile.txt"), new File(destDir, "subdir/anotherfile.txt")));
    }
View Full Code Here

Examples of org.gradle.api.file.RelativePath

            this.parent = parent;
        }

        public RelativePath getRelativePath() {
            if (parent == null) {
                return new RelativePath(isFile);
            } else {
                return parent.getRelativePath().append(isFile, name);
            }
        }
View Full Code Here

Examples of org.gradle.api.file.RelativePath

    @Test
    public void transformsLastSegmentOfPath() {
        context.checking(new Expectations() {{
            allowing(details).getRelativePath();
            will(returnValue(new RelativePath(true, "a", "b")));
            one(transformer).transform("b");
            will(returnValue("c"));
            one(details).setRelativePath(new RelativePath(true, "a", "c"));
        }});

        action.execute(details);
    }
View Full Code Here

Examples of org.gradle.api.file.RelativePath

        AtomicBoolean stopFlag = new AtomicBoolean();
        if (root.exists()) {
            if (root.isFile()) {
                processSingleFile(root, stopFlag);
            } else {
               walkDir(root, new RelativePath(false), stopFlag);
            }
        } else {
            logger.info("file or directory '"+startFile.toString()+"', not found");
        }
    }
View Full Code Here

Examples of org.gradle.api.file.RelativePath

            logger.info("file or directory '"+startFile.toString()+"', not found");
        }
    }

    private void processSingleFile(File file, AtomicBoolean stopFlag) {
        RelativePath path = new RelativePath(true, file.getName());
        FileVisitDetailsImpl details = new FileVisitDetailsImpl(file, path, stopFlag);
        if (isAllowed(details)) {
            visitor.visitFile(details);
        }
    }
View Full Code Here

Examples of org.gradle.api.file.RelativePath

        }
        List<FileVisitDetailsImpl> dirs = new ArrayList<FileVisitDetailsImpl>();
        for (int i = 0; !stopFlag.get() && i < children.length; i++) {
            File child = children[i];
            boolean isFile = child.isFile();
            RelativePath childPath = path.append(isFile, child.getName());
            FileVisitDetailsImpl details = new FileVisitDetailsImpl(child, childPath, stopFlag);
            if (isAllowed(details)) {
                if (isFile) {
                    visitor.visitFile(details);
                } else {
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.