use of ch.cyberduck.core.transfer.upload.SkipFilter in project cyberduck by iterate-ch.
the class UploadTransfer method filter.
@Override
public AbstractUploadFilter filter(final Session<?> source, final Session<?> destination, final TransferAction action, final ProgressListener listener) {
if (log.isDebugEnabled()) {
log.debug(String.format("Filter transfer with action %s and options %s", action, options));
}
final Symlink symlink = source.getFeature(Symlink.class);
final UploadSymlinkResolver resolver = new UploadSymlinkResolver(symlink, roots);
if (options.temporary) {
options.withTemporary(source.getFeature(Write.class).temporary());
}
final Find find = new CachingFindFeature(cache, source.getFeature(Find.class, new DefaultFindFeature(source)));
final AttributesFinder attributes = new CachingAttributesFinderFeature(cache, source.getFeature(AttributesFinder.class, new DefaultAttributesFinderFeature(source)));
if (action.equals(TransferAction.resume)) {
return new ResumeFilter(resolver, source, options).withFinder(find).withAttributes(attributes);
}
if (action.equals(TransferAction.rename)) {
return new RenameFilter(resolver, source, options).withFinder(find).withAttributes(attributes);
}
if (action.equals(TransferAction.renameexisting)) {
return new RenameExistingFilter(resolver, source, options).withFinder(find).withAttributes(attributes);
}
if (action.equals(TransferAction.skip)) {
return new SkipFilter(resolver, source, options).withFinder(find).withAttributes(attributes);
}
if (action.equals(TransferAction.comparison)) {
return new CompareFilter(resolver, source, options, listener).withFinder(find).withAttributes(attributes);
}
return new OverwriteFilter(resolver, source, options).withFinder(find).withAttributes(attributes);
}
Aggregations