Search in sources :

Example 26 with AttributesFinder

use of ch.cyberduck.core.features.AttributesFinder in project cyberduck by iterate-ch.

the class SyncTransfer method filter.

@Override
public TransferPathFilter 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", action));
    }
    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)));
    // Set chosen action (upload, download, mirror) from prompt
    comparison = new CachingComparePathFilter(new DefaultComparePathFilter(source, host.getTimezone())).withCache(comparisons).withAttributes(attributes).withFinder(find);
    return new SynchronizationPathFilter(comparison, download.filter(source, destination, TransferAction.overwrite, listener).withAttributes(attributes).withFinder(find), upload.filter(source, destination, TransferAction.overwrite, listener).withAttributes(attributes).withFinder(find), action);
}
Also used : SynchronizationPathFilter(ch.cyberduck.core.transfer.synchronisation.SynchronizationPathFilter) DefaultAttributesFinderFeature(ch.cyberduck.core.shared.DefaultAttributesFinderFeature) DefaultFindFeature(ch.cyberduck.core.shared.DefaultFindFeature) CachingAttributesFinderFeature(ch.cyberduck.core.CachingAttributesFinderFeature) AttributesFinder(ch.cyberduck.core.features.AttributesFinder) Find(ch.cyberduck.core.features.Find) CachingComparePathFilter(ch.cyberduck.core.synchronization.CachingComparePathFilter) CachingFindFeature(ch.cyberduck.core.CachingFindFeature) DefaultComparePathFilter(ch.cyberduck.core.synchronization.DefaultComparePathFilter)

Example 27 with AttributesFinder

use of ch.cyberduck.core.features.AttributesFinder in project cyberduck by iterate-ch.

the class CopyTransfer method filter.

@Override
public TransferPathFilter 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", action));
    }
    final Find find = new CachingFindFeature(cache, destination.getFeature(Find.class, new DefaultFindFeature(destination)));
    final AttributesFinder attributes = new CachingAttributesFinderFeature(cache, destination.getFeature(AttributesFinder.class, new DefaultAttributesFinderFeature(destination)));
    if (action.equals(TransferAction.comparison)) {
        return new ChecksumFilter(source, destination, mapping).withFinder(find).withAttributes(attributes);
    }
    return new OverwriteFilter(source, destination, mapping).withFinder(find).withAttributes(attributes);
}
Also used : DefaultAttributesFinderFeature(ch.cyberduck.core.shared.DefaultAttributesFinderFeature) DefaultFindFeature(ch.cyberduck.core.shared.DefaultFindFeature) AttributesFinder(ch.cyberduck.core.features.AttributesFinder) ChecksumFilter(ch.cyberduck.core.transfer.copy.ChecksumFilter) Find(ch.cyberduck.core.features.Find) OverwriteFilter(ch.cyberduck.core.transfer.copy.OverwriteFilter)

Example 28 with AttributesFinder

use of ch.cyberduck.core.features.AttributesFinder 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)28 Test (org.junit.Test)23 Path (ch.cyberduck.core.Path)22 TransferStatus (ch.cyberduck.core.transfer.TransferStatus)18 PathAttributes (ch.cyberduck.core.PathAttributes)15 Delete (ch.cyberduck.core.features.Delete)15 AlphanumericRandomStringService (ch.cyberduck.core.AlphanumericRandomStringService)14 DisabledLoginCallback (ch.cyberduck.core.DisabledLoginCallback)14 IntegrationTest (ch.cyberduck.test.IntegrationTest)14 ListProgressListener (ch.cyberduck.core.ListProgressListener)11 DisabledConnectionCallback (ch.cyberduck.core.DisabledConnectionCallback)10 Find (ch.cyberduck.core.features.Find)10 Move (ch.cyberduck.core.features.Move)10 Host (ch.cyberduck.core.Host)9 NullLocal (ch.cyberduck.core.NullLocal)8 NullSession (ch.cyberduck.core.NullSession)8 TestProtocol (ch.cyberduck.core.TestProtocol)8 Touch (ch.cyberduck.core.features.Touch)7 DisabledProgressListener (ch.cyberduck.core.DisabledProgressListener)6 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)6