Search in sources :

Example 1 with SkipFilter

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);
}
Also used : AttributesFinder(ch.cyberduck.core.features.AttributesFinder) ResumeFilter(ch.cyberduck.core.transfer.upload.ResumeFilter) Symlink(ch.cyberduck.core.features.Symlink) DefaultAttributesFinderFeature(ch.cyberduck.core.shared.DefaultAttributesFinderFeature) DefaultFindFeature(ch.cyberduck.core.shared.DefaultFindFeature) RenameFilter(ch.cyberduck.core.transfer.upload.RenameFilter) CompareFilter(ch.cyberduck.core.transfer.upload.CompareFilter) Find(ch.cyberduck.core.features.Find) SkipFilter(ch.cyberduck.core.transfer.upload.SkipFilter) UploadSymlinkResolver(ch.cyberduck.core.transfer.symlink.UploadSymlinkResolver) RenameExistingFilter(ch.cyberduck.core.transfer.upload.RenameExistingFilter) OverwriteFilter(ch.cyberduck.core.transfer.upload.OverwriteFilter)

Aggregations

AttributesFinder (ch.cyberduck.core.features.AttributesFinder)1 Find (ch.cyberduck.core.features.Find)1 Symlink (ch.cyberduck.core.features.Symlink)1 DefaultAttributesFinderFeature (ch.cyberduck.core.shared.DefaultAttributesFinderFeature)1 DefaultFindFeature (ch.cyberduck.core.shared.DefaultFindFeature)1 UploadSymlinkResolver (ch.cyberduck.core.transfer.symlink.UploadSymlinkResolver)1 CompareFilter (ch.cyberduck.core.transfer.upload.CompareFilter)1 OverwriteFilter (ch.cyberduck.core.transfer.upload.OverwriteFilter)1 RenameExistingFilter (ch.cyberduck.core.transfer.upload.RenameExistingFilter)1 RenameFilter (ch.cyberduck.core.transfer.upload.RenameFilter)1 ResumeFilter (ch.cyberduck.core.transfer.upload.ResumeFilter)1 SkipFilter (ch.cyberduck.core.transfer.upload.SkipFilter)1