Skip to content

Commit

Permalink
Delete unused.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed May 23, 2019
1 parent dbecfbe commit 1c206b4
Show file tree
Hide file tree
Showing 32 changed files with 95 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public TransferAction prompt(final TransferItem file) {
return TransferAction.overwrite;
}
}, new DisabledTransferErrorCallback(),
new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledPasswordCallback(), new DisabledNotificationService()) {
new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledNotificationService()) {

}.run(session));
assertTrue(new CryptoFindFeature(session, new AzureFindFeature(session, null), cryptomator).find(dir1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public TransferAction prompt(final TransferItem file) {
return TransferAction.overwrite;
}
}, new DisabledTransferErrorCallback(),
new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledPasswordCallback(), new DisabledNotificationService()) {
new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledNotificationService()) {

}.run(session));
final B2FileidProvider fileid = new B2FileidProvider(session).withCache(cache);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import ch.cyberduck.core.DisabledCancelCallback;
import ch.cyberduck.core.DisabledHostKeyCallback;
import ch.cyberduck.core.DisabledLoginCallback;
import ch.cyberduck.core.DisabledPasswordCallback;
import ch.cyberduck.core.DisabledProgressListener;
import ch.cyberduck.core.Host;
import ch.cyberduck.core.Local;
Expand Down Expand Up @@ -129,7 +128,7 @@ public TransferAction prompt(final TransferItem file) {
return TransferAction.overwrite;
}
}, new DisabledTransferErrorCallback(),
new DisabledProgressListener(), counter, new DisabledLoginCallback(), new DisabledPasswordCallback(), new DisabledNotificationService()) {
new DisabledProgressListener(), counter, new DisabledLoginCallback(), new DisabledNotificationService()) {

}.run(session));
local.delete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import ch.cyberduck.core.DefaultIOExceptionMappingService;
import ch.cyberduck.core.DisabledLoginCallback;
import ch.cyberduck.core.DisabledPasswordCallback;
import ch.cyberduck.core.Host;
import ch.cyberduck.core.ListProgressListener;
import ch.cyberduck.core.LocaleFactory;
Expand Down Expand Up @@ -70,7 +69,7 @@ public EditOpenWorker(final Host bookmark, final AbstractEditor editor,
this.quit = quit;
this.notification = notification;
this.download = new DownloadTransfer(bookmark, editor.getRemote(), editor.getLocal(),
new DownloadDuplicateFilter()) {
new DownloadDuplicateFilter()) {
@Override
public TransferAction action(final Session<?> source, final Session<?> destination, final boolean resumeRequested, final boolean reloadRequested,
final TransferPrompt prompt, final ListProgressListener listener) {
Expand All @@ -93,8 +92,8 @@ public Transfer run(final Session<?> session) throws BackgroundException {
options.open = false;
final SingleTransferWorker worker
= new SingleTransferWorker(session, session, download, options, new TransferSpeedometer(download),
new DisabledTransferPrompt(), callback,
listener, new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledPasswordCallback(), notification);
new DisabledTransferPrompt(), callback,
listener, new DisabledStreamListener(), new DisabledLoginCallback(), notification);
worker.run(session);
if(!download.isComplete()) {
log.warn(String.format("File size changed for %s", file));
Expand All @@ -111,7 +110,7 @@ public Transfer run(final Session<?> session) throws BackgroundException {
@Override
public String getActivity() {
return MessageFormat.format(LocaleFactory.localizedString("Downloading {0}", "Status"),
editor.getRemote().getName());
editor.getRemote().getName());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

import ch.cyberduck.core.DisabledLoginCallback;
import ch.cyberduck.core.DisabledPasswordCallback;
import ch.cyberduck.core.Host;
import ch.cyberduck.core.ListProgressListener;
import ch.cyberduck.core.Local;
Expand Down Expand Up @@ -88,7 +87,7 @@ public Transfer run(final Session<?> session) throws BackgroundException {
final SingleTransferWorker worker
= new SingleTransferWorker(session, session, upload, new TransferOptions(),
new TransferSpeedometer(upload), new DisabledTransferPrompt(), callback,
listener, new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledPasswordCallback(), notification);
listener, new DisabledStreamListener(), new DisabledLoginCallback(), notification);
worker.run(session);
if(!upload.isComplete()) {
log.warn(String.format("File size changed for %s", editor.getRemote()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public TransferBackgroundAction(final ConnectionCallback callback,
final TransferErrorCallback error,
final TransferSpeedometer meter,
final StreamListener stream) {
super(controller, source, new ConcurrentTransferWorker(source, destination, transfer, options, meter, prompt, error, callback, password, progress, stream,
super(controller, source, new ConcurrentTransferWorker(source, destination, transfer, options, meter, prompt, error, callback, progress, stream,
NotificationServiceFactory.get()));
this.options = options;
this.meter = meter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import ch.cyberduck.core.DisabledListProgressListener;
import ch.cyberduck.core.Local;
import ch.cyberduck.core.LocaleFactory;
import ch.cyberduck.core.PasswordCallback;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.ProgressListener;
import ch.cyberduck.core.Session;
Expand Down Expand Up @@ -73,8 +72,7 @@ public abstract class AbstractTransferWorker extends TransferWorker<Boolean> {
* Error prompt
*/
private final TransferErrorCallback error;
private final ConnectionCallback connectionCallback;
private final PasswordCallback passwordCallback;
private final ConnectionCallback connect;
private final TransferOptions options;
private final TransferSpeedometer meter;
/**
Expand All @@ -93,30 +91,28 @@ public AbstractTransferWorker(final Transfer transfer, final TransferOptions opt
final TransferErrorCallback error,
final ProgressListener progress,
final StreamListener stream,
final ConnectionCallback connectionCallback,
final PasswordCallback passwordCallback,
final ConnectionCallback connect,
final NotificationService notification) {
this(transfer, options, prompt, meter, error, progress, stream, connectionCallback, passwordCallback, notification, new TransferItemCache(Integer.MAX_VALUE));
this(transfer, options, prompt, meter, error, progress, stream, connect, notification, new TransferItemCache(Integer.MAX_VALUE));
}

public AbstractTransferWorker(final Transfer transfer, final TransferOptions options,
final TransferPrompt prompt, final TransferSpeedometer meter,
final TransferErrorCallback error,
final ProgressListener progress,
final StreamListener stream,
final ConnectionCallback connectionCallback, final PasswordCallback passwordCallback,
final ConnectionCallback connect,
final NotificationService notification,
final Cache<TransferItem> cache) {
this(transfer, options, prompt, meter, error, progress, stream, connectionCallback, passwordCallback, notification, cache, new ConcurrentHashMap<TransferItem, TransferStatus>());
this(transfer, options, prompt, meter, error, progress, stream, connect, notification, cache, new ConcurrentHashMap<TransferItem, TransferStatus>());
}

public AbstractTransferWorker(final Transfer transfer, final TransferOptions options,
final TransferPrompt prompt, final TransferSpeedometer meter,
final TransferErrorCallback error,
final ProgressListener progress,
final StreamListener stream,
final ConnectionCallback connectionCallback,
final PasswordCallback passwordCallback,
final ConnectionCallback connect,
final NotificationService notification,
final Cache<TransferItem> cache,
final Map<TransferItem, TransferStatus> table) {
Expand All @@ -127,8 +123,7 @@ public AbstractTransferWorker(final Transfer transfer, final TransferOptions opt
this.error = new SynchronizingTransferErrorCallback(error);
this.progress = progress;
this.stream = stream;
this.connectionCallback = connectionCallback;
this.passwordCallback = passwordCallback;
this.connect = connect;
this.notification = notification;
this.cache = cache;
this.table = table;
Expand Down Expand Up @@ -220,13 +215,13 @@ public void message(final String message) {
}
this.await();
meter.reset();
transfer.pre(source, destination, table, connectionCallback);
transfer.pre(source, destination, table, connect);
// Transfer all files sequentially
for(TransferItem next : transfer.getRoots()) {
this.transfer(next, action);
}
this.await();
transfer.post(source, destination, table, connectionCallback);
transfer.post(source, destination, table, connect);
}
finally {
this.release(source, Connection.source, null);
Expand Down Expand Up @@ -423,7 +418,7 @@ private void retry(final TransferStatus segment) throws BackgroundException {
transfer.transfer(s, d,
segment.getRename().remote != null ? segment.getRename().remote : item.remote,
segment.getRename().local != null ? segment.getRename().local : item.local,
options, segment, connectionCallback, progress, stream);
options, segment, connect, progress, stream);
}
catch(ConnectionCanceledException e) {
log.warn(String.format("Canceled transfer of %s", item));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import ch.cyberduck.core.AlphanumericRandomStringService;
import ch.cyberduck.core.ConnectionCallback;
import ch.cyberduck.core.Host;
import ch.cyberduck.core.PasswordCallback;
import ch.cyberduck.core.ProgressListener;
import ch.cyberduck.core.Session;
import ch.cyberduck.core.exception.BackgroundException;
Expand Down Expand Up @@ -66,13 +65,12 @@ public ConcurrentTransferWorker(final SessionPool source,
final TransferSpeedometer meter,
final TransferPrompt prompt,
final TransferErrorCallback error,
final ConnectionCallback connectionCallback,
final PasswordCallback passwordCallback,
final ConnectionCallback connect,
final ProgressListener progressListener,
final StreamListener streamListener,
final NotificationService notification) {
this(source, destination, transfer, ThreadPool.Priority.norm, options, meter, prompt, error,
connectionCallback, passwordCallback, progressListener, streamListener, notification);
connect, progressListener, streamListener, notification);
}

public ConcurrentTransferWorker(final SessionPool source,
Expand All @@ -83,12 +81,11 @@ public ConcurrentTransferWorker(final SessionPool source,
final TransferSpeedometer meter,
final TransferPrompt prompt,
final TransferErrorCallback error,
final ConnectionCallback connectionCallback,
final PasswordCallback passwordCallback,
final ConnectionCallback connect,
final ProgressListener progressListener,
final StreamListener streamListener,
final NotificationService notification) {
super(transfer, options, prompt, meter, error, progressListener, streamListener, connectionCallback, passwordCallback, notification);
super(transfer, options, prompt, meter, error, progressListener, streamListener, connect, notification);
this.source = source;
this.destination = destination;
this.pool = ThreadPoolFactory.get(String.format("%s-transfer", new AlphanumericRandomStringService().random()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/

import ch.cyberduck.core.ConnectionCallback;
import ch.cyberduck.core.PasswordCallback;
import ch.cyberduck.core.ProgressListener;
import ch.cyberduck.core.Session;
import ch.cyberduck.core.exception.BackgroundException;
Expand All @@ -45,8 +44,8 @@ public SingleTransferWorker(final Session source, final Session destination, fin
final TransferSpeedometer meter, final TransferPrompt prompt,
final TransferErrorCallback error,
final ProgressListener listener, final StreamListener streamListener,
final ConnectionCallback connectionCallback, final PasswordCallback passwordCallback, final NotificationService notification) {
super(transfer, options, prompt, meter, error, listener, streamListener, connectionCallback, passwordCallback, notification);
final ConnectionCallback connect, final NotificationService notification) {
super(transfer, options, prompt, meter, error, listener, streamListener, connect, notification);
this.source = source;
this.destination = destination;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import ch.cyberduck.core.AttributedList;
import ch.cyberduck.core.DisabledListProgressListener;
import ch.cyberduck.core.DisabledLoginCallback;
import ch.cyberduck.core.DisabledPasswordCallback;
import ch.cyberduck.core.DisabledProgressListener;
import ch.cyberduck.core.Filter;
import ch.cyberduck.core.Host;
Expand Down Expand Up @@ -166,7 +165,7 @@ public TransferAction prompt(final TransferItem file) {
return TransferAction.overwrite;
}
}, new DisabledTransferErrorCallback(),
new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledPasswordCallback(), new DisabledNotificationService()).run(session);
new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledNotificationService()).run(session);
assertTrue(t.isComplete());
final Transfer serialized = new TransferDictionary().deserialize(t.serialize(SerializerFactory.get()));
assertNotSame(t, serialized);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
package ch.cyberduck.core.transfer;

import ch.cyberduck.core.*;
import ch.cyberduck.core.AttributedList;
import ch.cyberduck.core.Credentials;
import ch.cyberduck.core.DisabledListProgressListener;
import ch.cyberduck.core.DisabledLoginCallback;
import ch.cyberduck.core.DisabledProgressListener;
import ch.cyberduck.core.Host;
import ch.cyberduck.core.ListProgressListener;
import ch.cyberduck.core.Local;
import ch.cyberduck.core.NullLocal;
import ch.cyberduck.core.NullSession;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.ProgressListener;
import ch.cyberduck.core.Session;
import ch.cyberduck.core.TestProtocol;
import ch.cyberduck.core.features.Read;
import ch.cyberduck.core.filter.DownloadRegexFilter;
import ch.cyberduck.core.io.DisabledStreamListener;
Expand Down Expand Up @@ -118,7 +131,7 @@ public void testPrepareDownloadHttp() throws Exception {
final Transfer transfer = new DownloadTransfer(new Host(new TestProtocol()), test, new NullLocal(UUID.randomUUID().toString(), "transfer"));
final SingleTransferWorker worker = new SingleTransferWorker(session, null, transfer, new TransferOptions(),
new TransferSpeedometer(transfer), new DisabledTransferPrompt(), new DisabledTransferErrorCallback(),
new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledPasswordCallback(), new DisabledNotificationService());
new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledNotificationService());
worker.prepare(test, new NullLocal(System.getProperty("java.io.tmpdir"), "c"), new TransferStatus().exists(true),
TransferAction.overwrite
);
Expand Down Expand Up @@ -149,7 +162,7 @@ public TransferAction prompt(final TransferItem file) {
return null;
}
}, new DisabledTransferErrorCallback(),
new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledPasswordCallback(), new DisabledNotificationService());
new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledNotificationService());
worker.prepare(test, testLocal, new TransferStatus().exists(true),
TransferAction.overwrite
);
Expand Down Expand Up @@ -195,7 +208,7 @@ public TransferAction prompt(final TransferItem file) {
return null;
}
}, new DisabledTransferErrorCallback(),
new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledPasswordCallback(), new DisabledNotificationService());
new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledNotificationService());
worker.prepare(test, local, new TransferStatus().exists(true), TransferAction.resume);
final TransferStatus status = new TransferStatus();
status.setExists(true);
Expand Down
Loading

0 comments on commit 1c206b4

Please sign in to comment.