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);
}
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);
}
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);
}
Aggregations