Examples of FileVisitor


Examples of com.thoughtworks.qdox.directorywalker.FileVisitor

     * If a file cannot be read, errorHandler will be notified.
     */
    public void addSourceTree(File file, final FileVisitor errorHandler) {
        DirectoryScanner scanner = new DirectoryScanner(file);
        scanner.addFilter(new SuffixFilter(".java"));
        scanner.scan(new FileVisitor() {
            public void visitFile(File currentFile) {
                try {
                    addSource(currentFile);
                } catch (IOException e) {
          errorHandler.visitFile(currentFile);
View Full Code Here

Examples of com.thoughtworks.qdox.directorywalker.FileVisitor

    }

    public void checkDirectory(File dir) throws IOException {
        DirectoryScanner directoryScanner = new DirectoryScanner(dir);
        directoryScanner.addFilter(new SuffixFilter(".java"));
        directoryScanner.scan(new FileVisitor() {
            public void visitFile(File file) {
                try {
                    checkJavaFile(file);
                } catch (IOException e) {
                    // ?
View Full Code Here

Examples of org.gradle.api.file.FileVisitor

        getVisitor().visitFile(fileDetails);
    }

    @Override
    public void endVisit() {
        FileVisitor visitor = new FileVisitor() {
            public void visitDir(FileVisitDetails dirDetails) {
                maybeDelete(dirDetails, true);
            }

            public void visitFile(FileVisitDetails fileDetails) {
View Full Code Here

Examples of org.gradle.api.file.FileVisitor

        assertThat(sumCompositeTree.getSourceCollections(), equalTo((Iterable) toList(tree, other)));
    }

    @Test
    public void visitsEachTreeWithVisitor() {
        final FileVisitor visitor = context.mock(FileVisitor.class);

        context.checking(new Expectations() {{
            one(source1).visit(visitor);
            one(source2).visit(visitor);
        }});
View Full Code Here

Examples of org.gradle.api.file.FileVisitor

                    {
                        boolean worked = f.setExecutable(true);
                        project.getLogger().info("Setting file +X "+worked + " : "+f.getPath());
                    }
                    FileTree tree = delayedFileTree(DevConstants.LAUNCH4J_DIR + "/bin").call();
                    tree.visit(new FileVisitor()
                    {
                        @Override public void visitDir(FileVisitDetails dirDetails){}
                        @Override
                        public void visitFile(FileVisitDetails fileDetails)
                        {
View Full Code Here

Examples of org.gradle.api.file.FileVisitor

                out.putNextEntry(entry);
                out.write(ByteStreams.toByteArray(classesIn));
                entries.add(entry.getName());
            }

            getResources().visit(new FileVisitor()
            {
                @Override public void visitDir(FileVisitDetails dirDetails){}
                @Override
                public void visitFile(FileVisitDetails file)
                {
View Full Code Here

Examples of org.gradle.api.file.FileVisitor

    private void removeOld(File dir) throws IOException
    {
        final ArrayList<File> directories = new ArrayList<File>();
        FileTree tree = getProject().fileTree(dir);

        tree.visit(new FileVisitor()
        {
            @Override
            public void visitDir(FileVisitDetails dir)
            {
                directories.add(dir.getFile());
View Full Code Here

Examples of org.gradle.api.file.FileVisitor

        assertThat(sumCompositeTree.getSourceCollections(), equalTo((Iterable) toList(source1, source2, other)));
    }

    @Test
    public void visitsEachTreeWithVisitor() {
        final FileVisitor visitor = context.mock(FileVisitor.class);

        context.checking(new Expectations() {{
            one(source1).visit(visitor);
            one(source2).visit(visitor);
        }});
View Full Code Here

Examples of org.gradle.api.file.FileVisitor

        return createSnapshot(hash, jarArchive.contents, new ClassFilesAnalyzer(analyzer));
    }

    JarSnapshot createSnapshot(byte[] hash, FileTree classes, final ClassFilesAnalyzer analyzer) {
        final Map<String, byte[]> hashes = new HashMap<String, byte[]>();
        classes.visit(new FileVisitor() {
            public void visitDir(FileVisitDetails dirDetails) {
            }

            public void visitFile(FileVisitDetails fileDetails) {
                analyzer.visitFile(fileDetails);
View Full Code Here

Examples of org.nutz.lang.util.FileVisitor

      return list;

    if (!f.isDirectory())
      f = f.getParentFile();
    final String base = f.getAbsolutePath();
    Disks.visitFile(f, new FileVisitor() {
      public void visit(File file) {
        list.add(new FileResource(base, file));
      }
    }, new FileFilter() {
      public boolean accept(File theFile) {
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.