Java 类org.gradle.api.internal.file.CopyActionProcessingStreamAction 实例源码

项目:Reer    文件:SyncCopyActionDecorator.java   
public WorkResult execute(final CopyActionProcessingStream stream) {
    final Set<RelativePath> visited = new HashSet<RelativePath>();

    WorkResult didWork = delegate.execute(new CopyActionProcessingStream() {
        public void process(final CopyActionProcessingStreamAction action) {
            stream.process(new CopyActionProcessingStreamAction() {
                public void processFile(FileCopyDetailsInternal details) {
                    visited.add(details.getRelativePath());
                    action.processFile(details);
                }
            });
        }
    });

    SyncCopyActionDecoratorFileVisitor fileVisitor = new SyncCopyActionDecoratorFileVisitor(visited, preserveSpec);

    MinimalFileTree walker = new DirectoryFileTree(baseDestDir).postfix();
    walker.visit(fileVisitor);
    visited.clear();

    return new SimpleWorkResult(didWork.getDidWork() || fileVisitor.didWork);
}
项目:Pushjet-Android    文件:SyncCopyActionDecorator.java   
public WorkResult execute(final CopyActionProcessingStream stream) {
    final Set<RelativePath> visited = new HashSet<RelativePath>();

    WorkResult didWork = delegate.execute(new CopyActionProcessingStream() {
        public void process(final CopyActionProcessingStreamAction action) {
            stream.process(new CopyActionProcessingStreamAction() {
                public void processFile(FileCopyDetailsInternal details) {
                    visited.add(details.getRelativePath());
                    action.processFile(details);
                }
            });
        }
    });

    SyncCopyActionDecoratorFileVisitor fileVisitor = new SyncCopyActionDecoratorFileVisitor(visited);

    MinimalFileTree walker = new DirectoryFileTree(baseDestDir).postfix();
    walker.visit(fileVisitor);
    visited.clear();

    return new SimpleWorkResult(didWork.getDidWork() || fileVisitor.didWork);
}
项目:Pushjet-Android    文件:SyncCopyActionDecorator.java   
public WorkResult execute(final CopyActionProcessingStream stream) {
    final Set<RelativePath> visited = new HashSet<RelativePath>();

    WorkResult didWork = delegate.execute(new CopyActionProcessingStream() {
        public void process(final CopyActionProcessingStreamAction action) {
            stream.process(new CopyActionProcessingStreamAction() {
                public void processFile(FileCopyDetailsInternal details) {
                    visited.add(details.getRelativePath());
                    action.processFile(details);
                }
            });
        }
    });

    SyncCopyActionDecoratorFileVisitor fileVisitor = new SyncCopyActionDecoratorFileVisitor(visited);

    MinimalFileTree walker = new DirectoryFileTree(baseDestDir).postfix();
    walker.visit(fileVisitor);
    visited.clear();

    return new SimpleWorkResult(didWork.getDidWork() || fileVisitor.didWork);
}
项目:Reer    文件:CopyFileVisitorImpl.java   
public CopyFileVisitorImpl(CopySpecResolver spec, CopyActionProcessingStreamAction action, Instantiator instantiator, FileSystem fileSystem) {
    this.copySpecResolver = spec;
    this.action = action;
    this.instantiator = instantiator;
    this.fileSystem = fileSystem;
}
项目:Reer    文件:DuplicateHandlingCopyActionDecorator.java   
public WorkResult execute(final CopyActionProcessingStream stream) {
    final Set<RelativePath> visitedFiles = new HashSet<RelativePath>();

    return delegate.execute(new CopyActionProcessingStream() {
        public void process(final CopyActionProcessingStreamAction action) {
            stream.process(new CopyActionProcessingStreamAction() {
                public void processFile(FileCopyDetailsInternal details) {
                    if (!details.isDirectory()) {
                        DuplicatesStrategy strategy = details.getDuplicatesStrategy();

                        if (!visitedFiles.add(details.getRelativePath())) {
                            if (strategy == DuplicatesStrategy.EXCLUDE) {
                                return;
                            } else if (strategy == DuplicatesStrategy.FAIL) {
                                throw new DuplicateFileCopyingException(String.format("Encountered duplicate path \"%s\" during copy operation configured with DuplicatesStrategy.FAIL", details.getRelativePath()));
                            } else if (strategy == DuplicatesStrategy.WARN) {
                                LOGGER.warn("Encountered duplicate path \"{}\" during copy operation configured with DuplicatesStrategy.WARN", details.getRelativePath());
                            }
                        }
                    }

                    action.processFile(details);
                }
            });
        }
    });
}
项目:Pushjet-Android    文件:DuplicateHandlingCopyActionDecorator.java   
public WorkResult execute(final CopyActionProcessingStream stream) {
    final Set<RelativePath> visitedFiles = new HashSet<RelativePath>();

    return delegate.execute(new CopyActionProcessingStream() {
        public void process(final CopyActionProcessingStreamAction action) {
            stream.process(new CopyActionProcessingStreamAction() {
                public void processFile(FileCopyDetailsInternal details) {
                    if (!details.isDirectory()) {
                        DuplicatesStrategy strategy = details.getDuplicatesStrategy();

                        if (!visitedFiles.add(details.getRelativePath())) {
                            if (strategy == DuplicatesStrategy.EXCLUDE) {
                                return;
                            } else if (strategy == DuplicatesStrategy.FAIL) {
                                throw new DuplicateFileCopyingException(String.format("Encountered duplicate path \"%s\" during copy operation configured with DuplicatesStrategy.FAIL", details.getRelativePath()));
                            } else if (strategy == DuplicatesStrategy.WARN) {
                                LOGGER.warn("Encountered duplicate path \"{}\" during copy operation configured with DuplicatesStrategy.WARN", details.getRelativePath());
                            }
                        }
                    }

                    action.processFile(details);
                }
            });
        }
    });
}
项目:Pushjet-Android    文件:DuplicateHandlingCopyActionDecorator.java   
public WorkResult execute(final CopyActionProcessingStream stream) {
    final Set<RelativePath> visitedFiles = new HashSet<RelativePath>();

    return delegate.execute(new CopyActionProcessingStream() {
        public void process(final CopyActionProcessingStreamAction action) {
            stream.process(new CopyActionProcessingStreamAction() {
                public void processFile(FileCopyDetailsInternal details) {
                    if (!details.isDirectory()) {
                        DuplicatesStrategy strategy = details.getDuplicatesStrategy();

                        if (!visitedFiles.add(details.getRelativePath())) {
                            if (strategy == DuplicatesStrategy.EXCLUDE) {
                                return;
                            } else if (strategy == DuplicatesStrategy.FAIL) {
                                throw new DuplicateFileCopyingException(String.format("Encountered duplicate path \"%s\" during copy operation configured with DuplicatesStrategy.FAIL", details.getRelativePath()));
                            } else if (strategy == DuplicatesStrategy.WARN) {
                                LOGGER.warn("Encountered duplicate path \"{}\" during copy operation configured with DuplicatesStrategy.WARN", details.getRelativePath());
                            }
                        }
                    }

                    action.processFile(details);
                }
            });
        }
    });
}
项目:Reer    文件:CopySpecActionImpl.java   
public CopySpecActionImpl(CopyActionProcessingStreamAction action, Instantiator instantiator, FileSystem fileSystem) {
    this.action = action;
    this.instantiator = instantiator;
    this.fileSystem = fileSystem;
}
项目:Reer    文件:CopySpecBackedCopyActionProcessingStream.java   
public void process(final CopyActionProcessingStreamAction action) {
    spec.walk(new CopySpecActionImpl(action, instantiator, fileSystem));
}
项目:Pushjet-Android    文件:CopySpecActionImpl.java   
public CopySpecActionImpl(CopyActionProcessingStreamAction action, Instantiator instantiator, FileSystem fileSystem) {
    this.action = action;
    this.instantiator = instantiator;
    this.fileSystem = fileSystem;
}
项目:Pushjet-Android    文件:CopyFileVisitorImpl.java   
public CopyFileVisitorImpl(CopySpecResolver spec, CopyActionProcessingStreamAction action, Instantiator instantiator, FileSystem fileSystem) {
    this.copySpecResolver = spec;
    this.action = action;
    this.instantiator = instantiator;
    this.fileSystem = fileSystem;
}
项目:Pushjet-Android    文件:CopySpecBackedCopyActionProcessingStream.java   
public void process(final CopyActionProcessingStreamAction action) {
    spec.walk(new CopySpecActionImpl(action, instantiator, fileSystem));
}
项目:Pushjet-Android    文件:CopySpecActionImpl.java   
public CopySpecActionImpl(CopyActionProcessingStreamAction action, Instantiator instantiator, FileSystem fileSystem) {
    this.action = action;
    this.instantiator = instantiator;
    this.fileSystem = fileSystem;
}
项目:Pushjet-Android    文件:CopyFileVisitorImpl.java   
public CopyFileVisitorImpl(CopySpecInternal spec, CopyActionProcessingStreamAction action, Instantiator instantiator, FileSystem fileSystem) {
    this.spec = spec;
    this.action = action;
    this.instantiator = instantiator;
    this.fileSystem = fileSystem;
}
项目:Pushjet-Android    文件:CopySpecBackedCopyActionProcessingStream.java   
public void process(final CopyActionProcessingStreamAction action) {
    spec.walk(new CopySpecActionImpl(action, instantiator, fileSystem));
}
项目:Reer    文件:CopyActionProcessingStream.java   
void process(CopyActionProcessingStreamAction action);
项目:Pushjet-Android    文件:CopyActionProcessingStream.java   
void process(CopyActionProcessingStreamAction action);
项目:Pushjet-Android    文件:CopyActionProcessingStream.java   
void process(CopyActionProcessingStreamAction action);