mirror of
https://github.com/iterate-ch/cyberduck.git
synced 2026-05-26 19:10:49 +00:00
Merge remote-tracking branch 'origin/master' into feature/10-ikvmnet-cli
This commit is contained in:
@@ -39,17 +39,17 @@ jobs:
|
||||
echo "NuGetPackageSourceCredentials_gh-iterate-ch=${{ env.NugetCredentials }}" >> $env:GITHUB_ENV
|
||||
- name: Install Bonjour SDK
|
||||
if: ${{ runner.os == 'Windows' }}
|
||||
uses: crazy-max/ghaction-chocolatey@v3
|
||||
uses: crazy-max/ghaction-chocolatey@v4
|
||||
with:
|
||||
args: install bonjour -y
|
||||
- name: Install WiX Toolset
|
||||
if: ${{ runner.os == 'Windows' }}
|
||||
uses: crazy-max/ghaction-chocolatey@v3
|
||||
uses: crazy-max/ghaction-chocolatey@v4
|
||||
with:
|
||||
args: install wixtoolset -y
|
||||
- name: Install OpenSSL
|
||||
if: ${{ runner.os == 'Windows' }}
|
||||
uses: crazy-max/ghaction-chocolatey@v3
|
||||
uses: crazy-max/ghaction-chocolatey@v4
|
||||
with:
|
||||
args: install openssl -y
|
||||
- name: Build with Maven
|
||||
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
run: echo "Checkout $TAG"
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
@@ -62,13 +62,13 @@ jobs:
|
||||
mvn -B verify --projects cli/linux --also-make -DskipTests
|
||||
dpkg-deb -R cli/linux/target/release/duck_${{env.VERSION}}.$COUNT_amd64.deb .
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
uses: docker/build-push-action@v7
|
||||
env:
|
||||
DOCKER_BUILDKIT: 1
|
||||
with:
|
||||
|
||||
+6
-3
@@ -1,7 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
[9.4.0](https://github.com/iterate-ch/cyberduck/compare/release-9-3-1...release-9-4-0)
|
||||
[9.4.1](https://github.com/iterate-ch/cyberduck/compare/release-9-4-0...release-9-4-1)
|
||||
* Cleartext uploads to unlocked vault with auto detect disabled in Preferences (Cryptomator) ([#17893](https://trac.cyberduck.io/ticket/17893))
|
||||
* Unable to lock vault (Cryptomator) ([#17892](https://trac.cyberduck.io/ticket/17892))
|
||||
|
||||
[9.4.0](https://github.com/iterate-ch/cyberduck/compare/release-9-3-1...release-9-4-0)
|
||||
* [Feature] Rewrite protocol implementation (iRODS)
|
||||
* [Bugfix] Do not preemptively save OAuth tokens with no username (Box, Dropbox, Google Drive, Google Storage, OneDrive)
|
||||
* [Bugfix] Fail when reading private key for selected certificate fails (WebDAV)
|
||||
@@ -81,8 +84,8 @@
|
||||
[9.1.3](https://github.com/iterate-ch/cyberduck/compare/release-9-1-2...release-9-1-3)
|
||||
* [Bugfix] Invalid progress in Finder transferring multiple files (macOS) ([#16738](https://trac.cyberduck.io/ticket/16738))
|
||||
* [Bugfix] Diasble lookup of vaults by default. Must explicitly specify --vault (Cyptomator, CLI)
|
||||
* [Bugfix] Duplicate file menu item always disabled (FTP) ([#16798](https://github.com/iterate-ch/cyberduck/issues/16798))
|
||||
* [Bugfix] Allow OAuth configuration in connection profiles (WebDAV) ([#16792](https://github.com/iterate-ch/cyberduck/issues/16792))
|
||||
* [Bugfix] Duplicate file menu item always disabled (FTP) ([#16798](https://trac.cyberduck.io/ticket/16798))
|
||||
* [Bugfix] Allow OAuth configuration in connection profiles (WebDAV) ([#16792](https://trac.cyberduck.io/ticket/16792))
|
||||
|
||||
[9.1.2](https://github.com/iterate-ch/cyberduck/compare/release-9-1-1...release-9-1-2)
|
||||
* [Bugfix] No fallback to IPv4 address when IPv6 connect attempt fails with unreachable network ([#16723](https://trac.cyberduck.io/ticket/16723))
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
<parent>
|
||||
<groupId>ch.cyberduck</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>9.4.0-SNAPSHOT</version>
|
||||
<version>9.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>azure</artifactId>
|
||||
<properties>
|
||||
|
||||
@@ -20,7 +20,7 @@ import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.exception.BackgroundException;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.features.Move;
|
||||
import ch.cyberduck.core.io.DisabledStreamListener;
|
||||
import ch.cyberduck.core.io.StreamListener;
|
||||
import ch.cyberduck.core.transfer.TransferStatus;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -44,7 +44,7 @@ public class AzureMoveFeature implements Move {
|
||||
|
||||
@Override
|
||||
public Path move(final Path file, final Path renamed, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException {
|
||||
final Path copy = proxy.copy(file, renamed, status, connectionCallback, new DisabledStreamListener());
|
||||
final Path copy = proxy.copy(file, renamed, status, connectionCallback, StreamListener.noop);
|
||||
delete.delete(Collections.singletonList(file), connectionCallback, callback);
|
||||
return copy;
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@ package ch.cyberduck.core.azure;/*
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.Credentials;
|
||||
import ch.cyberduck.core.DisabledCancelCallback;
|
||||
import ch.cyberduck.core.DisabledHostKeyCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.Host;
|
||||
import ch.cyberduck.core.HostKeyCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.LoginConnectionService;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.cryptomator.CryptoVault;
|
||||
import ch.cyberduck.core.threading.CancelCallback;
|
||||
import ch.cyberduck.test.VaultTest;
|
||||
|
||||
import org.junit.After;
|
||||
@@ -50,7 +50,7 @@ public class AbstractAzureTest extends VaultTest {
|
||||
PROPERTIES.get("azure.user")
|
||||
));
|
||||
session = new AzureSession(host);
|
||||
new LoginConnectionService(new DisabledLoginCallback(), new DisabledHostKeyCallback(),
|
||||
new TestPasswordStore(), new DisabledProgressListener()).check(session, new DisabledCancelCallback());
|
||||
new LoginConnectionService(LoginCallback.noop, HostKeyCallback.noop,
|
||||
new TestPasswordStore(), ProgressListener.noop).check(session, CancelCallback.noop);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.AsciiRandomStringService;
|
||||
import ch.cyberduck.core.DefaultPathPredicate;
|
||||
import ch.cyberduck.core.DisabledListProgressListener;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.exception.NotfoundException;
|
||||
@@ -52,7 +52,7 @@ public class AzureAttributesFinderFeatureTest extends AbstractAzureTest {
|
||||
assertEquals("d41d8cd98f00b204e9800998ecf8427e", attributes.getChecksum().hash);
|
||||
assertNotNull(attributes.getETag());
|
||||
assertEquals(attributes.getETag(), new DefaultAttributesFinderFeature(session).find(test).getETag());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -64,7 +64,7 @@ public class AzureAttributesFinderFeatureTest extends AbstractAzureTest {
|
||||
assertNotEquals(PathAttributes.EMPTY, attributes);
|
||||
assertNotNull(attributes.getETag());
|
||||
assertEquals(attributes.getETag(), new DefaultAttributesFinderFeature(session).find(container).getETag());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(container), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(container), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -82,7 +82,7 @@ public class AzureAttributesFinderFeatureTest extends AbstractAzureTest {
|
||||
assertNotEquals(PathAttributes.EMPTY, attributes);
|
||||
assertNotNull(attributes.getETag());
|
||||
assertNotNull(new AzureObjectListService(session).list(directory, new DisabledListProgressListener()).find(new DefaultPathPredicate(test)));
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(directory), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(directory), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertNotNull(new AzureObjectListService(session).list(directory, new DisabledListProgressListener()).find(new DefaultPathPredicate(test)));
|
||||
// Still found as prefix
|
||||
assertNotNull(new AzureObjectListService(session).list(container, new DisabledListProgressListener()).find(new DefaultPathPredicate(intermediate)));
|
||||
@@ -90,7 +90,7 @@ public class AzureAttributesFinderFeatureTest extends AbstractAzureTest {
|
||||
// Ignore 404 failures
|
||||
assertSame(PathAttributes.EMPTY, new AzureAttributesFinderFeature(session).find(directory));
|
||||
assertSame(PathAttributes.EMPTY, new AzureAttributesFinderFeature(session).find(intermediate));
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(directory), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(container), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(directory), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(container), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package ch.cyberduck.core.azure;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.exception.UnsupportedException;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.features.Find;
|
||||
import ch.cyberduck.core.io.DisabledStreamListener;
|
||||
import ch.cyberduck.core.io.StreamCancelation;
|
||||
import ch.cyberduck.core.io.StreamCopier;
|
||||
import ch.cyberduck.core.io.StreamListener;
|
||||
import ch.cyberduck.core.io.StreamProgress;
|
||||
import ch.cyberduck.core.shared.DefaultFindFeature;
|
||||
import ch.cyberduck.core.transfer.TransferStatus;
|
||||
@@ -46,12 +46,12 @@ public class AzureCopyFeatureTest extends AbstractAzureTest {
|
||||
assertEquals("Cannot copy cyberduck.", e.getDetail(false));
|
||||
}
|
||||
final Path copy = feature.copy(test,
|
||||
new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(), new DisabledConnectionCallback(), new DisabledStreamListener());
|
||||
new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(), ConnectionCallback.noop, StreamListener.noop);
|
||||
assertEquals(PathAttributes.EMPTY, copy.attributes());
|
||||
final PathAttributes sourceAttr = new AzureAttributesFinderFeature(session).find(test);
|
||||
final PathAttributes copyAttr = new AzureAttributesFinderFeature(session).find(copy);
|
||||
assertNotEquals(sourceAttr.getETag(), copyAttr.getETag());
|
||||
new AzureDeleteFeature(session).delete(Arrays.asList(test, copy), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Arrays.asList(test, copy), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -62,15 +62,15 @@ public class AzureCopyFeatureTest extends AbstractAzureTest {
|
||||
final Path test = new AzureTouchFeature(session).touch(
|
||||
new AzureWriteFeature(session), new Path(folder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
|
||||
final byte[] content = RandomUtils.nextBytes(1023);
|
||||
final OutputStream out = new AzureWriteFeature(session).write(test, new TransferStatus().setExists(true).setLength(content.length), new DisabledConnectionCallback());
|
||||
final OutputStream out = new AzureWriteFeature(session).write(test, new TransferStatus().setExists(true).setLength(content.length), ConnectionCallback.noop);
|
||||
new StreamCopier(StreamCancelation.noop, StreamProgress.noop).transfer(new ByteArrayInputStream(content), out);
|
||||
final Path copy = new AzureTouchFeature(session).touch(
|
||||
new AzureWriteFeature(session), new Path(folder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
|
||||
new AzureCopyFeature(session).copy(test, copy, new TransferStatus().setExists(true), new DisabledConnectionCallback(), new DisabledStreamListener());
|
||||
new AzureCopyFeature(session).copy(test, copy, new TransferStatus().setExists(true), ConnectionCallback.noop, StreamListener.noop);
|
||||
assertEquals(1023L, new AzureAttributesFinderFeature(session).find(copy).getSize());
|
||||
final Find find = new DefaultFindFeature(session);
|
||||
assertTrue(find.find(test));
|
||||
assertTrue(find.find(copy));
|
||||
new AzureDeleteFeature(session).delete(Arrays.asList(test, copy), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Arrays.asList(test, copy), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package ch.cyberduck.core.azure;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.AsciiRandomStringService;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.exception.NotfoundException;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
@@ -25,14 +25,14 @@ public class AzureDeleteFeatureTest extends AbstractAzureTest {
|
||||
@Test(expected = NotfoundException.class)
|
||||
public void testDeleteNotFoundBucket() throws Exception {
|
||||
final Path container = new Path(new AsciiRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume));
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(container), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(container), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test(expected = NotfoundException.class)
|
||||
public void testDeleteNotFoundKey() throws Exception {
|
||||
final Path container = new Path("cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
|
||||
final Path test = new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -40,7 +40,7 @@ public class AzureDeleteFeatureTest extends AbstractAzureTest {
|
||||
final Path container = new Path("cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
|
||||
final Path test = new AzureDirectoryFeature(session).mkdir(new AzureWriteFeature(session), new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
|
||||
assertTrue(new AzureFindFeature(session).find(test));
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertFalse(new AzureFindFeature(session).find(test));
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class AzureDeleteFeatureTest extends AbstractAzureTest {
|
||||
final Path test = new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
new AzureTouchFeature(session).touch(new AzureWriteFeature(session), test, new TransferStatus());
|
||||
assertTrue(new AzureFindFeature(session).find(test));
|
||||
new AzureDeleteFeature(session).delete(Arrays.asList(container, test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Arrays.asList(container, test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertFalse(new AzureFindFeature(session).find(test));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package ch.cyberduck.core.azure;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.exception.ConflictException;
|
||||
@@ -30,7 +30,7 @@ public class AzureDirectoryFeatureTest extends AbstractAzureTest {
|
||||
assertEquals(PathAttributes.EMPTY, container.attributes());
|
||||
assertThrows(ConflictException.class, () -> feature.mkdir(new AzureWriteFeature(session), container, new TransferStatus()));
|
||||
new AzureTouchFeature(session).touch(new AzureWriteFeature(session), new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(container), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(container), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertFalse(new AzureFindFeature(session).find(container));
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class AzureDirectoryFeatureTest extends AbstractAzureTest {
|
||||
assertThrows(InvalidFilenameException.class, () -> feature.preflight(container.getParent(), container.getName()));
|
||||
feature.mkdir(new AzureWriteFeature(session), container, new TransferStatus());
|
||||
assertTrue(new AzureFindFeature(session).find(container));
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(container), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(container), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertFalse(new AzureFindFeature(session).find(container));
|
||||
}
|
||||
|
||||
@@ -56,10 +56,10 @@ public class AzureDirectoryFeatureTest extends AbstractAzureTest {
|
||||
assertEquals(PathAttributes.EMPTY, placeholder.attributes());
|
||||
final Path file = new Path(placeholder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
new AzureTouchFeature(session).touch(new AzureWriteFeature(session), file, new TransferStatus());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(placeholder), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(placeholder), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
// Still find common prefix
|
||||
assertTrue(new AzureFindFeature(session).find(placeholder));
|
||||
assertEquals(PathAttributes.EMPTY, new AzureAttributesFinderFeature(session).find(placeholder));
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.AsciiRandomStringService;
|
||||
import ch.cyberduck.core.CachingFindFeature;
|
||||
import ch.cyberduck.core.DisabledListProgressListener;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathCache;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
@@ -57,7 +57,7 @@ public class AzureFindFeatureTest extends AbstractAzureTest {
|
||||
new AzureWriteFeature(session), new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
|
||||
assertTrue(new AzureFindFeature(session).find(folder));
|
||||
assertFalse(new AzureFindFeature(session).find(new Path(folder.getAbsolute(), EnumSet.of(Path.Type.file))));
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(folder), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(folder), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -67,7 +67,7 @@ public class AzureFindFeatureTest extends AbstractAzureTest {
|
||||
new AzureTouchFeature(session).touch(new AzureWriteFeature(session), file, new TransferStatus());
|
||||
assertTrue(new AzureFindFeature(session).find(file));
|
||||
assertFalse(new AzureFindFeature(session).find(new Path(file.getAbsolute(), EnumSet.of(Path.Type.directory))));
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -84,7 +84,7 @@ public class AzureFindFeatureTest extends AbstractAzureTest {
|
||||
assertTrue(new AzureFindFeature(session).find(new Path(container, prefix, EnumSet.of(Path.Type.directory, Path.Type.placeholder))));
|
||||
assertTrue(new AzureObjectListService(session).list(intermediate,
|
||||
new DisabledListProgressListener()).contains(test));
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertFalse(new AzureFindFeature(session).find(test));
|
||||
assertFalse(new AzureFindFeature(session).find(intermediate));
|
||||
final PathCache cache = new PathCache(1);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package ch.cyberduck.core.azure;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.transfer.TransferStatus;
|
||||
@@ -30,7 +30,7 @@ public class AzureMetadataFeatureTest extends AbstractAzureTest {
|
||||
assertFalse(metadata.isEmpty());
|
||||
assertTrue(metadata.containsKey("Test"));
|
||||
assertEquals(v, metadata.get("Test"));
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -44,6 +44,6 @@ public class AzureMetadataFeatureTest extends AbstractAzureTest {
|
||||
assertFalse(metadata.isEmpty());
|
||||
assertTrue(metadata.containsKey("Cache-Control"));
|
||||
assertEquals("public, max-age=0", metadata.get("Cache-Control"));
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package ch.cyberduck.core.azure;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
@@ -29,12 +29,12 @@ public class AzureMoveFeatureTest extends AbstractAzureTest {
|
||||
final Path test = new AzureTouchFeature(session).touch(new AzureWriteFeature(session), new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
|
||||
final PathAttributes sourceAttr = new AzureAttributesFinderFeature(session).find(test);
|
||||
assertTrue(new AzureFindFeature(session).find(test));
|
||||
final Path target = new AzureMoveFeature(session).move(test, new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
|
||||
final Path target = new AzureMoveFeature(session).move(test, new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(), new Delete.DisabledCallback(), ConnectionCallback.noop);
|
||||
assertFalse(new AzureFindFeature(session).find(test));
|
||||
assertTrue(new AzureFindFeature(session).find(target));
|
||||
final PathAttributes targetAttr = new AzureAttributesFinderFeature(session).find(target);
|
||||
assertEquals(Comparison.equal, session.getHost().getProtocol().getFeature(ComparisonService.class).compare(Path.Type.file, sourceAttr, targetAttr));
|
||||
new AzureDeleteFeature(session).delete(Collections.<Path>singletonList(target), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.<Path>singletonList(target), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -3,8 +3,8 @@ package ch.cyberduck.core.azure;
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.AttributedList;
|
||||
import ch.cyberduck.core.DisabledListProgressListener;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.IndexedListProgressListener;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.exception.NotfoundException;
|
||||
@@ -46,7 +46,7 @@ public class AzureObjectListServiceTest extends AbstractAzureTest {
|
||||
}
|
||||
}).isEmpty());
|
||||
assertTrue(callback.get());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(folder), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(folder), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test(expected = NotfoundException.class)
|
||||
@@ -69,7 +69,7 @@ public class AzureObjectListServiceTest extends AbstractAzureTest {
|
||||
final PathAttributes attributes = list.get(0).attributes();
|
||||
assertEquals(attributes, new AzureAttributesFinderFeature(session).find(file));
|
||||
assertSame(directory, list.get(0).getParent());
|
||||
new AzureDeleteFeature(session).delete(Arrays.asList(file, directory), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Arrays.asList(file, directory), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -98,8 +98,8 @@ public class AzureObjectListServiceTest extends AbstractAzureTest {
|
||||
});
|
||||
for(int i = 0; i < list.size(); i++) {
|
||||
assertEquals(files.get(i), list.get(i).getName());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(list.get(i)), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(list.get(i)), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(directory), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(directory), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package ch.cyberduck.core.azure;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.exception.NotfoundException;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
@@ -33,7 +33,7 @@ public class AzureReadFeatureTest extends AbstractAzureTest {
|
||||
public void testReadNotFound() throws Exception {
|
||||
final TransferStatus status = new TransferStatus();
|
||||
final Path container = new Path("cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
|
||||
new AzureReadFeature(session).read(new Path(container, "nosuchname", EnumSet.of(Path.Type.file)), status, new DisabledConnectionCallback());
|
||||
new AzureReadFeature(session).read(new Path(container, "nosuchname", EnumSet.of(Path.Type.file)), status, ConnectionCallback.noop);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -41,10 +41,10 @@ public class AzureReadFeatureTest extends AbstractAzureTest {
|
||||
final Path container = new Path("cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
|
||||
final Path test = new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
new AzureTouchFeature(session).touch(new AzureWriteFeature(session), test, new TransferStatus());
|
||||
final InputStream in = new AzureReadFeature(session).read(test, new TransferStatus().setLength(0L), new DisabledConnectionCallback());
|
||||
final InputStream in = new AzureReadFeature(session).read(test, new TransferStatus().setLength(0L), ConnectionCallback.noop);
|
||||
assertNotNull(in);
|
||||
in.close();
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -53,14 +53,14 @@ public class AzureReadFeatureTest extends AbstractAzureTest {
|
||||
final Path test = new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
new AzureTouchFeature(session).touch(new AzureWriteFeature(session), test, new TransferStatus());
|
||||
final byte[] content = RandomUtils.nextBytes(1023);
|
||||
final OutputStream out = new AzureWriteFeature(session).write(test, new TransferStatus().setExists(true).setLength(content.length), new DisabledConnectionCallback());
|
||||
final OutputStream out = new AzureWriteFeature(session).write(test, new TransferStatus().setExists(true).setLength(content.length), ConnectionCallback.noop);
|
||||
assertNotNull(out);
|
||||
new StreamCopier(StreamCancelation.noop, StreamProgress.noop).transfer(new ByteArrayInputStream(content), out);
|
||||
final TransferStatus status = new TransferStatus();
|
||||
status.setLength(content.length);
|
||||
status.setAppend(true);
|
||||
status.setOffset(100L);
|
||||
final InputStream in = new AzureReadFeature(session).read(test, status, new DisabledConnectionCallback());
|
||||
final InputStream in = new AzureReadFeature(session).read(test, status, ConnectionCallback.noop);
|
||||
assertNotNull(in);
|
||||
final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length - 100);
|
||||
new StreamCopier(status, status).transfer(in, buffer);
|
||||
@@ -70,6 +70,6 @@ public class AzureReadFeatureTest extends AbstractAzureTest {
|
||||
in.close();
|
||||
// Test double close
|
||||
in.close();
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
package ch.cyberduck.core.azure;
|
||||
|
||||
import ch.cyberduck.core.Credentials;
|
||||
import ch.cyberduck.core.DisabledCancelCallback;
|
||||
import ch.cyberduck.core.DisabledHostKeyCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordStore;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.Host;
|
||||
import ch.cyberduck.core.HostKeyCallback;
|
||||
import ch.cyberduck.core.LoginConnectionService;
|
||||
import ch.cyberduck.core.LoginOptions;
|
||||
import ch.cyberduck.core.Profile;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.ProtocolFactory;
|
||||
import ch.cyberduck.core.exception.LoginCanceledException;
|
||||
import ch.cyberduck.core.features.AclPermission;
|
||||
@@ -19,6 +18,7 @@ import ch.cyberduck.core.features.Touch;
|
||||
import ch.cyberduck.core.serializer.impl.dd.ProfilePlistReader;
|
||||
import ch.cyberduck.core.ssl.DefaultX509KeyManager;
|
||||
import ch.cyberduck.core.ssl.DisabledX509TrustManager;
|
||||
import ch.cyberduck.core.threading.CancelCallback;
|
||||
import ch.cyberduck.test.IntegrationTest;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -62,9 +62,9 @@ public class AzureSessionTest extends AbstractAzureTest {
|
||||
fail(reason);
|
||||
return null;
|
||||
}
|
||||
}, new DisabledHostKeyCallback(),
|
||||
new DisabledPasswordStore(), new DisabledProgressListener());
|
||||
login.connect(session, new DisabledCancelCallback());
|
||||
}, HostKeyCallback.noop,
|
||||
new DisabledPasswordStore(), ProgressListener.noop);
|
||||
login.connect(session, CancelCallback.noop);
|
||||
session.close();
|
||||
}
|
||||
|
||||
@@ -90,9 +90,9 @@ public class AzureSessionTest extends AbstractAzureTest {
|
||||
prompt.set(true);
|
||||
}
|
||||
}
|
||||
}, new DisabledHostKeyCallback(),
|
||||
new DisabledPasswordStore(), new DisabledProgressListener());
|
||||
connect.connect(session, new DisabledCancelCallback());
|
||||
}, HostKeyCallback.noop,
|
||||
new DisabledPasswordStore(), ProgressListener.noop);
|
||||
connect.connect(session, CancelCallback.noop);
|
||||
assertTrue(session.isConnected());
|
||||
connect.close(session);
|
||||
assertFalse(session.isConnected());
|
||||
@@ -110,8 +110,8 @@ public class AzureSessionTest extends AbstractAzureTest {
|
||||
assertEquals("Login kahy9boj3eib.blob.core.windows.net", title);
|
||||
return super.prompt(bookmark, username, title, reason, options);
|
||||
}
|
||||
}, new DisabledHostKeyCallback(),
|
||||
new DisabledPasswordStore(), new DisabledProgressListener()).connect(session, new DisabledCancelCallback());
|
||||
}, HostKeyCallback.noop,
|
||||
new DisabledPasswordStore(), ProgressListener.noop).connect(session, CancelCallback.noop);
|
||||
}
|
||||
|
||||
@Test(expected = LoginCanceledException.class)
|
||||
@@ -126,7 +126,7 @@ public class AzureSessionTest extends AbstractAzureTest {
|
||||
assertEquals("Login kahy9boj3eib.blob.core.windows.net", title);
|
||||
return super.prompt(bookmark, username, title, reason, options);
|
||||
}
|
||||
}, new DisabledHostKeyCallback(),
|
||||
new DisabledPasswordStore(), new DisabledProgressListener()).connect(session, new DisabledCancelCallback());
|
||||
}, HostKeyCallback.noop,
|
||||
new DisabledPasswordStore(), ProgressListener.noop).connect(session, CancelCallback.noop);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ package ch.cyberduck.core.azure;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.AsciiRandomStringService;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.transfer.TransferStatus;
|
||||
@@ -37,7 +37,7 @@ public class AzureTouchFeatureTest extends AbstractAzureTest {
|
||||
final Path container = new Path("cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
|
||||
final Path test = new Path(container, String.format(".%s.", new AlphanumericRandomStringService().random()), EnumSet.of(Path.Type.file));
|
||||
new AzureTouchFeature(session).touch(new AzureWriteFeature(session), test, new TransferStatus());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -3,7 +3,7 @@ package ch.cyberduck.core.azure;
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DescriptiveUrl;
|
||||
import ch.cyberduck.core.DescriptiveUrlBag;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.transfer.TransferStatus;
|
||||
@@ -31,6 +31,6 @@ public class AzureUrlProviderTest extends AbstractAzureTest {
|
||||
for(DescriptiveUrl url : urls) {
|
||||
assertFalse(url.getUrl().isEmpty());
|
||||
}
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package ch.cyberduck.core.azure;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
@@ -43,7 +43,7 @@ public class AzureWriteFeatureTest extends AbstractAzureTest {
|
||||
status.setMetadata(Collections.singletonMap("Cache-Control", "public,max-age=86400"));
|
||||
final Path container = new Path("cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
|
||||
final Path test = new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
final OutputStream out = new AzureWriteFeature(session, BlobType.APPEND_BLOB).write(test, status, new DisabledConnectionCallback());
|
||||
final OutputStream out = new AzureWriteFeature(session, BlobType.APPEND_BLOB).write(test, status, ConnectionCallback.noop);
|
||||
assertNotNull(out);
|
||||
new StreamCopier(StreamCancelation.noop, StreamProgress.noop).transfer(new ByteArrayInputStream(content), out);
|
||||
assertTrue(new AzureFindFeature(session).find(test));
|
||||
@@ -53,19 +53,19 @@ public class AzureWriteFeatureTest extends AbstractAzureTest {
|
||||
assertEquals("text/plain", metadata.get("Content-Type"));
|
||||
assertEquals("public,max-age=86400", metadata.get("Cache-Control"));
|
||||
final byte[] buffer = new byte[content.length];
|
||||
final InputStream in = new AzureReadFeature(session).read(test, new TransferStatus(), new DisabledConnectionCallback());
|
||||
final InputStream in = new AzureReadFeature(session).read(test, new TransferStatus(), ConnectionCallback.noop);
|
||||
IOUtils.readFully(in, buffer);
|
||||
in.close();
|
||||
assertArrayEquals(content, buffer);
|
||||
final OutputStream overwrite = new AzureWriteFeature(session).write(test, new TransferStatus().setExists(true)
|
||||
.setLength("overwrite".getBytes(StandardCharsets.UTF_8).length).setMetadata(Collections.singletonMap("Content-Type", "text/plain")), new DisabledConnectionCallback());
|
||||
.setLength("overwrite".getBytes(StandardCharsets.UTF_8).length).setMetadata(Collections.singletonMap("Content-Type", "text/plain")), ConnectionCallback.noop);
|
||||
new StreamCopier(StreamCancelation.noop, StreamProgress.noop)
|
||||
.transfer(new ByteArrayInputStream("overwrite".getBytes(StandardCharsets.UTF_8)), overwrite);
|
||||
overwrite.close();
|
||||
// Test double close
|
||||
overwrite.close();
|
||||
assertEquals("overwrite".getBytes(StandardCharsets.UTF_8).length, new AzureAttributesFinderFeature(session).find(test).getSize());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -78,7 +78,7 @@ public class AzureWriteFeatureTest extends AbstractAzureTest {
|
||||
status.setMetadata(Collections.singletonMap("Cache-Control", "public,max-age=86400"));
|
||||
final Path container = new Path("cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
|
||||
final Path test = new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
final OutputStream out = new AzureWriteFeature(session, BlobType.BLOCK_BLOB).write(test, status, new DisabledConnectionCallback());
|
||||
final OutputStream out = new AzureWriteFeature(session, BlobType.BLOCK_BLOB).write(test, status, ConnectionCallback.noop);
|
||||
assertNotNull(out);
|
||||
new StreamCopier(StreamCancelation.noop, StreamProgress.noop).transfer(new ByteArrayInputStream(content), out);
|
||||
assertTrue(new AzureFindFeature(session).find(test));
|
||||
@@ -88,18 +88,18 @@ public class AzureWriteFeatureTest extends AbstractAzureTest {
|
||||
assertEquals("text/plain", metadata.get("Content-Type"));
|
||||
assertEquals("public,max-age=86400", metadata.get("Cache-Control"));
|
||||
final byte[] buffer = new byte[content.length];
|
||||
final InputStream in = new AzureReadFeature(session).read(test, new TransferStatus(), new DisabledConnectionCallback());
|
||||
final InputStream in = new AzureReadFeature(session).read(test, new TransferStatus(), ConnectionCallback.noop);
|
||||
IOUtils.readFully(in, buffer);
|
||||
in.close();
|
||||
assertArrayEquals(content, buffer);
|
||||
final OutputStream overwrite = new AzureWriteFeature(session).write(test, new TransferStatus().setExists(true)
|
||||
.setLength("overwrite".getBytes(StandardCharsets.UTF_8).length).setMetadata(Collections.singletonMap("Content-Type", "text/plain")), new DisabledConnectionCallback());
|
||||
.setLength("overwrite".getBytes(StandardCharsets.UTF_8).length).setMetadata(Collections.singletonMap("Content-Type", "text/plain")), ConnectionCallback.noop);
|
||||
new StreamCopier(StreamCancelation.noop, StreamProgress.noop)
|
||||
.transfer(new ByteArrayInputStream("overwrite".getBytes(StandardCharsets.UTF_8)), overwrite);
|
||||
overwrite.close();
|
||||
// Test double close
|
||||
overwrite.close();
|
||||
assertEquals("overwrite".getBytes(StandardCharsets.UTF_8).length, new AzureAttributesFinderFeature(session).find(test).getSize());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ package ch.cyberduck.core.cryptomator;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.azure.AbstractAzureTest;
|
||||
import ch.cyberduck.core.azure.AzureDeleteFeature;
|
||||
@@ -59,7 +59,7 @@ public class AzureDirectoryFeatureTest extends AbstractAzureTest {
|
||||
cryptomator.getFeature(session, Write.class, new AzureWriteFeature(session)), new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
|
||||
assertTrue(test.getType().contains(Path.Type.placeholder));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(test));
|
||||
cryptomator.getFeature(session, Delete.class, new AzureDeleteFeature(session)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new AzureDeleteFeature(session)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -73,6 +73,6 @@ public class AzureDirectoryFeatureTest extends AbstractAzureTest {
|
||||
final Path test = cryptomator.getFeature(session, Directory.class, new AzureDirectoryFeature(session)).mkdir(
|
||||
cryptomator.getFeature(session, Write.class, new AzureWriteFeature(session)), new Path(vault, new AlphanumericRandomStringService(130).random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(test));
|
||||
cryptomator.getFeature(session, Delete.class, new AzureDeleteFeature(session)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new AzureDeleteFeature(session)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ package ch.cyberduck.core.cryptomator;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledListProgressListener;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.azure.AbstractAzureTest;
|
||||
import ch.cyberduck.core.azure.AzureDeleteFeature;
|
||||
@@ -61,6 +61,6 @@ public class AzureListServiceTest extends AbstractAzureTest {
|
||||
new CryptoTouchFeature<>(session, new DefaultTouchFeature<Void>(session), cryptomator).touch(
|
||||
new CryptoWriteFeature<>(session, new AzureWriteFeature(session), cryptomator), test, new TransferStatus());
|
||||
assertEquals(test, new CryptoListService(session, new AzureObjectListService(session), cryptomator).list(vault, new DisabledListProgressListener()).get(0));
|
||||
cryptomator.getFeature(session, Delete.class, new AzureDeleteFeature(session)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new AzureDeleteFeature(session)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ package ch.cyberduck.core.cryptomator;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.azure.AbstractAzureTest;
|
||||
import ch.cyberduck.core.azure.AzureDeleteFeature;
|
||||
@@ -70,17 +70,17 @@ public class AzureMoveFeatureTest extends AbstractAzureTest {
|
||||
final Move move = cryptomator.getFeature(session, Move.class, new AzureMoveFeature(session));
|
||||
// rename file
|
||||
final Path fileRenamed = new Path(folder, "f1", EnumSet.of(Path.Type.file));
|
||||
move.move(file, fileRenamed, new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
|
||||
move.move(file, fileRenamed, new TransferStatus(), new Delete.DisabledCallback(), ConnectionCallback.noop);
|
||||
assertFalse(cryptomator.getFeature(session, Find.class, new AzureFindFeature(session)).find(file));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new AzureFindFeature(session)).find(fileRenamed));
|
||||
// rename folder
|
||||
final Path folderRenamed = new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.placeholder));
|
||||
move.move(folder, folderRenamed, new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
|
||||
move.move(folder, folderRenamed, new TransferStatus(), new Delete.DisabledCallback(), ConnectionCallback.noop);
|
||||
assertFalse(cryptomator.getFeature(session, Find.class, new AzureFindFeature(session)).find(folder));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new AzureFindFeature(session)).find(folderRenamed));
|
||||
final Path fileRenamedInRenamedFolder = new Path(folderRenamed, "f1", EnumSet.of(Path.Type.file));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new AzureFindFeature(session)).find(fileRenamedInRenamedFolder));
|
||||
cryptomator.getFeature(session, Delete.class, new AzureDeleteFeature(session)).delete(Arrays.asList(
|
||||
fileRenamedInRenamedFolder, folderRenamed, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
fileRenamedInRenamedFolder, folderRenamed, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ package ch.cyberduck.core.cryptomator;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.azure.AbstractAzureTest;
|
||||
import ch.cyberduck.core.azure.AzureDeleteFeature;
|
||||
@@ -64,7 +64,7 @@ public class AzureTouchFeatureTest extends AbstractAzureTest {
|
||||
assertEquals(TransferStatus.UNKNOWN_LENGTH, test.attributes().getSize());
|
||||
assertEquals(TransferStatus.UNKNOWN_LENGTH, status.getResponse().getSize());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new AzureFindFeature(session)).find(test));
|
||||
cryptomator.getFeature(session, Delete.class, new AzureDeleteFeature(session)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new AzureDeleteFeature(session)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -81,6 +81,6 @@ public class AzureTouchFeatureTest extends AbstractAzureTest {
|
||||
assertEquals(TransferStatus.UNKNOWN_LENGTH, test.attributes().getSize());
|
||||
assertEquals(TransferStatus.UNKNOWN_LENGTH, status.getResponse().getSize());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(test));
|
||||
cryptomator.getFeature(session, Delete.class, new AzureDeleteFeature(session)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new AzureDeleteFeature(session)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,10 +16,10 @@ package ch.cyberduck.core.cryptomator;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledListProgressListener;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.azure.AbstractAzureTest;
|
||||
@@ -76,7 +76,7 @@ public class AzureWriteFeatureTest extends AbstractAzureTest {
|
||||
status.setNonces(new RotatingNonceGenerator(cryptomator.getNonceSize(), cryptomator.numberOfChunks(content.length)));
|
||||
final Path test = new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
status.setChecksum(writer.checksum(test, status).compute(new ByteArrayInputStream(content), status));
|
||||
final OutputStream out = writer.write(test, status, new DisabledConnectionCallback());
|
||||
final OutputStream out = writer.write(test, status, ConnectionCallback.noop);
|
||||
assertNotNull(out);
|
||||
new StreamCopier(status, status).transfer(new ByteArrayInputStream(content), out);
|
||||
out.close();
|
||||
@@ -84,9 +84,9 @@ public class AzureWriteFeatureTest extends AbstractAzureTest {
|
||||
final PathAttributes attributes = new CryptoListService(session, new AzureListService(session), cryptomator).list(test.getParent(), new DisabledListProgressListener()).get(test).attributes();
|
||||
assertEquals(content.length, attributes.getSize());
|
||||
final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
|
||||
final InputStream in = new CryptoReadFeature(session, new AzureReadFeature(session), cryptomator).read(test, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream in = new CryptoReadFeature(session, new AzureReadFeature(session), cryptomator).read(test, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
new StreamCopier(status, status).transfer(in, buffer);
|
||||
assertArrayEquals(content, buffer.toByteArray());
|
||||
cryptomator.getFeature(session, Delete.class, new AzureDeleteFeature(session)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new AzureDeleteFeature(session)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,12 +16,12 @@ package ch.cyberduck.core.cryptomator;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathCache;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.azure.AbstractAzureTest;
|
||||
import ch.cyberduck.core.azure.AzureDirectoryFeature;
|
||||
import ch.cyberduck.core.azure.AzureFindFeature;
|
||||
@@ -82,17 +82,17 @@ public class CopyWorkerTest extends AbstractAzureTest {
|
||||
session.withRegistry(registry);
|
||||
final byte[] content = RandomUtils.nextBytes(40500);
|
||||
final TransferStatus status = new TransferStatus();
|
||||
new CryptoBulkFeature<>(session, new DisabledBulkFeature(), cryptomator).pre(Transfer.Type.upload, Collections.singletonMap(new TransferItem(source), status), new DisabledConnectionCallback());
|
||||
new StreamCopier(StreamCancelation.noop, StreamProgress.noop).transfer(new ByteArrayInputStream(content), new CryptoWriteFeature<>(session, new AzureWriteFeature(session), cryptomator).write(source, status.setLength(content.length), new DisabledConnectionCallback()));
|
||||
new CryptoBulkFeature<>(session, new DisabledBulkFeature(), cryptomator).pre(Transfer.Type.upload, Collections.singletonMap(new TransferItem(source), status), ConnectionCallback.noop);
|
||||
new StreamCopier(StreamCancelation.noop, StreamProgress.noop).transfer(new ByteArrayInputStream(content), new CryptoWriteFeature<>(session, new AzureWriteFeature(session), cryptomator).write(source, status.setLength(content.length), ConnectionCallback.noop));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(source));
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(source, target), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback());
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(source, target), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new AzureFindFeature(session)).find(source));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new AzureFindFeature(session)).find(target));
|
||||
final ByteArrayOutputStream out = new ByteArrayOutputStream(content.length);
|
||||
assertEquals(content.length, IOUtils.copy(new CryptoReadFeature(session, new AzureReadFeature(session), cryptomator).read(target, new TransferStatus().setLength(content.length), new DisabledConnectionCallback()), out));
|
||||
assertEquals(content.length, IOUtils.copy(new CryptoReadFeature(session, new AzureReadFeature(session), cryptomator).read(target, new TransferStatus().setLength(content.length), ConnectionCallback.noop), out));
|
||||
assertArrayEquals(content, out.toByteArray());
|
||||
new DeleteWorker(new DisabledLoginCallback(), Collections.singletonList(vault), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Collections.singletonList(vault), ProgressListener.noop).run(session);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -112,12 +112,12 @@ public class CopyWorkerTest extends AbstractAzureTest {
|
||||
cryptomator.getFeature(session, Directory.class, new AzureDirectoryFeature(session)).mkdir(
|
||||
cryptomator.getFeature(session, Write.class, new AzureWriteFeature(session)), targetFolder, new TransferStatus());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(targetFolder));
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(source, target), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback());
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(source, target), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(source));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(target));
|
||||
registry.clear();
|
||||
new DeleteWorker(new DisabledLoginCallback(), Collections.singletonList(vault), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Collections.singletonList(vault), ProgressListener.noop).run(session);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -136,12 +136,12 @@ public class CopyWorkerTest extends AbstractAzureTest {
|
||||
cryptomator.getFeature(session, Directory.class, new AzureDirectoryFeature(session)).mkdir(
|
||||
cryptomator.getFeature(session, Write.class, new AzureWriteFeature(session)), targetFolder, new TransferStatus());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(targetFolder));
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(source, target), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback());
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(source, target), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(source));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(target));
|
||||
registry.clear();
|
||||
new DeleteWorker(new DisabledLoginCallback(), Collections.singletonList(vault), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Collections.singletonList(vault), ProgressListener.noop).run(session);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -161,18 +161,18 @@ public class CopyWorkerTest extends AbstractAzureTest {
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(file));
|
||||
// copy file
|
||||
final Path fileRenamed = new Path(folder, "f1", EnumSet.of(Path.Type.file));
|
||||
new CopyWorker(Collections.singletonMap(file, fileRenamed), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback()).run(session);
|
||||
new CopyWorker(Collections.singletonMap(file, fileRenamed), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop).run(session);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new AzureFindFeature(session)).find(file));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new AzureFindFeature(session)).find(fileRenamed));
|
||||
// copy folder
|
||||
final Path folderRenamed = new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
|
||||
new CopyWorker(Collections.singletonMap(folder, folderRenamed), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback()).run(session);
|
||||
new CopyWorker(Collections.singletonMap(folder, folderRenamed), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop).run(session);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new AzureFindFeature(session)).find(folder));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new AzureFindFeature(session)).find(folderRenamed));
|
||||
final Path fileRenamedInRenamedFolder = new Path(folderRenamed, "f1", EnumSet.of(Path.Type.file));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(fileRenamedInRenamedFolder));
|
||||
registry.clear();
|
||||
new DeleteWorker(new DisabledLoginCallback(), Collections.singletonList(vault), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Collections.singletonList(vault), ProgressListener.noop).run(session);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -181,7 +181,7 @@ public class CopyWorkerTest extends AbstractAzureTest {
|
||||
final Path vault = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
|
||||
final Path cleartextFile = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
final byte[] content = RandomUtils.nextBytes(40500);
|
||||
new StreamCopier(StreamCancelation.noop, StreamProgress.noop).transfer(new ByteArrayInputStream(content), new AzureWriteFeature(session).write(cleartextFile, new TransferStatus().setLength(content.length), new DisabledConnectionCallback()));
|
||||
new StreamCopier(StreamCancelation.noop, StreamProgress.noop).transfer(new ByteArrayInputStream(content), new AzureWriteFeature(session).write(cleartextFile, new TransferStatus().setLength(content.length), ConnectionCallback.noop));
|
||||
assertTrue(new AzureFindFeature(session).find(cleartextFile));
|
||||
final Path encryptedFolder = new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
|
||||
final Path encryptedFile = new Path(encryptedFolder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
@@ -193,15 +193,15 @@ public class CopyWorkerTest extends AbstractAzureTest {
|
||||
cryptomator.getFeature(session, Write.class, new AzureWriteFeature(session)), encryptedFolder, new TransferStatus());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(encryptedFolder));
|
||||
// copy file into vault
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(cleartextFile, encryptedFile), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback());
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(cleartextFile, encryptedFile), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(new AzureFindFeature(session).find(cleartextFile));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new AzureFindFeature(session)).find(encryptedFile));
|
||||
final ByteArrayOutputStream out = new ByteArrayOutputStream(content.length);
|
||||
assertEquals(content.length, IOUtils.copy(new CryptoReadFeature(session, new AzureReadFeature(session), cryptomator).read(encryptedFile, new TransferStatus().setLength(content.length), new DisabledConnectionCallback()), out));
|
||||
assertEquals(content.length, IOUtils.copy(new CryptoReadFeature(session, new AzureReadFeature(session), cryptomator).read(encryptedFile, new TransferStatus().setLength(content.length), ConnectionCallback.noop), out));
|
||||
assertArrayEquals(content, out.toByteArray());
|
||||
registry.clear();
|
||||
new DeleteWorker(new DisabledLoginCallback(), Collections.singletonList(vault), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Collections.singletonList(vault), ProgressListener.noop).run(session);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -221,14 +221,14 @@ public class CopyWorkerTest extends AbstractAzureTest {
|
||||
// move directory into vault
|
||||
final Path encryptedFolder = new Path(vault, cleartextFolder.getName(), EnumSet.of(Path.Type.directory));
|
||||
final Path encryptedFile = new Path(encryptedFolder, cleartextFile.getName(), EnumSet.of(Path.Type.file));
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(cleartextFolder, encryptedFolder), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback());
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(cleartextFolder, encryptedFolder), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(encryptedFolder));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(encryptedFile));
|
||||
assertTrue(new AzureFindFeature(session).find(cleartextFolder));
|
||||
assertTrue(new AzureFindFeature(session).find(cleartextFile));
|
||||
registry.clear();
|
||||
new DeleteWorker(new DisabledLoginCallback(), Collections.singletonList(vault), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Collections.singletonList(vault), ProgressListener.noop).run(session);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -251,12 +251,12 @@ public class CopyWorkerTest extends AbstractAzureTest {
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(encryptedFile));
|
||||
// move file outside vault
|
||||
final Path cleartextFile = new Path(clearFolder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(encryptedFile, cleartextFile), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback());
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(encryptedFile, cleartextFile), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new AzureFindFeature(session)).find(encryptedFile));
|
||||
assertTrue(new AzureFindFeature(session).find(cleartextFile));
|
||||
registry.clear();
|
||||
new DeleteWorker(new DisabledLoginCallback(), Arrays.asList(vault, clearFolder), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Arrays.asList(vault, clearFolder), ProgressListener.noop).run(session);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -277,7 +277,7 @@ public class CopyWorkerTest extends AbstractAzureTest {
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(encryptedFile));
|
||||
// copy directory outside vault
|
||||
final Path cleartextFolder = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(encryptedFolder, cleartextFolder), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback());
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(encryptedFolder, cleartextFolder), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new AzureFindFeature(session)).find(encryptedFolder));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new AzureFindFeature(session)).find(encryptedFile));
|
||||
@@ -285,6 +285,6 @@ public class CopyWorkerTest extends AbstractAzureTest {
|
||||
final Path fileRenamed = new Path(cleartextFolder, encryptedFile.getName(), EnumSet.of(Path.Type.file));
|
||||
assertTrue(new AzureFindFeature(session).find(fileRenamed));
|
||||
registry.clear();
|
||||
new DeleteWorker(new DisabledLoginCallback(), Arrays.asList(cleartextFolder, vault), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Arrays.asList(cleartextFolder, vault), ProgressListener.noop).run(session);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-8
@@ -16,14 +16,14 @@ package ch.cyberduck.core.cryptomator;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.Host;
|
||||
import ch.cyberduck.core.Local;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.NullFilter;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.TestProtocol;
|
||||
import ch.cyberduck.core.azure.AbstractAzureTest;
|
||||
import ch.cyberduck.core.azure.AzureAttributesFinderFeature;
|
||||
@@ -34,9 +34,9 @@ import ch.cyberduck.core.cryptomator.features.CryptoReadFeature;
|
||||
import ch.cyberduck.core.features.AttributesFinder;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.features.Find;
|
||||
import ch.cyberduck.core.io.DisabledStreamListener;
|
||||
import ch.cyberduck.core.io.StreamCancelation;
|
||||
import ch.cyberduck.core.io.StreamCopier;
|
||||
import ch.cyberduck.core.io.StreamListener;
|
||||
import ch.cyberduck.core.io.StreamProgress;
|
||||
import ch.cyberduck.core.local.DefaultLocalDirectoryFeature;
|
||||
import ch.cyberduck.core.notification.DisabledNotificationService;
|
||||
@@ -100,23 +100,23 @@ public class CryptoAzureSingleTransferWorkerTest extends AbstractAzureTest {
|
||||
public TransferAction prompt(final TransferItem file) {
|
||||
return TransferAction.overwrite;
|
||||
}
|
||||
}, new DisabledTransferErrorCallback(), new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledNotificationService()).run(session));
|
||||
}, new DisabledTransferErrorCallback(), ProgressListener.noop, StreamListener.noop, LoginCallback.noop, new DisabledNotificationService()).run(session));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new AzureFindFeature(session)).find(dir1));
|
||||
assertEquals(content.length, cryptomator.getFeature(session, AttributesFinder.class, new AzureAttributesFinderFeature(session)).find(file1).getSize());
|
||||
{
|
||||
final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
|
||||
final InputStream in = new CryptoReadFeature(session, new AzureReadFeature(session), cryptomator).read(file1, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream in = new CryptoReadFeature(session, new AzureReadFeature(session), cryptomator).read(file1, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
new StreamCopier(StreamCancelation.noop, StreamProgress.noop).transfer(in, buffer);
|
||||
assertArrayEquals(content, buffer.toByteArray());
|
||||
}
|
||||
assertEquals(content.length, cryptomator.getFeature(session, AttributesFinder.class, new AzureAttributesFinderFeature(session)).find(file2).getSize());
|
||||
{
|
||||
final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
|
||||
final InputStream in = new CryptoReadFeature(session, new AzureReadFeature(session), cryptomator).read(file1, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream in = new CryptoReadFeature(session, new AzureReadFeature(session), cryptomator).read(file1, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
new StreamCopier(StreamCancelation.noop, StreamProgress.noop).transfer(in, buffer);
|
||||
assertArrayEquals(content, buffer.toByteArray());
|
||||
}
|
||||
cryptomator.getFeature(session, Delete.class, new AzureDeleteFeature(session)).delete(Arrays.asList(file1, file2, dir1, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new AzureDeleteFeature(session)).delete(Arrays.asList(file1, file2, dir1, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
localFile1.delete();
|
||||
localFile2.delete();
|
||||
localDirectory1.delete();
|
||||
|
||||
@@ -16,22 +16,22 @@ package ch.cyberduck.core.worker;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.Host;
|
||||
import ch.cyberduck.core.Local;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.NullFilter;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.TestProtocol;
|
||||
import ch.cyberduck.core.azure.AbstractAzureTest;
|
||||
import ch.cyberduck.core.azure.AzureDeleteFeature;
|
||||
import ch.cyberduck.core.azure.AzureWriteFeature;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.io.DisabledStreamListener;
|
||||
import ch.cyberduck.core.io.SHA256ChecksumCompute;
|
||||
import ch.cyberduck.core.io.StatusOutputStream;
|
||||
import ch.cyberduck.core.io.StreamCopier;
|
||||
import ch.cyberduck.core.io.StreamListener;
|
||||
import ch.cyberduck.core.local.TemporaryFileServiceFactory;
|
||||
import ch.cyberduck.core.notification.DisabledNotificationService;
|
||||
import ch.cyberduck.core.transfer.DisabledTransferErrorCallback;
|
||||
@@ -67,13 +67,13 @@ public class AzureSingleTransferWorkerTest extends AbstractAzureTest {
|
||||
{
|
||||
final byte[] content = RandomUtils.nextBytes(39864);
|
||||
final TransferStatus writeStatus = new TransferStatus().setLength(content.length).setChecksum(new SHA256ChecksumCompute().compute(new ByteArrayInputStream(content), new TransferStatus()));
|
||||
final StatusOutputStream out = new AzureWriteFeature(session).write(test, writeStatus, new DisabledConnectionCallback());
|
||||
final StatusOutputStream out = new AzureWriteFeature(session).write(test, writeStatus, ConnectionCallback.noop);
|
||||
assertNotNull(out);
|
||||
new StreamCopier(writeStatus, writeStatus).withLimit((long) content.length).transfer(new ByteArrayInputStream(content), out);
|
||||
}
|
||||
final byte[] content = RandomUtils.nextBytes(39864);
|
||||
final TransferStatus writeStatus = new TransferStatus().setExists(true).setLength(content.length).setChecksum(new SHA256ChecksumCompute().compute(new ByteArrayInputStream(content), new TransferStatus()));
|
||||
final StatusOutputStream<Void> out = new AzureWriteFeature(session).write(test, writeStatus, new DisabledConnectionCallback());
|
||||
final StatusOutputStream<Void> out = new AzureWriteFeature(session).write(test, writeStatus, ConnectionCallback.noop);
|
||||
assertNotNull(out);
|
||||
new StreamCopier(writeStatus, writeStatus).withLimit((long) content.length).transfer(new ByteArrayInputStream(content), out);
|
||||
out.close();
|
||||
@@ -84,9 +84,9 @@ public class AzureSingleTransferWorkerTest extends AbstractAzureTest {
|
||||
return TransferAction.overwrite;
|
||||
}
|
||||
}, new DisabledTransferErrorCallback(),
|
||||
new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledNotificationService()).run(session));
|
||||
ProgressListener.noop, StreamListener.noop, LoginCallback.noop, new DisabledNotificationService()).run(session));
|
||||
assertArrayEquals(content, IOUtils.toByteArray(localFile.getInputStream()));
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new AzureDeleteFeature(session).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
localFile.delete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@ package ch.cyberduck.core.worker;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathCache;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.azure.AbstractAzureTest;
|
||||
import ch.cyberduck.core.azure.AzureDirectoryFeature;
|
||||
import ch.cyberduck.core.azure.AzureFindFeature;
|
||||
@@ -49,11 +49,11 @@ public class CopyWorkerTest extends AbstractAzureTest {
|
||||
final Path target = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
new AzureTouchFeature(session).touch(new AzureWriteFeature(session), source, new TransferStatus());
|
||||
assertTrue(new AzureFindFeature(session).find(source));
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(source, target), new SessionPool.SingleSessionPool(session), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback());
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(source, target), new SessionPool.SingleSessionPool(session), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(new AzureFindFeature(session).find(source));
|
||||
assertTrue(new AzureFindFeature(session).find(target));
|
||||
new DeleteWorker(new DisabledLoginCallback(), Arrays.asList(source, target), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Arrays.asList(source, target), ProgressListener.noop).run(session);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -67,11 +67,11 @@ public class CopyWorkerTest extends AbstractAzureTest {
|
||||
new AzureDirectoryFeature(session).mkdir(new AzureWriteFeature(session), targetFolder, new TransferStatus());
|
||||
assertTrue(new AzureFindFeature(session).find(targetFolder));
|
||||
// copy file into vault
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(sourceFile, targetFile), new SessionPool.SingleSessionPool(session), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback());
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(sourceFile, targetFile), new SessionPool.SingleSessionPool(session), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(new AzureFindFeature(session).find(sourceFile));
|
||||
assertTrue(new AzureFindFeature(session).find(targetFile));
|
||||
new DeleteWorker(new DisabledLoginCallback(), Arrays.asList(sourceFile, targetFolder), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Arrays.asList(sourceFile, targetFolder), ProgressListener.noop).run(session);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -86,12 +86,12 @@ public class CopyWorkerTest extends AbstractAzureTest {
|
||||
// move directory into vault
|
||||
final Path targetFolder = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
|
||||
final Path targetFile = new Path(targetFolder, sourceFile.getName(), EnumSet.of(Path.Type.file));
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(folder, targetFolder), new SessionPool.SingleSessionPool(session), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback());
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(folder, targetFolder), new SessionPool.SingleSessionPool(session), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(new AzureFindFeature(session).find(targetFolder));
|
||||
assertTrue(new AzureFindFeature(session).find(targetFile));
|
||||
assertTrue(new AzureFindFeature(session).find(folder));
|
||||
assertTrue(new AzureFindFeature(session).find(sourceFile));
|
||||
new DeleteWorker(new DisabledLoginCallback(), Arrays.asList(folder, targetFolder), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Arrays.asList(folder, targetFolder), ProgressListener.noop).run(session);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
<parent>
|
||||
<artifactId>parent</artifactId>
|
||||
<groupId>ch.cyberduck</groupId>
|
||||
<version>9.4.0-SNAPSHOT</version>
|
||||
<version>9.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>backblaze</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
@@ -24,7 +24,7 @@ import ch.cyberduck.core.exception.UnsupportedException;
|
||||
import ch.cyberduck.core.features.Copy;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.features.Move;
|
||||
import ch.cyberduck.core.io.DisabledStreamListener;
|
||||
import ch.cyberduck.core.io.StreamListener;
|
||||
import ch.cyberduck.core.transfer.TransferStatus;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
@@ -49,7 +49,7 @@ public class B2MoveFeature implements Move {
|
||||
|
||||
@Override
|
||||
public Path move(final Path source, final Path target, final TransferStatus status, final Delete.Callback delete, final ConnectionCallback callback) throws BackgroundException {
|
||||
final Path copy = proxy.copy(source, target, status, callback, new DisabledStreamListener());
|
||||
final Path copy = proxy.copy(source, target, status, callback, StreamListener.noop);
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(new Path(source)), callback, delete);
|
||||
return copy;
|
||||
}
|
||||
|
||||
@@ -16,15 +16,15 @@ package ch.cyberduck.core.b2;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AttributedList;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ListProgressListener;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.NullFilter;
|
||||
import ch.cyberduck.core.PasswordCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.VersioningConfiguration;
|
||||
import ch.cyberduck.core.exception.BackgroundException;
|
||||
import ch.cyberduck.core.features.Versioning;
|
||||
import ch.cyberduck.core.io.DisabledStreamListener;
|
||||
import ch.cyberduck.core.io.StreamListener;
|
||||
import ch.cyberduck.core.lifecycle.LifecycleConfiguration;
|
||||
import ch.cyberduck.core.transfer.TransferStatus;
|
||||
|
||||
@@ -61,7 +61,7 @@ public class B2VersioningFeature implements Versioning {
|
||||
|
||||
@Override
|
||||
public void revert(final Path file) throws BackgroundException {
|
||||
new B2CopyFeature(session, fileid).copy(file, file, new TransferStatus(), new DisabledLoginCallback(), new DisabledStreamListener());
|
||||
new B2CopyFeature(session, fileid).copy(file, file, new TransferStatus(), LoginCallback.noop, StreamListener.noop);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -61,7 +61,7 @@ public class B2WriteFeature extends AbstractHttpWriteFeature<BaseB2Response> imp
|
||||
= new ThreadLocal<>();
|
||||
|
||||
public B2WriteFeature(final B2Session session, final B2VersionIdProvider fileid) {
|
||||
super(new B2AttributesFinderFeature(session, fileid));
|
||||
super(session.getHost(), new B2AttributesFinderFeature(session, fileid));
|
||||
this.session = session;
|
||||
this.fileid = fileid;
|
||||
}
|
||||
|
||||
@@ -16,19 +16,19 @@ package ch.cyberduck.core.b2;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.Credentials;
|
||||
import ch.cyberduck.core.DisabledCancelCallback;
|
||||
import ch.cyberduck.core.DisabledHostKeyCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.Host;
|
||||
import ch.cyberduck.core.HostKeyCallback;
|
||||
import ch.cyberduck.core.LoginConnectionService;
|
||||
import ch.cyberduck.core.LoginOptions;
|
||||
import ch.cyberduck.core.Profile;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.ProtocolFactory;
|
||||
import ch.cyberduck.core.cryptomator.CryptoVault;
|
||||
import ch.cyberduck.core.serializer.impl.dd.ProfilePlistReader;
|
||||
import ch.cyberduck.core.ssl.DefaultX509KeyManager;
|
||||
import ch.cyberduck.core.ssl.DefaultX509TrustManager;
|
||||
import ch.cyberduck.core.threading.CancelCallback;
|
||||
import ch.cyberduck.test.VaultTest;
|
||||
|
||||
import org.junit.After;
|
||||
@@ -71,8 +71,8 @@ public class AbstractB2Test extends VaultTest {
|
||||
fail(reason);
|
||||
return null;
|
||||
}
|
||||
}, new DisabledHostKeyCallback(),
|
||||
new TestPasswordStore(), new DisabledProgressListener());
|
||||
login.check(session, new DisabledCancelCallback());
|
||||
}, HostKeyCallback.noop,
|
||||
new TestPasswordStore(), ProgressListener.noop);
|
||||
login.check(session, CancelCallback.noop);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ package ch.cyberduck.core.b2;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledListProgressListener;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.SimplePathPredicate;
|
||||
@@ -63,7 +63,7 @@ public class B2AttributesFinderFeatureTest extends AbstractB2Test {
|
||||
assertNotNull(attributes.getVersionId());
|
||||
assertNull(attributes.getFileId());
|
||||
assertNotEquals(Checksum.NONE, attributes.getChecksum());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -76,7 +76,7 @@ public class B2AttributesFinderFeatureTest extends AbstractB2Test {
|
||||
final Path test = new B2TouchFeature(session, fileid).touch(new B2WriteFeature(session, fileid), new Path(directory, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), status);
|
||||
assertNotNull(status.getResponse().getVersionId());
|
||||
assertNotNull(test.attributes().getVersionId());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(new Path(test).withAttributes(PathAttributes.EMPTY)), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(new Path(test).withAttributes(PathAttributes.EMPTY)), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
final B2AttributesFinderFeature f = new B2AttributesFinderFeature(session, fileid);
|
||||
assertEquals(test.attributes(), f.find(test));
|
||||
try {
|
||||
@@ -86,8 +86,8 @@ public class B2AttributesFinderFeatureTest extends AbstractB2Test {
|
||||
catch(NotfoundException e) {
|
||||
// Expected
|
||||
}
|
||||
new B2DeleteFeature(session, fileid).delete(new B2ObjectListService(session, fileid).list(directory, new DisabledListProgressListener()).toList(), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(directory), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(new B2ObjectListService(session, fileid).list(directory, new DisabledListProgressListener()).toList(), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(directory), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -107,7 +107,7 @@ public class B2AttributesFinderFeatureTest extends AbstractB2Test {
|
||||
catch(NotfoundException e) {
|
||||
// Expected
|
||||
}
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(directory), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(directory), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -119,7 +119,7 @@ public class B2AttributesFinderFeatureTest extends AbstractB2Test {
|
||||
assertNotNull(attributes);
|
||||
assertNotEquals(PathAttributes.EMPTY, attributes);
|
||||
assertEquals(bucket.attributes().getVersionId(), attributes.getVersionId());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -133,11 +133,11 @@ public class B2AttributesFinderFeatureTest extends AbstractB2Test {
|
||||
final PathAttributes attributes = new B2AttributesFinderFeature(session, fileid).find(file);
|
||||
assertNotSame(PathAttributes.EMPTY, attributes);
|
||||
assertEquals(0L, attributes.getSize());
|
||||
new B2ReadFeature(session, fileid).read(file, new TransferStatus(), new DisabledConnectionCallback()).close();
|
||||
new B2ReadFeature(session, fileid).read(file, new TransferStatus(), ConnectionCallback.noop).close();
|
||||
final Path found = new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener()).find(
|
||||
new SimplePathPredicate(file));
|
||||
assertTrue(found.getType().contains(Path.Type.upload));
|
||||
new B2ReadFeature(session, fileid).read(found, new TransferStatus(), new DisabledConnectionCallback()).close();
|
||||
new B2ReadFeature(session, fileid).read(found, new TransferStatus(), ConnectionCallback.noop).close();
|
||||
session.getClient().cancelLargeFileUpload(startResponse.getFileId());
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ public class B2AttributesFinderFeatureTest extends AbstractB2Test {
|
||||
fileid.cache(test, invalidId);
|
||||
final B2AttributesFinderFeature f = new B2AttributesFinderFeature(session, fileid);
|
||||
assertEquals(latestnodeid, f.find(test).getVersionId());
|
||||
new B2DeleteFeature(session, fileid).delete(new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener()).toList(), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener()).toList(), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ package ch.cyberduck.core.b2;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DescriptiveUrl;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.features.Share;
|
||||
@@ -47,6 +47,6 @@ public class B2AuthorizedUrlProviderTest extends AbstractB2Test {
|
||||
final DescriptiveUrl url = provider.toDownloadUrl(test, Share.Sharee.world, null, new DisabledPasswordCallback());
|
||||
assertNotEquals(DescriptiveUrl.EMPTY, url);
|
||||
assertNotNull(url.getUrl());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ package ch.cyberduck.core.b2;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.transfer.TransferStatus;
|
||||
@@ -39,7 +39,7 @@ public class B2BucketTypeFeatureTest extends AbstractB2Test {
|
||||
final Path bucket = new B2DirectoryFeature(session, fileid).mkdir(new B2WriteFeature(session, fileid), new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)),
|
||||
new TransferStatus());
|
||||
assertEquals("allPrivate", new B2BucketTypeFeature(session, fileid).getLocation(bucket).getIdentifier());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -48,6 +48,6 @@ public class B2BucketTypeFeatureTest extends AbstractB2Test {
|
||||
final Path bucket = new B2DirectoryFeature(session, fileid).mkdir(new B2WriteFeature(session, fileid), new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)),
|
||||
new TransferStatus().setRegion("allPublic"));
|
||||
assertEquals("allPublic", new B2BucketTypeFeature(session, fileid).getLocation(bucket).getIdentifier());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,13 +16,13 @@ package ch.cyberduck.core.b2;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.exception.UnsupportedException;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.features.Find;
|
||||
import ch.cyberduck.core.io.DisabledStreamListener;
|
||||
import ch.cyberduck.core.io.StreamListener;
|
||||
import ch.cyberduck.core.shared.DefaultFindFeature;
|
||||
import ch.cyberduck.core.transfer.TransferStatus;
|
||||
import ch.cyberduck.test.IntegrationTest;
|
||||
@@ -55,11 +55,11 @@ public class B2CopyFeatureTest extends AbstractB2Test {
|
||||
assertEquals("Unsupported", e.getMessage());
|
||||
assertEquals("Cannot copy test-cyberduck.", e.getDetail(false));
|
||||
}
|
||||
final Path copy = feature.copy(test, new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(), new DisabledConnectionCallback(), new DisabledStreamListener());
|
||||
final Path copy = feature.copy(test, new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(), ConnectionCallback.noop, StreamListener.noop);
|
||||
assertNotEquals(test.attributes().getVersionId(), copy.attributes().getVersionId());
|
||||
assertTrue(new B2FindFeature(session, fileid).find(new Path(container, name, EnumSet.of(Path.Type.file))));
|
||||
assertTrue(new B2FindFeature(session, fileid).find(copy));
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, copy), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, copy), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -71,10 +71,10 @@ public class B2CopyFeatureTest extends AbstractB2Test {
|
||||
final String name = new AlphanumericRandomStringService().random();
|
||||
final Path test = new B2TouchFeature(session, fileid).touch(new B2WriteFeature(session, fileid), new Path(container, name, EnumSet.of(Path.Type.file)), new TransferStatus());
|
||||
assertTrue(new B2FindFeature(session, fileid).find(test));
|
||||
final Path copy = new B2CopyFeature(session, fileid).copy(test, new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(), new DisabledConnectionCallback(), new DisabledStreamListener());
|
||||
final Path copy = new B2CopyFeature(session, fileid).copy(test, new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(), ConnectionCallback.noop, StreamListener.noop);
|
||||
assertTrue(new B2FindFeature(session, fileid).find(new Path(container, name, EnumSet.of(Path.Type.file))));
|
||||
assertTrue(new B2FindFeature(session, fileid).find(copy));
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, copy, target), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, copy, target), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -87,10 +87,10 @@ public class B2CopyFeatureTest extends AbstractB2Test {
|
||||
final Path copy = new B2TouchFeature(session, fileid).touch(new B2WriteFeature(session, fileid), new Path(folder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
|
||||
assertTrue(new B2FindFeature(session, fileid).find(new Path(folder, name, EnumSet.of(Path.Type.file))));
|
||||
assertTrue(new B2FindFeature(session, fileid).find(copy));
|
||||
new B2CopyFeature(session, fileid).copy(test, copy, new TransferStatus().setExists(true), new DisabledConnectionCallback(), new DisabledStreamListener());
|
||||
new B2CopyFeature(session, fileid).copy(test, copy, new TransferStatus().setExists(true), ConnectionCallback.noop, StreamListener.noop);
|
||||
final Find find = new DefaultFindFeature(session);
|
||||
assertTrue(find.find(test));
|
||||
assertTrue(find.find(copy));
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, copy), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, copy), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ package ch.cyberduck.core.b2;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledListProgressListener;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.exception.NotfoundException;
|
||||
@@ -42,7 +42,7 @@ public class B2DeleteFeatureTest extends AbstractB2Test {
|
||||
public void testDeleteNotFound() throws Exception {
|
||||
final Path bucket = new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume));
|
||||
final Path test = new Path(bucket, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
new B2DeleteFeature(session, new B2VersionIdProvider(session)).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, new B2VersionIdProvider(session)).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -56,12 +56,12 @@ public class B2DeleteFeatureTest extends AbstractB2Test {
|
||||
assertNotNull(versionId);
|
||||
// Hide
|
||||
new B2DeleteFeature(session, new B2VersionIdProvider(session)).delete(Collections.singletonList(test.withAttributes(PathAttributes.EMPTY)),
|
||||
new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
LoginCallback.noop, new Delete.DisabledCallback());
|
||||
// Double hide. Ignore failure already_hidden
|
||||
new B2DeleteFeature(session, new B2VersionIdProvider(session)).delete(Collections.singletonList(test.withAttributes(PathAttributes.EMPTY)),
|
||||
new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener()).toList(), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, new B2VersionIdProvider(session)).delete(Collections.singletonList(bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
LoginCallback.noop, new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener()).toList(), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, new B2VersionIdProvider(session)).delete(Collections.singletonList(bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -70,7 +70,7 @@ public class B2DeleteFeatureTest extends AbstractB2Test {
|
||||
final Path bucket = new B2DirectoryFeature(session, fileid).mkdir(new B2WriteFeature(session, fileid), new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), new TransferStatus());
|
||||
final Path file = new Path(bucket, String.format("%s %s", new AlphanumericRandomStringService().random(), "1"), EnumSet.of(Path.Type.file));
|
||||
new B2TouchFeature(session, fileid).touch(new B2WriteFeature(session, fileid), file, new TransferStatus());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(bucket, file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(bucket, file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertFalse(new B2FindFeature(session, fileid).find(file));
|
||||
assertFalse(new B2FindFeature(session, fileid).find(bucket));
|
||||
}
|
||||
@@ -81,16 +81,16 @@ public class B2DeleteFeatureTest extends AbstractB2Test {
|
||||
final Path bucket = new B2DirectoryFeature(session, fileid).mkdir(new B2WriteFeature(session, fileid), new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), new TransferStatus());
|
||||
final Path file = new Path(bucket, String.format("%s %s", new AlphanumericRandomStringService().random(), "1"), EnumSet.of(Path.Type.file));
|
||||
new B2TouchFeature(session, fileid).touch(new B2WriteFeature(session, fileid), file, new TransferStatus());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertFalse(new B2FindFeature(session, fileid).find(file));
|
||||
try {
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file.withAttributes(PathAttributes.EMPTY)), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file.withAttributes(PathAttributes.EMPTY)), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
fail();
|
||||
}
|
||||
catch(NotfoundException e) {
|
||||
//
|
||||
}
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -99,11 +99,11 @@ public class B2DeleteFeatureTest extends AbstractB2Test {
|
||||
final Path bucket = new B2DirectoryFeature(session, fileid).mkdir(new B2WriteFeature(session, fileid), new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), new TransferStatus());
|
||||
final Path file = new Path(bucket, String.format("%s %s", new AlphanumericRandomStringService().random(), "1"), EnumSet.of(Path.Type.file));
|
||||
new B2TouchFeature(session, fileid).touch(new B2WriteFeature(session, fileid), file, new TransferStatus());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file.withAttributes(PathAttributes.EMPTY)), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file.withAttributes(PathAttributes.EMPTY)), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertFalse(new B2FindFeature(session, fileid).find(file));
|
||||
assertFalse(new DefaultFindFeature(session).find(file));
|
||||
new B2DeleteFeature(session, fileid).delete(new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener()).toList(), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, new B2VersionIdProvider(session)).delete(Collections.singletonList(bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener()).toList(), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, new B2VersionIdProvider(session)).delete(Collections.singletonList(bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -111,7 +111,7 @@ public class B2DeleteFeatureTest extends AbstractB2Test {
|
||||
final B2VersionIdProvider fileid = new B2VersionIdProvider(session);
|
||||
final Path bucket = new B2DirectoryFeature(session, fileid).mkdir(new B2WriteFeature(session, fileid), new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), new TransferStatus());
|
||||
final Path directory = new B2DirectoryFeature(session, fileid).mkdir(new B2WriteFeature(session, fileid), new Path(bucket, String.format("%s %s", new AlphanumericRandomStringService().random(), "1"), EnumSet.of(Path.Type.directory)), new TransferStatus());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(bucket, directory), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(bucket, directory), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertFalse(new B2FindFeature(session, fileid).find(directory));
|
||||
assertFalse(new B2FindFeature(session, fileid).find(bucket));
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ package ch.cyberduck.core.b2;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.exception.ConflictException;
|
||||
@@ -45,7 +45,7 @@ public class B2DirectoryFeatureTest extends AbstractB2Test {
|
||||
assertTrue(feature.isSupported(bucket.getParent(), bucket.getName()));
|
||||
feature.mkdir(new B2WriteFeature(session, fileid), bucket, new TransferStatus());
|
||||
assertThrows(ConflictException.class, () -> feature.mkdir(new B2WriteFeature(session, fileid), bucket, new TransferStatus()));
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test(expected = ConflictException.class)
|
||||
@@ -88,11 +88,11 @@ public class B2DirectoryFeatureTest extends AbstractB2Test {
|
||||
assertNotEquals(PathAttributes.EMPTY, new B2AttributesFinderFeature(session, fileid).find(directory));
|
||||
assertEquals(directory.attributes().getVersionId(), new B2VersionIdProvider(session).getVersionId(new Path(bucket, filename, EnumSet.of(Path.Type.directory))));
|
||||
// Mark as hidden
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(new Path(directory).withAttributes(PathAttributes.EMPTY)), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(new Path(directory).withAttributes(PathAttributes.EMPTY)), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
// .bzEmpty is deleted not hidden
|
||||
assertFalse(new B2FindFeature(session, fileid).find(directory));
|
||||
assertFalse(new DefaultFindFeature(session).find(directory));
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(directory), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(directory), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -105,6 +105,6 @@ public class B2DirectoryFeatureTest extends AbstractB2Test {
|
||||
final Path directory = new B2DirectoryFeature(session, fileid).mkdir(
|
||||
new B2WriteFeature(session, fileid), new Path(bucket, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), status);
|
||||
assertEquals(timestamp, new B2AttributesFinderFeature(session, fileid).find(directory).getModificationDate());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(directory), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(directory), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.AsciiRandomStringService;
|
||||
import ch.cyberduck.core.CachingFindFeature;
|
||||
import ch.cyberduck.core.DisabledListProgressListener;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathCache;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
@@ -49,7 +49,7 @@ public class B2FindFeatureTest extends AbstractB2Test {
|
||||
new B2TouchFeature(session, fileid).touch(new B2WriteFeature(session, fileid), file, new TransferStatus());
|
||||
assertTrue(new B2FindFeature(session, fileid).find(file));
|
||||
assertFalse(new B2FindFeature(session, fileid).find(new Path(bucket, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file))));
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -78,7 +78,7 @@ public class B2FindFeatureTest extends AbstractB2Test {
|
||||
assertTrue(new B2FindFeature(session, fileid).find(new Path(container, prefix, EnumSet.of(Path.Type.directory, Path.Type.placeholder))));
|
||||
assertTrue(new B2ObjectListService(session, fileid).list(intermediate,
|
||||
new DisabledListProgressListener()).contains(test));
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertFalse(new B2FindFeature(session, fileid).find(test));
|
||||
assertFalse(new B2FindFeature(session, fileid).find(intermediate));
|
||||
final PathCache cache = new PathCache(1);
|
||||
|
||||
@@ -16,13 +16,13 @@ package ch.cyberduck.core.b2;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.features.Find;
|
||||
import ch.cyberduck.core.io.DisabledStreamListener;
|
||||
import ch.cyberduck.core.io.StreamCopier;
|
||||
import ch.cyberduck.core.io.StreamListener;
|
||||
import ch.cyberduck.core.shared.DefaultFindFeature;
|
||||
import ch.cyberduck.core.transfer.TransferStatus;
|
||||
import ch.cyberduck.test.IntegrationTest;
|
||||
@@ -50,21 +50,21 @@ public class B2LargeCopyFeatureTest extends AbstractB2Test {
|
||||
final String name = new AlphanumericRandomStringService().random();
|
||||
final byte[] content = RandomUtils.nextBytes(6 * 1000 * 1000);
|
||||
final Path test = new Path(container, name, EnumSet.of(Path.Type.file));
|
||||
final OutputStream out = new B2WriteFeature(session, fileid).write(test, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final OutputStream out = new B2WriteFeature(session, fileid).write(test, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
new StreamCopier(new TransferStatus(), new TransferStatus().setLength(content.length)).transfer(new ByteArrayInputStream(content), out);
|
||||
out.close();
|
||||
assertTrue(new B2FindFeature(session, fileid).find(test));
|
||||
final Path copy = new B2LargeCopyFeature(session, fileid, 5 * 1000L * 1000L, 1).copy(test, new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)),
|
||||
new TransferStatus().setLength(content.length), new DisabledConnectionCallback(), new DisabledStreamListener());
|
||||
new TransferStatus().setLength(content.length), ConnectionCallback.noop, StreamListener.noop);
|
||||
assertNotEquals(test.attributes().getVersionId(), copy.attributes().getVersionId());
|
||||
assertTrue(new B2FindFeature(session, fileid).find(new Path(container, name, EnumSet.of(Path.Type.file))));
|
||||
assertTrue(new B2FindFeature(session, fileid).find(copy));
|
||||
final byte[] compare = new byte[content.length];
|
||||
final InputStream stream = new B2ReadFeature(session, fileid).read(copy, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream stream = new B2ReadFeature(session, fileid).read(copy, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
IOUtils.readFully(stream, compare);
|
||||
stream.close();
|
||||
assertArrayEquals(content, compare);
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, copy), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, copy), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -76,20 +76,20 @@ public class B2LargeCopyFeatureTest extends AbstractB2Test {
|
||||
final String name = new AlphanumericRandomStringService().random();
|
||||
final byte[] content = RandomUtils.nextBytes(6 * 1000 * 1000);
|
||||
final Path test = new Path(container, name, EnumSet.of(Path.Type.file));
|
||||
final OutputStream out = new B2WriteFeature(session, fileid).write(test, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final OutputStream out = new B2WriteFeature(session, fileid).write(test, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
new StreamCopier(new TransferStatus(), new TransferStatus().setLength(content.length)).transfer(new ByteArrayInputStream(content), out);
|
||||
out.close();
|
||||
assertTrue(new B2FindFeature(session, fileid).find(test));
|
||||
final Path copy = new B2LargeCopyFeature(session, fileid, 5 * 1000L * 1000L, 1).copy(test, new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)),
|
||||
new TransferStatus().setLength(content.length), new DisabledConnectionCallback(), new DisabledStreamListener());
|
||||
new TransferStatus().setLength(content.length), ConnectionCallback.noop, StreamListener.noop);
|
||||
assertTrue(new B2FindFeature(session, fileid).find(new Path(container, name, EnumSet.of(Path.Type.file))));
|
||||
assertTrue(new B2FindFeature(session, fileid).find(copy));
|
||||
final byte[] compare = new byte[content.length];
|
||||
final InputStream stream = new B2ReadFeature(session, fileid).read(copy, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream stream = new B2ReadFeature(session, fileid).read(copy, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
IOUtils.readFully(stream, compare);
|
||||
stream.close();
|
||||
assertArrayEquals(content, compare);
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, copy, target), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, copy, target), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -100,17 +100,17 @@ public class B2LargeCopyFeatureTest extends AbstractB2Test {
|
||||
final String name = new AlphanumericRandomStringService().random();
|
||||
final byte[] content = RandomUtils.nextBytes(6 * 1000 * 1000);
|
||||
final Path test = new Path(folder, name, EnumSet.of(Path.Type.file));
|
||||
final OutputStream out = new B2WriteFeature(session, fileid).write(test, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final OutputStream out = new B2WriteFeature(session, fileid).write(test, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
new StreamCopier(new TransferStatus(), new TransferStatus().setLength(content.length)).transfer(new ByteArrayInputStream(content), out);
|
||||
out.close();
|
||||
final Path copy = new B2TouchFeature(session, fileid).touch(new B2WriteFeature(session, fileid), new Path(folder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
|
||||
assertTrue(new B2FindFeature(session, fileid).find(new Path(folder, name, EnumSet.of(Path.Type.file))));
|
||||
assertTrue(new B2FindFeature(session, fileid).find(copy));
|
||||
new B2LargeCopyFeature(session, fileid, 5 * 1000L * 1000L, 1).copy(test, copy,
|
||||
new TransferStatus().setExists(true).setLength(content.length), new DisabledConnectionCallback(), new DisabledStreamListener());
|
||||
new TransferStatus().setExists(true).setLength(content.length), ConnectionCallback.noop, StreamListener.noop);
|
||||
final Find find = new DefaultFindFeature(session);
|
||||
assertTrue(find.find(test));
|
||||
assertTrue(find.find(copy));
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, copy), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, copy), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,19 +18,17 @@ package ch.cyberduck.core.b2;
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.BytecountStreamListener;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.Local;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.exception.BackgroundException;
|
||||
import ch.cyberduck.core.exception.ConnectionTimeoutException;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.features.Write;
|
||||
import ch.cyberduck.core.io.BandwidthThrottle;
|
||||
import ch.cyberduck.core.io.Checksum;
|
||||
import ch.cyberduck.core.io.DisabledStreamListener;
|
||||
import ch.cyberduck.core.io.SHA1ChecksumCompute;
|
||||
import ch.cyberduck.core.io.StreamCancelation;
|
||||
import ch.cyberduck.core.io.StreamCopier;
|
||||
@@ -82,8 +80,8 @@ public class B2LargeUploadServiceTest extends AbstractB2Test {
|
||||
final B2VersionIdProvider fileid = new B2VersionIdProvider(session);
|
||||
final B2LargeUploadService upload = new B2LargeUploadService(session, fileid, 5 * 1000L * 1000L, 5);
|
||||
|
||||
upload.upload(new B2WriteFeature(session, fileid), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(),
|
||||
status, new DisabledConnectionCallback());
|
||||
upload.upload(new B2WriteFeature(session, fileid), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), ProgressListener.noop, StreamListener.noop,
|
||||
status, ConnectionCallback.noop);
|
||||
final PathAttributes attr = new B2AttributesFinderFeature(session, fileid).find(test);
|
||||
assertNotEquals(Checksum.NONE, attr.getChecksum());
|
||||
assertEquals(checksum, attr.getChecksum());
|
||||
@@ -92,13 +90,13 @@ public class B2LargeUploadServiceTest extends AbstractB2Test {
|
||||
assertEquals(content.length, status.getResponse().getSize());
|
||||
|
||||
assertTrue(new DefaultFindFeature(session).find(test));
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(test, new TransferStatus(), new DisabledConnectionCallback());
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(test, new TransferStatus(), ConnectionCallback.noop);
|
||||
final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
|
||||
new StreamCopier(status, status).transfer(in, buffer);
|
||||
in.close();
|
||||
buffer.close();
|
||||
assertArrayEquals(content, buffer.toByteArray());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
local.delete();
|
||||
}
|
||||
|
||||
@@ -126,7 +124,7 @@ public class B2LargeUploadServiceTest extends AbstractB2Test {
|
||||
}
|
||||
};
|
||||
try {
|
||||
service.upload(new B2WriteFeature(session, fileid), test, new Local(System.getProperty("java.io.tmpdir"), name), new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledLoginCallback());
|
||||
service.upload(new B2WriteFeature(session, fileid), test, new Local(System.getProperty("java.io.tmpdir"), name), new BandwidthThrottle(BandwidthThrottle.UNLIMITED), ProgressListener.noop, count, status, LoginCallback.noop);
|
||||
}
|
||||
catch(BackgroundException e) {
|
||||
// Expected
|
||||
@@ -141,18 +139,18 @@ public class B2LargeUploadServiceTest extends AbstractB2Test {
|
||||
assertEquals(0L, resume.offset, 0L);
|
||||
final TransferStatus append = new TransferStatus().setAppend(true).setLength(content.length);
|
||||
service.upload(new B2WriteFeature(session, fileid), test, local,
|
||||
new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), append,
|
||||
new DisabledLoginCallback());
|
||||
new BandwidthThrottle(BandwidthThrottle.UNLIMITED), ProgressListener.noop, StreamListener.noop, append,
|
||||
LoginCallback.noop);
|
||||
assertEquals(content.length, append.getResponse().getSize());
|
||||
assertTrue(new B2FindFeature(session, fileid).find(test));
|
||||
assertEquals(content.length, new B2AttributesFinderFeature(session, fileid).find(test).getSize());
|
||||
assertTrue(append.isComplete());
|
||||
final byte[] buffer = new byte[content.length];
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(test, new TransferStatus(), new DisabledConnectionCallback());
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(test, new TransferStatus(), ConnectionCallback.noop);
|
||||
IOUtils.readFully(in, buffer);
|
||||
in.close();
|
||||
assertArrayEquals(content, buffer);
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
local.delete();
|
||||
}
|
||||
|
||||
@@ -182,7 +180,7 @@ public class B2LargeUploadServiceTest extends AbstractB2Test {
|
||||
};
|
||||
final BytecountStreamListener count = new BytecountStreamListener();
|
||||
try {
|
||||
feature.upload(new B2WriteFeature(session, fileid), test, new Local(System.getProperty("java.io.tmpdir"), name), new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledLoginCallback());
|
||||
feature.upload(new B2WriteFeature(session, fileid), test, new Local(System.getProperty("java.io.tmpdir"), name), new BandwidthThrottle(BandwidthThrottle.UNLIMITED), ProgressListener.noop, count, status, LoginCallback.noop);
|
||||
}
|
||||
catch(BackgroundException e) {
|
||||
// Expected
|
||||
@@ -200,19 +198,19 @@ public class B2LargeUploadServiceTest extends AbstractB2Test {
|
||||
assertEquals(5 * 1000L * 1000L, new B2AttributesFinderFeature(session, fileid).find(upload).getSize(), 0L);
|
||||
final TransferStatus append = new TransferStatus().setAppend(true).setLength(2L * 1000L * 1000L).setOffset(5 * 1000L * 1000L);
|
||||
feature.upload(new B2WriteFeature(session, fileid), test, local,
|
||||
new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, append,
|
||||
new DisabledLoginCallback());
|
||||
new BandwidthThrottle(BandwidthThrottle.UNLIMITED), ProgressListener.noop, count, append,
|
||||
LoginCallback.noop);
|
||||
assertEquals(6 * 1000L * 1000L, count.getSent());
|
||||
assertTrue(append.isComplete());
|
||||
assertEquals(content.length, append.getResponse().getSize());
|
||||
assertTrue(new B2FindFeature(session, fileid).find(test));
|
||||
assertEquals(6 * 1000L * 1000L, new B2AttributesFinderFeature(session, fileid).find(test).getSize(), 0L);
|
||||
final byte[] buffer = new byte[content.length];
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(test, new TransferStatus(), new DisabledConnectionCallback());
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(test, new TransferStatus(), ConnectionCallback.noop);
|
||||
IOUtils.readFully(in, buffer);
|
||||
in.close();
|
||||
assertArrayEquals(content, buffer);
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
local.delete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ package ch.cyberduck.core.b2;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.io.StatusOutputStream;
|
||||
@@ -54,7 +54,7 @@ public class B2LargeUploadWriteFeatureTest extends AbstractB2Test {
|
||||
status.setLength(-1L);
|
||||
status.setModified(1503654614004L);
|
||||
final Path file = new Path(container, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
|
||||
final StatusOutputStream<BaseB2Response> out = feature.write(file, status, new DisabledConnectionCallback());
|
||||
final StatusOutputStream<BaseB2Response> out = feature.write(file, status, ConnectionCallback.noop);
|
||||
final byte[] content = RandomUtils.nextBytes(6 * 1024 * 1024);
|
||||
final ByteArrayInputStream in = new ByteArrayInputStream(content);
|
||||
assertEquals(content.length, IOUtils.copy(in, out));
|
||||
@@ -63,12 +63,12 @@ public class B2LargeUploadWriteFeatureTest extends AbstractB2Test {
|
||||
assertEquals(content.length, ((B2FinishLargeFileResponse) out.getStatus()).getContentLength(), 0L);
|
||||
assertTrue(new B2FindFeature(session, fileid).find(file));
|
||||
final byte[] compare = new byte[content.length];
|
||||
final InputStream stream = new B2ReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream stream = new B2ReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
IOUtils.readFully(stream, compare);
|
||||
stream.close();
|
||||
assertArrayEquals(content, compare);
|
||||
assertEquals(1503654614004L, new B2AttributesFinderFeature(session, fileid).find(file).getModificationDate());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -80,7 +80,7 @@ public class B2LargeUploadWriteFeatureTest extends AbstractB2Test {
|
||||
status.setLength(-1L);
|
||||
status.setModified(1503654614004L);
|
||||
final Path file = new Path(container, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
|
||||
final StatusOutputStream<BaseB2Response> out = feature.write(file, status, new DisabledConnectionCallback());
|
||||
final StatusOutputStream<BaseB2Response> out = feature.write(file, status, ConnectionCallback.noop);
|
||||
final byte[] content = RandomUtils.nextBytes(2 * 1024 * 1024);
|
||||
final ByteArrayInputStream in = new ByteArrayInputStream(content);
|
||||
assertEquals(content.length, IOUtils.copy(in, out));
|
||||
@@ -89,12 +89,12 @@ public class B2LargeUploadWriteFeatureTest extends AbstractB2Test {
|
||||
assertEquals(content.length, ((B2FileResponse) out.getStatus()).getContentLength(), 0L);
|
||||
assertTrue(new B2FindFeature(session, fileid).find(file));
|
||||
final byte[] compare = new byte[content.length];
|
||||
final InputStream stream = new B2ReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream stream = new B2ReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
IOUtils.readFully(stream, compare);
|
||||
stream.close();
|
||||
assertArrayEquals(content, compare);
|
||||
assertEquals(1503654614004L, new B2AttributesFinderFeature(session, fileid).find(file).getModificationDate());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -107,7 +107,7 @@ public class B2LargeUploadWriteFeatureTest extends AbstractB2Test {
|
||||
status.setLength(-1L);
|
||||
status.setModified(1503654614004L);
|
||||
final Path file = new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
final StatusOutputStream<BaseB2Response> out = feature.write(file, status, new DisabledConnectionCallback());
|
||||
final StatusOutputStream<BaseB2Response> out = feature.write(file, status, ConnectionCallback.noop);
|
||||
final ByteArrayInputStream in = new ByteArrayInputStream(content);
|
||||
assertEquals(content.length, IOUtils.copyLarge(in, out));
|
||||
in.close();
|
||||
@@ -116,11 +116,11 @@ public class B2LargeUploadWriteFeatureTest extends AbstractB2Test {
|
||||
assertEquals(content.length, ((B2FileResponse) out.getStatus()).getContentLength(), 0L);
|
||||
assertTrue(new DefaultFindFeature(session).find(file));
|
||||
final byte[] compare = new byte[content.length];
|
||||
final InputStream stream = new B2ReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream stream = new B2ReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
IOUtils.readFully(stream, compare);
|
||||
stream.close();
|
||||
assertArrayEquals(content, compare);
|
||||
assertEquals(1503654614004L, new B2AttributesFinderFeature(session, fileid).find(file).getModificationDate());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ package ch.cyberduck.core.b2;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.lifecycle.LifecycleConfiguration;
|
||||
@@ -46,6 +46,6 @@ public class B2LifecycleFeatureTest extends AbstractB2Test {
|
||||
assertEquals(1, configuration.getTransition(), 0L);
|
||||
new B2LifecycleFeature(session, fileid).setConfiguration(bucket, LifecycleConfiguration.empty());
|
||||
assertEquals(LifecycleConfiguration.empty(), new B2LifecycleFeature(session, fileid).getConfiguration(bucket));
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ package ch.cyberduck.core.b2;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.synchronization.Comparison;
|
||||
@@ -44,12 +44,12 @@ public class B2MoveFeatureTest extends AbstractB2Test {
|
||||
final Path test = new B2TouchFeature(session, fileid).touch(new B2WriteFeature(session, fileid), new Path(container, name, EnumSet.of(Path.Type.file)), new TransferStatus());
|
||||
assertTrue(new B2FindFeature(session, fileid).find(test));
|
||||
final Path target = new B2MoveFeature(session, fileid).move(test,
|
||||
new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
|
||||
new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(), new Delete.DisabledCallback(), ConnectionCallback.noop);
|
||||
assertNotEquals(test.attributes().getVersionId(), target.attributes().getVersionId());
|
||||
assertFalse(new B2FindFeature(session, fileid).find(new Path(container, name, EnumSet.of(Path.Type.file))));
|
||||
assertTrue(new B2FindFeature(session, fileid).find(target));
|
||||
assertEquals(target.attributes(), new B2AttributesFinderFeature(session, fileid).find(target));
|
||||
assertEquals(Comparison.equal, session.getHost().getProtocol().getFeature(ComparisonService.class).compare(Path.Type.file, test.attributes(), target.attributes()));
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.<Path>singletonList(target), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.<Path>singletonList(target), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,13 +18,12 @@ package ch.cyberduck.core.b2;
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.AsciiRandomStringService;
|
||||
import ch.cyberduck.core.AttributedList;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DefaultPathAttributes;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledListProgressListener;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.IndexedListProgressListener;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.SimplePathPredicate;
|
||||
import ch.cyberduck.core.VersioningConfiguration;
|
||||
import ch.cyberduck.core.exception.NotfoundException;
|
||||
@@ -77,7 +76,7 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
}
|
||||
}).isEmpty());
|
||||
assertTrue(callback.get());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(folder), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(folder), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -89,7 +88,7 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
assertEquals(".", folder.getName());
|
||||
assertTrue(new B2ObjectListService(session, fileid).list(folder, new DisabledListProgressListener()).isEmpty());
|
||||
assertTrue(new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener()).contains(folder));
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(folder, bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(folder, bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -103,7 +102,7 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
assertEquals(folder, test.getParent());
|
||||
assertTrue(new B2ObjectListService(session, fileid).list(test, new DisabledListProgressListener()).isEmpty());
|
||||
assertTrue(new B2ObjectListService(session, fileid).list(folder, new DisabledListProgressListener()).contains(test));
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, folder, bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, folder, bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -116,7 +115,7 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
assertEquals(".", file.getName());
|
||||
assertEquals(folder, file.getParent());
|
||||
assertTrue(new B2ObjectListService(session, fileid).list(folder, new DisabledListProgressListener()).contains(file));
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(file, folder, bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(file, folder, bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -128,7 +127,7 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
assertEquals(bucket, file.getParent());
|
||||
assertEquals("..", file.getName());
|
||||
assertTrue(new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener()).contains(file));
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(file, bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(file, bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test(expected = NotfoundException.class)
|
||||
@@ -146,7 +145,7 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
final Path file = new Path(bucket, new AsciiRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
final TransferStatus status = new TransferStatus().setLength(0L);
|
||||
status.setChecksum(Checksum.parse("da39a3ee5e6b4b0d3255bfef95601890afd80709"));
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(file, status, new DisabledConnectionCallback());
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(file, status, ConnectionCallback.noop);
|
||||
IOUtils.write(new byte[0], out);
|
||||
out.close();
|
||||
final AttributedList<Path> list = new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener());
|
||||
@@ -154,9 +153,9 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
assertNull(list.find(new SimplePathPredicate(file)).attributes().getRevision());
|
||||
assertEquals(0L, list.find(new SimplePathPredicate(file)).attributes().getSize());
|
||||
assertSame(bucket, list.find(new SimplePathPredicate(file)).getParent());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertFalse(new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener()).contains(file));
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -169,7 +168,7 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
final AttributedList<Path> list = new B2ObjectListService(session, fileid, 1, new VersioningConfiguration(true)).list(bucket, new DisabledListProgressListener());
|
||||
assertTrue(list.contains(file1));
|
||||
assertTrue(list.contains(file2));
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(bucket, file1, file2), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(bucket, file1, file2), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -184,7 +183,7 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
final TransferStatus status = new TransferStatus();
|
||||
status.setLength(content.length);
|
||||
status.setChecksum(new SHA1ChecksumCompute().compute(new ByteArrayInputStream(content), status));
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(file, status, new DisabledConnectionCallback());
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(file, status, ConnectionCallback.noop);
|
||||
IOUtils.write(content, out);
|
||||
out.close();
|
||||
final B2FileResponse response = (B2FileResponse) out.getStatus();
|
||||
@@ -203,7 +202,7 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
final TransferStatus status = new TransferStatus();
|
||||
status.setLength(content.length);
|
||||
status.setChecksum(new SHA1ChecksumCompute().compute(new ByteArrayInputStream(content), status));
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(file, status, new DisabledConnectionCallback());
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(file, status, ConnectionCallback.noop);
|
||||
IOUtils.write(content, out);
|
||||
out.close();
|
||||
final B2FileResponse response = (B2FileResponse) out.getStatus();
|
||||
@@ -217,7 +216,7 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
assertEquals(Long.valueOf(1L), list.find(path -> path.attributes().isDuplicate()).attributes().getRevision());
|
||||
}
|
||||
// Add hide marker
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file.withAttributes(new DefaultPathAttributes(file.attributes()).setVersionId(null))), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file.withAttributes(new DefaultPathAttributes(file.attributes()).setVersionId(null))), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
{
|
||||
final AttributedList<Path> list = new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener());
|
||||
assertEquals(3, list.size());
|
||||
@@ -243,9 +242,9 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
assertEquals(list, versions);
|
||||
assertFalse(versions.contains(other));
|
||||
for(Path f : list) {
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(f), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(f), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(other, bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(other, bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -261,7 +260,7 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
final TransferStatus status = new TransferStatus();
|
||||
status.setLength(content.length);
|
||||
status.setChecksum(new SHA1ChecksumCompute().compute(new ByteArrayInputStream(content), status));
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(file, status, new DisabledConnectionCallback());
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(file, status, ConnectionCallback.noop);
|
||||
IOUtils.write(content, out);
|
||||
out.close();
|
||||
final B2FileResponse response = (B2FileResponse) out.getStatus();
|
||||
@@ -280,7 +279,7 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
final TransferStatus status = new TransferStatus();
|
||||
status.setLength(content.length);
|
||||
status.setChecksum(new SHA1ChecksumCompute().compute(new ByteArrayInputStream(content), status));
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(file, status, new DisabledConnectionCallback());
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(file, status, ConnectionCallback.noop);
|
||||
IOUtils.write(content, out);
|
||||
out.close();
|
||||
final B2FileResponse response = (B2FileResponse) out.getStatus();
|
||||
@@ -294,7 +293,7 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
assertEquals(response.getFileId(), list.find(new SimplePathPredicate(file)).attributes().getVersionId());
|
||||
}
|
||||
// Add hide marker
|
||||
new B2DeleteFeature(session, fileid, VersioningConfiguration.empty()).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid, VersioningConfiguration.empty()).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertTrue(new B2ObjectListService(session, fileid, 1, VersioningConfiguration.empty()).list(bucket, new DisabledListProgressListener()).isEmpty());
|
||||
assertFalse(new B2FindFeature(session, fileid).find(file));
|
||||
assertFalse(new DefaultFindFeature(session).find(file));
|
||||
@@ -308,9 +307,9 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
final AttributedList<Path> list = new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener());
|
||||
assertEquals(list, new B2VersioningFeature(session, fileid).list(file, new DisabledListProgressListener()));
|
||||
for(Path f : list) {
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(f), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(f), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -338,25 +337,25 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
assertSame(folder1, list.find(new SimplePathPredicate(file1)).getParent());
|
||||
assertSame(folder1, list.find(new SimplePathPredicate(folder2)).getParent());
|
||||
// Nullify version to add delete marker
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(new Path(file2).withAttributes(new DefaultPathAttributes(file2.attributes()).setVersionId(null))), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(new Path(file2).withAttributes(new DefaultPathAttributes(file2.attributes()).setVersionId(null))), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertTrue(new B2ObjectListService(session, fileid, 1, VersioningConfiguration.empty()).list(folder2, new DisabledListProgressListener()).isEmpty());
|
||||
assertFalse(new B2ObjectListService(session, fileid).list(folder2, new DisabledListProgressListener()).isEmpty());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(folder2), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(folder2), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertTrue(new B2ObjectListService(session, fileid).list(folder2, new DisabledListProgressListener()).contains(file2));
|
||||
assertThrows(NotfoundException.class, () -> new B2ObjectListService(session, fileid, 1, VersioningConfiguration.empty()).list(folder2, new DisabledListProgressListener()));
|
||||
// Nullify version to add delete marker
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(new Path(file1).withAttributes(new DefaultPathAttributes(file1.attributes()).setVersionId(null))), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(new Path(file1).withAttributes(new DefaultPathAttributes(file1.attributes()).setVersionId(null))), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertTrue(new B2ObjectListService(session, fileid, 1, VersioningConfiguration.empty()).list(folder1, new DisabledListProgressListener()).isEmpty());
|
||||
assertTrue(new B2ObjectListService(session, fileid).list(folder1, new DisabledListProgressListener()).contains(folder2));
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(folder1), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(folder1), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertThrows(NotfoundException.class, () -> new B2ObjectListService(session, fileid, 1, VersioningConfiguration.empty()).list(folder1, new DisabledListProgressListener()));
|
||||
for(Path f : new B2ObjectListService(session, fileid).list(folder1, new DisabledListProgressListener())) {
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(f), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(f), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
for(Path f : new B2ObjectListService(session, fileid).list(folder2, new DisabledListProgressListener())) {
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(f), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(f), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -375,7 +374,7 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
assertFalse(foundFolder1.attributes().isDuplicate());
|
||||
}
|
||||
// Nullify version to add delete marker
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(new Path(file1).withAttributes(new DefaultPathAttributes(file1.attributes()).setVersionId(null))), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(new Path(file1).withAttributes(new DefaultPathAttributes(file1.attributes()).setVersionId(null))), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertTrue(new B2ObjectListService(session, fileid, 1, VersioningConfiguration.empty()).list(bucket, new DisabledListProgressListener()).isEmpty());
|
||||
{
|
||||
final AttributedList<Path> list = new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener());
|
||||
@@ -383,9 +382,9 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
assertEquals(folder1, list.iterator().next());
|
||||
}
|
||||
for(Path f : new B2ObjectListService(session, fileid).list(folder1, new DisabledListProgressListener())) {
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(f), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(f), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -412,16 +411,16 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
assertFalse(foundFolder2.attributes().isDuplicate());
|
||||
}
|
||||
// Nullify version to add delete marker
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file.withAttributes(new DefaultPathAttributes(file.attributes()).setVersionId(null))), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file.withAttributes(new DefaultPathAttributes(file.attributes()).setVersionId(null))), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertTrue(new DefaultFindFeature(session).find(folder1, new DisabledListProgressListener()));
|
||||
assertTrue(new B2ObjectListService(session, fileid).list(folder1, new DisabledListProgressListener()).contains(folder2));
|
||||
assertTrue(new DefaultFindFeature(session).find(folder2, new DisabledListProgressListener()));
|
||||
assertEquals(2, new B2ObjectListService(session, fileid).list(folder2, new DisabledListProgressListener()).size());
|
||||
assertThrows(NotfoundException.class, () -> new B2ObjectListService(session, fileid, 1, VersioningConfiguration.empty()).list(folder2, new DisabledListProgressListener()));
|
||||
for(Path f : new B2ObjectListService(session, fileid).list(folder2, new DisabledListProgressListener())) {
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(f), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(f), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -436,7 +435,7 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
assertEquals(2, list.size());
|
||||
assertTrue(list.contains(file1));
|
||||
assertTrue(list.contains(folder1));
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(file1, folder1, bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(file1, folder1, bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -465,8 +464,8 @@ public class B2ObjectListServiceTest extends AbstractB2Test {
|
||||
});
|
||||
for(int i = 0; i < list.size(); i++) {
|
||||
assertEquals(files.get(i), list.get(i).getName());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(list.get(i)), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(list.get(i)), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(directory), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(directory), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,20 +16,20 @@ package ch.cyberduck.core.b2;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledListProgressListener;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.Local;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.exception.NotfoundException;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.http.HttpResponseOutputStream;
|
||||
import ch.cyberduck.core.io.BandwidthThrottle;
|
||||
import ch.cyberduck.core.io.DisabledStreamListener;
|
||||
import ch.cyberduck.core.io.SHA1ChecksumCompute;
|
||||
import ch.cyberduck.core.io.SHA256ChecksumCompute;
|
||||
import ch.cyberduck.core.io.StreamCopier;
|
||||
import ch.cyberduck.core.io.StreamListener;
|
||||
import ch.cyberduck.core.shared.DefaultDownloadFeature;
|
||||
import ch.cyberduck.core.transfer.TransferStatus;
|
||||
import ch.cyberduck.test.IntegrationTest;
|
||||
@@ -58,7 +58,7 @@ public class B2ReadFeatureTest extends AbstractB2Test {
|
||||
@Test(expected = NotfoundException.class)
|
||||
public void testReadNotFound() throws Exception {
|
||||
final Path bucket = new Path("test-cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
|
||||
new B2ReadFeature(session, new B2VersionIdProvider(session)).read(new Path(bucket, "nosuchname", EnumSet.of(Path.Type.file)), new TransferStatus(), new DisabledConnectionCallback());
|
||||
new B2ReadFeature(session, new B2VersionIdProvider(session)).read(new Path(bucket, "nosuchname", EnumSet.of(Path.Type.file)), new TransferStatus(), ConnectionCallback.noop);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -70,22 +70,22 @@ public class B2ReadFeatureTest extends AbstractB2Test {
|
||||
status.setLength(content.length);
|
||||
status.setChecksum(new SHA1ChecksumCompute().compute(new ByteArrayInputStream(content), status));
|
||||
final B2VersionIdProvider fileid = new B2VersionIdProvider(session);
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(file, status, new DisabledConnectionCallback());
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(file, status, ConnectionCallback.noop);
|
||||
IOUtils.write(content, out);
|
||||
out.close();
|
||||
final Local local = new Local(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString());
|
||||
assertEquals(-1L, local.attributes().getSize());
|
||||
new DefaultDownloadFeature(session).download(new B2ReadFeature(session, fileid), file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED),
|
||||
new DisabledStreamListener(), new TransferStatus() {
|
||||
StreamListener.noop, new TransferStatus() {
|
||||
@Override
|
||||
public TransferStatus setLength(long length) {
|
||||
assertEquals(923L, length);
|
||||
// Ignore update. As with unknown length for chunked transfer
|
||||
return this;
|
||||
}
|
||||
}, new DisabledLoginCallback());
|
||||
}, LoginCallback.noop);
|
||||
assertEquals(923L, local.attributes().getSize());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -97,22 +97,22 @@ public class B2ReadFeatureTest extends AbstractB2Test {
|
||||
status.setLength(content.length);
|
||||
status.setChecksum(new SHA1ChecksumCompute().compute(new ByteArrayInputStream(content), status));
|
||||
final B2VersionIdProvider fileid = new B2VersionIdProvider(session);
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(file, status, new DisabledConnectionCallback());
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(file, status, ConnectionCallback.noop);
|
||||
IOUtils.write(content, out);
|
||||
out.close();
|
||||
{
|
||||
// Unknown length in status
|
||||
// Read a single byte
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(file, new TransferStatus(), new DisabledConnectionCallback());
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(file, new TransferStatus(), ConnectionCallback.noop);
|
||||
assertNotNull(in.read());
|
||||
in.close();
|
||||
}
|
||||
{
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(file, new TransferStatus(), new DisabledConnectionCallback());
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(file, new TransferStatus(), ConnectionCallback.noop);
|
||||
assertNotNull(in);
|
||||
in.close();
|
||||
}
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -129,14 +129,14 @@ public class B2ReadFeatureTest extends AbstractB2Test {
|
||||
IOUtils.write(content, out);
|
||||
out.close();
|
||||
final BaseB2Response reply = new B2SingleUploadService(session).upload(
|
||||
new B2WriteFeature(session, fileid), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(),
|
||||
new B2WriteFeature(session, fileid), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), ProgressListener.noop, StreamListener.noop,
|
||||
new TransferStatus().setLength(content.length),
|
||||
new DisabledConnectionCallback());
|
||||
ConnectionCallback.noop);
|
||||
final TransferStatus status = new TransferStatus();
|
||||
status.setLength(content.length);
|
||||
status.setAppend(true);
|
||||
status.setOffset(100L);
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(test, status.setLength(content.length - 100), new DisabledConnectionCallback());
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(test, status.setLength(content.length - 100), ConnectionCallback.noop);
|
||||
assertNotNull(in);
|
||||
final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length - 100);
|
||||
new StreamCopier(status, status).transfer(in, buffer);
|
||||
@@ -144,7 +144,7 @@ public class B2ReadFeatureTest extends AbstractB2Test {
|
||||
System.arraycopy(content, 100, reference, 0, content.length - 100);
|
||||
assertArrayEquals(reference, buffer.toByteArray());
|
||||
in.close();
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -161,14 +161,14 @@ public class B2ReadFeatureTest extends AbstractB2Test {
|
||||
IOUtils.write(content, out);
|
||||
out.close();
|
||||
new B2SingleUploadService(session).upload(
|
||||
new B2WriteFeature(session, fileid), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(),
|
||||
new B2WriteFeature(session, fileid), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), ProgressListener.noop, StreamListener.noop,
|
||||
new TransferStatus().setLength(content.length),
|
||||
new DisabledConnectionCallback());
|
||||
ConnectionCallback.noop);
|
||||
final TransferStatus status = new TransferStatus();
|
||||
status.setLength(-1L);
|
||||
status.setAppend(true);
|
||||
status.setOffset(100L);
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(test, status, new DisabledConnectionCallback());
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(test, status, ConnectionCallback.noop);
|
||||
assertNotNull(in);
|
||||
final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length - 100);
|
||||
new StreamCopier(status, status).transfer(in, buffer);
|
||||
@@ -176,7 +176,7 @@ public class B2ReadFeatureTest extends AbstractB2Test {
|
||||
System.arraycopy(content, 100, reference, 0, content.length - 100);
|
||||
assertArrayEquals(reference, buffer.toByteArray());
|
||||
in.close();
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -188,12 +188,12 @@ public class B2ReadFeatureTest extends AbstractB2Test {
|
||||
final byte[] content = RandomUtils.nextBytes(length);
|
||||
final TransferStatus status = new TransferStatus().setLength(content.length);
|
||||
status.setChecksum(new SHA256ChecksumCompute().compute(new ByteArrayInputStream(content), status));
|
||||
final OutputStream out = new B2WriteFeature(session, fileid).write(file, status, new DisabledConnectionCallback());
|
||||
final OutputStream out = new B2WriteFeature(session, fileid).write(file, status, ConnectionCallback.noop);
|
||||
new StreamCopier(new TransferStatus(), new TransferStatus()).transfer(new ByteArrayInputStream(content), out);
|
||||
final CountingInputStream in = new CountingInputStream(new B2ReadFeature(session, fileid).read(file, status, new DisabledConnectionCallback()));
|
||||
final CountingInputStream in = new CountingInputStream(new B2ReadFeature(session, fileid).read(file, status, ConnectionCallback.noop));
|
||||
in.close();
|
||||
assertEquals(0L, in.getByteCount(), 0L);
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -209,14 +209,14 @@ public class B2ReadFeatureTest extends AbstractB2Test {
|
||||
test.attributes().setVersionId(invalidId);
|
||||
fileid.cache(test, invalidId);
|
||||
try {
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(test, new TransferStatus().setRemote(test.attributes()), new DisabledLoginCallback());
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(test, new TransferStatus().setRemote(test.attributes()), LoginCallback.noop);
|
||||
fail();
|
||||
}
|
||||
catch(NotfoundException e) {
|
||||
//
|
||||
}
|
||||
assertNull(test.attributes().getVersionId());
|
||||
new B2DeleteFeature(session, fileid).delete(new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener()).toList(), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener()).toList(), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ package ch.cyberduck.core.b2;
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.AttributedList;
|
||||
import ch.cyberduck.core.DisabledListProgressListener;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.SimplePathPredicate;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
@@ -52,7 +52,7 @@ public class B2SearchFeatureTest extends AbstractB2Test {
|
||||
assertNotNull(feature.search(bucket, new SearchFilter(StringUtils.substring(name, 0, name.length() - 2)), new DisabledListProgressListener()).find(new SimplePathPredicate(file)));
|
||||
final Path subdir = new Path(bucket, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
|
||||
assertNull(feature.search(subdir, new SearchFilter(name), new DisabledListProgressListener()).find(new SimplePathPredicate(file)));
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -65,7 +65,7 @@ public class B2SearchFeatureTest extends AbstractB2Test {
|
||||
assertNotNull(feature.search(bucket, new SearchFilter(name), new DisabledListProgressListener()).find(new SimplePathPredicate(file)));
|
||||
assertNotNull(feature.search(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), new SearchFilter(StringUtils.substring(name, 2)), new DisabledListProgressListener()).find(new SimplePathPredicate(file)));
|
||||
assertNotNull(feature.search(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), new SearchFilter(StringUtils.substring(name, 0, name.length() - 2)), new DisabledListProgressListener()).find(new SimplePathPredicate(file)));
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -91,6 +91,6 @@ public class B2SearchFeatureTest extends AbstractB2Test {
|
||||
assertNotNull(result.find(new SimplePathPredicate(filesubdir)));
|
||||
assertEquals(subdir, result.find(new SimplePathPredicate(filesubdir)).getParent());
|
||||
}
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(file, filesubdir, subdir), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(file, filesubdir, subdir), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,10 +16,9 @@ package ch.cyberduck.core.b2;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.Credentials;
|
||||
import ch.cyberduck.core.DisabledCancelCallback;
|
||||
import ch.cyberduck.core.DisabledHostKeyCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.Host;
|
||||
import ch.cyberduck.core.HostKeyCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.ProtocolFactory;
|
||||
import ch.cyberduck.core.Session;
|
||||
import ch.cyberduck.core.exception.LoginFailureException;
|
||||
@@ -31,6 +30,7 @@ import ch.cyberduck.core.proxy.DisabledProxyFinder;
|
||||
import ch.cyberduck.core.serializer.impl.dd.ProfilePlistReader;
|
||||
import ch.cyberduck.core.ssl.DefaultX509KeyManager;
|
||||
import ch.cyberduck.core.ssl.DefaultX509TrustManager;
|
||||
import ch.cyberduck.core.threading.CancelCallback;
|
||||
import ch.cyberduck.test.IntegrationTest;
|
||||
|
||||
import org.junit.Test;
|
||||
@@ -61,7 +61,7 @@ public class B2SessionTest {
|
||||
System.getProperties().getProperty("b2.user"), "s"
|
||||
));
|
||||
final B2Session session = new B2Session(host, new DefaultX509TrustManager(), new DefaultX509KeyManager());
|
||||
session.open(new DisabledProxyFinder(), new DisabledHostKeyCallback(), new DisabledLoginCallback(), new DisabledCancelCallback());
|
||||
session.login(new DisabledLoginCallback(), new DisabledCancelCallback());
|
||||
session.open(new DisabledProxyFinder(), HostKeyCallback.noop, LoginCallback.noop, CancelCallback.noop);
|
||||
session.login(LoginCallback.noop, CancelCallback.noop);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,17 +16,17 @@ package ch.cyberduck.core.b2;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.Local;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.io.BandwidthThrottle;
|
||||
import ch.cyberduck.core.io.Checksum;
|
||||
import ch.cyberduck.core.io.DisabledStreamListener;
|
||||
import ch.cyberduck.core.io.SHA1ChecksumCompute;
|
||||
import ch.cyberduck.core.io.StreamCopier;
|
||||
import ch.cyberduck.core.io.StreamListener;
|
||||
import ch.cyberduck.core.transfer.TransferStatus;
|
||||
import ch.cyberduck.test.IntegrationTest;
|
||||
|
||||
@@ -62,19 +62,19 @@ public class B2SingleUploadServiceTest extends AbstractB2Test {
|
||||
status.setChecksum(checksum);
|
||||
final B2VersionIdProvider fileid = new B2VersionIdProvider(session);
|
||||
final B2SingleUploadService upload = new B2SingleUploadService(session);
|
||||
upload.upload(new B2WriteFeature(session, fileid), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(),
|
||||
status, new DisabledConnectionCallback());
|
||||
upload.upload(new B2WriteFeature(session, fileid), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), ProgressListener.noop, StreamListener.noop,
|
||||
status, ConnectionCallback.noop);
|
||||
assertEquals(checksum, new B2AttributesFinderFeature(session, fileid).find(test).getChecksum());
|
||||
status.validate();
|
||||
assertTrue(status.isComplete());
|
||||
assertTrue(new B2FindFeature(session, fileid).find(test));
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(test, new TransferStatus(), new DisabledConnectionCallback());
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(test, new TransferStatus(), ConnectionCallback.noop);
|
||||
final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
|
||||
new StreamCopier(status, status).transfer(in, buffer);
|
||||
in.close();
|
||||
buffer.close();
|
||||
assertArrayEquals(content, buffer.toByteArray());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
local.delete();
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ package ch.cyberduck.core.b2;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.io.DisabledStreamListener;
|
||||
import ch.cyberduck.core.io.StreamCopier;
|
||||
import ch.cyberduck.core.io.StreamListener;
|
||||
import ch.cyberduck.core.transfer.TransferStatus;
|
||||
import ch.cyberduck.test.IntegrationTest;
|
||||
|
||||
@@ -48,22 +48,22 @@ public class B2ThresholdCopyFeatureTest extends AbstractB2Test{
|
||||
final String name = new AlphanumericRandomStringService().random();
|
||||
final byte[] content = RandomUtils.nextBytes(6 * 1000 * 1000);
|
||||
final Path test = new Path(container, name, EnumSet.of(Path.Type.file));
|
||||
final OutputStream out = new B2WriteFeature(session, fileid).write(test, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final OutputStream out = new B2WriteFeature(session, fileid).write(test, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
new StreamCopier(new TransferStatus(), new TransferStatus().setLength(content.length)).transfer(new ByteArrayInputStream(content), out);
|
||||
out.close();
|
||||
assertTrue(new B2FindFeature(session, fileid).find(test));
|
||||
final B2ThresholdCopyFeature feature = new B2ThresholdCopyFeature(session, fileid, 5 * 1000L * 1000L);
|
||||
final Path copy = feature.copy(test, new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)),
|
||||
new TransferStatus().setLength(content.length), new DisabledConnectionCallback(), new DisabledStreamListener());
|
||||
new TransferStatus().setLength(content.length), ConnectionCallback.noop, StreamListener.noop);
|
||||
assertNotEquals(test.attributes().getVersionId(), copy.attributes().getVersionId());
|
||||
assertTrue(new B2FindFeature(session, fileid).find(new Path(container, name, EnumSet.of(Path.Type.file))));
|
||||
assertTrue(new B2FindFeature(session, fileid).find(copy));
|
||||
final byte[] compare = new byte[content.length];
|
||||
final InputStream stream = new B2ReadFeature(session, fileid).read(copy, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream stream = new B2ReadFeature(session, fileid).read(copy, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
IOUtils.readFully(stream, compare);
|
||||
stream.close();
|
||||
assertArrayEquals(content, compare);
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, copy), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, copy), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -73,21 +73,21 @@ public class B2ThresholdCopyFeatureTest extends AbstractB2Test{
|
||||
final String name = new AlphanumericRandomStringService().random();
|
||||
final byte[] content = RandomUtils.nextBytes(4 * 1000 * 1000);
|
||||
final Path test = new Path(container, name, EnumSet.of(Path.Type.file));
|
||||
final OutputStream out = new B2WriteFeature(session, fileid).write(test, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final OutputStream out = new B2WriteFeature(session, fileid).write(test, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
new StreamCopier(new TransferStatus(), new TransferStatus().setLength(content.length)).transfer(new ByteArrayInputStream(content), out);
|
||||
out.close();
|
||||
assertTrue(new B2FindFeature(session, fileid).find(test));
|
||||
final B2ThresholdCopyFeature feature = new B2ThresholdCopyFeature(session, fileid, 5 * 1000L * 1000L);
|
||||
final Path copy = feature.copy(test, new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)),
|
||||
new TransferStatus().setLength(content.length), new DisabledConnectionCallback(), new DisabledStreamListener());
|
||||
new TransferStatus().setLength(content.length), ConnectionCallback.noop, StreamListener.noop);
|
||||
assertNotEquals(test.attributes().getVersionId(), copy.attributes().getVersionId());
|
||||
assertTrue(new B2FindFeature(session, fileid).find(new Path(container, name, EnumSet.of(Path.Type.file))));
|
||||
assertTrue(new B2FindFeature(session, fileid).find(copy));
|
||||
final byte[] compare = new byte[content.length];
|
||||
final InputStream stream = new B2ReadFeature(session, fileid).read(copy, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream stream = new B2ReadFeature(session, fileid).read(copy, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
IOUtils.readFully(stream, compare);
|
||||
stream.close();
|
||||
assertArrayEquals(content, compare);
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, copy), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(test, copy), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ package ch.cyberduck.core.b2;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DescriptiveUrl;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.transfer.TransferStatus;
|
||||
@@ -45,6 +45,6 @@ public class B2UrlProviderTest extends AbstractB2Test {
|
||||
assertEquals(0, provider.toUrl(bucket).size());
|
||||
assertEquals(1, provider.toUrl(test).size());
|
||||
assertNotNull(provider.toUrl(test).find(DescriptiveUrl.Type.http).getUrl());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ package ch.cyberduck.core.b2;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DefaultPathAttributes;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.exception.NotfoundException;
|
||||
@@ -58,7 +58,7 @@ public class B2VersionIdProviderTest extends AbstractB2Test {
|
||||
duplicate.setDuplicate(true);
|
||||
fileid.cache(new Path(file).withAttributes(duplicate), "d");
|
||||
assertEquals(versionId, fileid.getVersionId(file));
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(bucket, file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(bucket, file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -67,7 +67,7 @@ public class B2VersionIdProviderTest extends AbstractB2Test {
|
||||
final Path bucket = new B2DirectoryFeature(session, fileid).mkdir(new B2WriteFeature(session, fileid), new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), new TransferStatus());
|
||||
final Path folder = new B2DirectoryFeature(session, fileid).mkdir(new B2WriteFeature(session, fileid), new Path(bucket, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
|
||||
assertNotNull(fileid.getVersionId(folder));
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(folder, bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(folder, bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -17,10 +17,10 @@ package ch.cyberduck.core.b2;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.AttributedList;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DefaultPathAttributes;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledListProgressListener;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
@@ -57,7 +57,7 @@ public class B2VersioningFeatureTest extends AbstractB2Test {
|
||||
final byte[] content = RandomUtils.nextBytes(245);
|
||||
final TransferStatus status = new TransferStatus().setLength(content.length);
|
||||
final B2WriteFeature writer = new B2WriteFeature(session, fileid);
|
||||
final HttpResponseOutputStream<BaseB2Response> out = writer.write(ignored, status, new DisabledConnectionCallback());
|
||||
final HttpResponseOutputStream<BaseB2Response> out = writer.write(ignored, status, ConnectionCallback.noop);
|
||||
new StreamCopier(status, status).transfer(new ByteArrayInputStream(content), out);
|
||||
}
|
||||
assertTrue(new B2FindFeature(session, fileid).find(ignored));
|
||||
@@ -68,7 +68,7 @@ public class B2VersioningFeatureTest extends AbstractB2Test {
|
||||
status.setLength(content.length);
|
||||
status.setExists(true);
|
||||
final B2WriteFeature writer = new B2WriteFeature(session, fileid);
|
||||
final StatusOutputStream<BaseB2Response> out = writer.write(test, status, new DisabledConnectionCallback());
|
||||
final StatusOutputStream<BaseB2Response> out = writer.write(test, status, ConnectionCallback.noop);
|
||||
assertNotNull(out);
|
||||
new StreamCopier(status, status).transfer(new ByteArrayInputStream(content), out);
|
||||
assertNotNull(test.attributes().getVersionId());
|
||||
@@ -89,8 +89,8 @@ public class B2VersioningFeatureTest extends AbstractB2Test {
|
||||
assertEquals(status.getResponse().getVersionId(), versions.get(0).attributes().getVersionId());
|
||||
assertEquals(initialVersion, versions.get(1).attributes().getVersionId());
|
||||
for(Path version : new B2ListService(session, fileid).list(room, new DisabledListProgressListener())) {
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(version), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(version), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(room), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(room), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
@@ -15,9 +15,9 @@ package ch.cyberduck.core.b2;
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledListProgressListener;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.exception.ChecksumException;
|
||||
@@ -58,7 +58,7 @@ public class B2WriteFeatureTest extends AbstractB2Test {
|
||||
final byte[] content = RandomUtils.nextBytes(1);
|
||||
status.setLength(content.length);
|
||||
status.setChecksum(Checksum.parse("da39a3ee5e6b4b0d3255bfef95601890afd80709"));
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, new B2VersionIdProvider(session)).write(file, status, new DisabledConnectionCallback());
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, new B2VersionIdProvider(session)).write(file, status, ConnectionCallback.noop);
|
||||
IOUtils.write(content, out);
|
||||
try {
|
||||
out.close();
|
||||
@@ -80,7 +80,7 @@ public class B2WriteFeatureTest extends AbstractB2Test {
|
||||
status.setLength(content.length);
|
||||
status.setChecksum(new SHA1ChecksumCompute().compute(new ByteArrayInputStream(content), status));
|
||||
status.setModified(1503654614004L);
|
||||
final StatusOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(test, status, new DisabledConnectionCallback());
|
||||
final StatusOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(test, status, ConnectionCallback.noop);
|
||||
assertNotNull(out);
|
||||
new StreamCopier(new TransferStatus(), new TransferStatus()).transfer(new ByteArrayInputStream(content), out);
|
||||
final BaseB2Response response = out.getStatus();
|
||||
@@ -94,16 +94,16 @@ public class B2WriteFeatureTest extends AbstractB2Test {
|
||||
assertEquals(new B2AttributesFinderFeature(session, fileid).toAttributes(response), attributes);
|
||||
assertEquals(bucketAttr, new B2AttributesFinderFeature(session, fileid).find(bucket));
|
||||
final byte[] buffer = new byte[content.length];
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(test, new TransferStatus(), new DisabledConnectionCallback());
|
||||
final InputStream in = new B2ReadFeature(session, fileid).read(test, new TransferStatus(), ConnectionCallback.noop);
|
||||
IOUtils.readFully(in, buffer);
|
||||
in.close();
|
||||
assertArrayEquals(content, buffer);
|
||||
assertEquals(1503654614004L, new B2AttributesFinderFeature(session, fileid).find(test).getModificationDate());
|
||||
final byte[] overwriteContent = RandomUtils.nextBytes(5);
|
||||
final StatusOutputStream<BaseB2Response> overwrite = new B2WriteFeature(session, fileid).write(test, new TransferStatus().setExists(true).setLength(overwriteContent.length), new DisabledConnectionCallback());
|
||||
final StatusOutputStream<BaseB2Response> overwrite = new B2WriteFeature(session, fileid).write(test, new TransferStatus().setExists(true).setLength(overwriteContent.length), ConnectionCallback.noop);
|
||||
new StreamCopier(new TransferStatus(), new TransferStatus()).transfer(new ByteArrayInputStream(overwriteContent), overwrite);
|
||||
assertNotEquals(new B2AttributesFinderFeature(session, fileid).toAttributes(response), new B2AttributesFinderFeature(session, fileid).toAttributes(overwrite.getStatus()));
|
||||
assertNotEquals(((B2FileResponse) response).getFileId(), ((B2FileResponse) overwrite.getStatus()).getFileId());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ package ch.cyberduck.core.cryptomator;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledListProgressListener;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.VersioningConfiguration;
|
||||
import ch.cyberduck.core.b2.AbstractB2Test;
|
||||
@@ -75,10 +75,10 @@ public class B2DirectoryFeatureTest extends AbstractB2Test {
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(test));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(test));
|
||||
assertEquals(versionId, cryptomator.getFeature(session, AttributesFinder.class, new B2AttributesFinderFeature(session, fileid)).find(test).getVersionId());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertTrue(new CryptoListService(session, new B2ObjectListService(session, fileid, 1, VersioningConfiguration.empty()), cryptomator).list(vault, new DisabledListProgressListener())
|
||||
.toStream().filter(f -> !f.attributes().isDuplicate()).collect(Collectors.toList()).isEmpty());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Collections.singletonList(vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Collections.singletonList(vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -93,6 +93,6 @@ public class B2DirectoryFeatureTest extends AbstractB2Test {
|
||||
final Path test = cryptomator.getFeature(session, Directory.class, new B2DirectoryFeature(session, fileid)).mkdir(
|
||||
cryptomator.getFeature(session, Write.class, new B2WriteFeature(session, fileid)), new Path(vault, new AlphanumericRandomStringService(130).random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(test));
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -17,12 +17,12 @@ package ch.cyberduck.core.cryptomator;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.BytecountStreamListener;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.Local;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.b2.AbstractB2Test;
|
||||
import ch.cyberduck.core.b2.B2AttributesFinderFeature;
|
||||
import ch.cyberduck.core.b2.B2DeleteFeature;
|
||||
@@ -93,17 +93,17 @@ public class B2LargeUploadServiceTest extends AbstractB2Test {
|
||||
writeStatus.setLength(content.length);
|
||||
final Path test = new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
final BytecountStreamListener counter = new BytecountStreamListener();
|
||||
service.upload(new CryptoWriteFeature<>(session, new B2WriteFeature(session, fileid), cryptomator), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), counter, writeStatus, new DisabledConnectionCallback());
|
||||
service.upload(new CryptoWriteFeature<>(session, new B2WriteFeature(session, fileid), cryptomator), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), ProgressListener.noop, counter, writeStatus, ConnectionCallback.noop);
|
||||
assertEquals(content.length, counter.getSent());
|
||||
assertTrue(writeStatus.isComplete());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(test));
|
||||
assertEquals(content.length, cryptomator.getFeature(session, AttributesFinder.class, new B2AttributesFinderFeature(session, fileid)).find(test).getSize());
|
||||
final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
|
||||
final TransferStatus readStatus = new TransferStatus().setLength(content.length);
|
||||
final InputStream in = new CryptoReadFeature(session, new B2ReadFeature(session, fileid), cryptomator).read(test, readStatus, new DisabledConnectionCallback());
|
||||
final InputStream in = new CryptoReadFeature(session, new B2ReadFeature(session, fileid), cryptomator).read(test, readStatus, ConnectionCallback.noop);
|
||||
new StreamCopier(readStatus, readStatus).transfer(in, buffer);
|
||||
assertArrayEquals(content, buffer.toByteArray());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
local.delete();
|
||||
}
|
||||
|
||||
@@ -122,24 +122,24 @@ public class B2LargeUploadServiceTest extends AbstractB2Test {
|
||||
writeStatus.setLength(content.length);
|
||||
final B2VersionIdProvider fileid = new B2VersionIdProvider(session);
|
||||
final CryptoBulkFeature<Map<TransferItem, TransferStatus>> bulk = new CryptoBulkFeature<>(session, new DisabledBulkFeature(), cryptomator);
|
||||
bulk.pre(Transfer.Type.upload, Collections.singletonMap(new TransferItem(test), writeStatus), new DisabledConnectionCallback());
|
||||
bulk.pre(Transfer.Type.upload, Collections.singletonMap(new TransferItem(test), writeStatus), ConnectionCallback.noop);
|
||||
final CryptoUploadFeature<BaseB2Response> service = new CryptoUploadFeature<>(session,
|
||||
new B2LargeUploadService(session, fileid, 5000000L, 5),
|
||||
cryptomator);
|
||||
final Local local = new Local(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString());
|
||||
IOUtils.write(content, local.getOutputStream(false));
|
||||
final BytecountStreamListener counter = new BytecountStreamListener();
|
||||
service.upload(new CryptoWriteFeature<>(session, new B2WriteFeature(session, fileid), cryptomator), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), counter, writeStatus, new DisabledConnectionCallback());
|
||||
service.upload(new CryptoWriteFeature<>(session, new B2WriteFeature(session, fileid), cryptomator), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), ProgressListener.noop, counter, writeStatus, ConnectionCallback.noop);
|
||||
assertEquals(content.length, counter.getSent());
|
||||
assertTrue(writeStatus.isComplete());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(test));
|
||||
assertEquals(content.length, cryptomator.getFeature(session, AttributesFinder.class, new B2AttributesFinderFeature(session, fileid)).find(test).getSize());
|
||||
final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
|
||||
final TransferStatus readStatus = new TransferStatus().setLength(content.length);
|
||||
final InputStream in = new CryptoReadFeature(session, new B2ReadFeature(session, fileid), cryptomator).read(test, readStatus, new DisabledConnectionCallback());
|
||||
final InputStream in = new CryptoReadFeature(session, new B2ReadFeature(session, fileid), cryptomator).read(test, readStatus, ConnectionCallback.noop);
|
||||
new StreamCopier(readStatus, readStatus).transfer(in, buffer);
|
||||
assertArrayEquals(content, buffer.toByteArray());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
local.delete();
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -16,9 +16,9 @@ package ch.cyberduck.core.cryptomator;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.b2.AbstractB2Test;
|
||||
import ch.cyberduck.core.b2.B2DeleteFeature;
|
||||
@@ -73,17 +73,17 @@ public class B2LargeUploadWriteFeatureTest extends AbstractB2Test {
|
||||
writeStatus.setNonces(new RandomNonceGenerator(cryptomator.getNonceSize()));
|
||||
writeStatus.setLength(-1L);
|
||||
final Path test = new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
final OutputStream out = feature.write(test, writeStatus, new DisabledConnectionCallback());
|
||||
final OutputStream out = feature.write(test, writeStatus, ConnectionCallback.noop);
|
||||
final byte[] content = RandomUtils.nextBytes(6 * 1024 * 1024);
|
||||
final ByteArrayInputStream in = new ByteArrayInputStream(content);
|
||||
final TransferStatus progress = new TransferStatus();
|
||||
new StreamCopier(new TransferStatus(), progress).transfer(in, out);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(test));
|
||||
final byte[] compare = new byte[content.length];
|
||||
final InputStream stream = new CryptoReadFeature(session, new B2ReadFeature(session, fileid), cryptomator).read(test, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream stream = new CryptoReadFeature(session, new B2ReadFeature(session, fileid), cryptomator).read(test, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
IOUtils.readFully(stream, compare);
|
||||
stream.close();
|
||||
assertArrayEquals(content, compare);
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ package ch.cyberduck.core.cryptomator;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledListProgressListener;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.b2.AbstractB2Test;
|
||||
import ch.cyberduck.core.b2.B2DeleteFeature;
|
||||
@@ -67,6 +67,6 @@ public class B2ListServiceTest extends AbstractB2Test {
|
||||
new CryptoWriteFeature<>(session, new B2WriteFeature(session, fileid), cryptomator), new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
|
||||
test.attributes().setVersionId(new CryptoVersionIdProvider(session, fileid, cryptomator).getVersionId(test));
|
||||
assertEquals(test, new CryptoListService(session, new B2ListService(session, fileid), cryptomator).list(vault, new DisabledListProgressListener()).get(0));
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ package ch.cyberduck.core.cryptomator;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.b2.AbstractB2Test;
|
||||
import ch.cyberduck.core.b2.B2AttributesFinderFeature;
|
||||
@@ -72,7 +72,7 @@ public class B2TouchFeatureTest extends AbstractB2Test {
|
||||
assertNotNull(test.attributes().getVersionId());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(test));
|
||||
assertEquals(test.attributes(), cryptomator.getFeature(session, AttributesFinder.class, new B2AttributesFinderFeature(session, fileid)).find(test));
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -90,7 +90,7 @@ public class B2TouchFeatureTest extends AbstractB2Test {
|
||||
assertEquals(0L, test.attributes().getSize());
|
||||
assertEquals(0L, status.getResponse().getSize());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(test));
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -108,6 +108,6 @@ public class B2TouchFeatureTest extends AbstractB2Test {
|
||||
assertEquals(0L, status.getResponse().getSize());
|
||||
assertNotNull(test.attributes().getVersionId());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(test));
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ package ch.cyberduck.core.cryptomator;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.b2.AbstractB2Test;
|
||||
@@ -80,7 +80,7 @@ public class B2WriteFeatureTest extends AbstractB2Test {
|
||||
status.setHeader(cryptomator.getFileHeaderCryptor().encryptHeader(header));
|
||||
status.setNonces(new RotatingNonceGenerator(cryptomator.getNonceSize(), cryptomator.numberOfChunks(content.length)));
|
||||
status.setChecksum(writer.checksum(test, status).compute(new ByteArrayInputStream(content), status));
|
||||
final OutputStream out = writer.write(test, status, new DisabledConnectionCallback());
|
||||
final OutputStream out = writer.write(test, status, ConnectionCallback.noop);
|
||||
assertNotNull(out);
|
||||
new StreamCopier(status, status).transfer(new ByteArrayInputStream(content), out);
|
||||
out.close();
|
||||
@@ -88,9 +88,9 @@ public class B2WriteFeatureTest extends AbstractB2Test {
|
||||
final PathAttributes attributes = cryptomator.getFeature(session, AttributesFinder.class, new B2AttributesFinderFeature(session, fileid)).find(test);
|
||||
assertEquals(content.length, attributes.getSize());
|
||||
final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
|
||||
final InputStream in = new CryptoReadFeature(session, new B2ReadFeature(session, fileid), cryptomator).read(test, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream in = new CryptoReadFeature(session, new B2ReadFeature(session, fileid), cryptomator).read(test, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
new StreamCopier(status, status).transfer(in, buffer);
|
||||
assertArrayEquals(content, buffer.toByteArray());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,12 +16,12 @@ package ch.cyberduck.core.cryptomator;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathCache;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.b2.AbstractB2Test;
|
||||
import ch.cyberduck.core.b2.B2DirectoryFeature;
|
||||
import ch.cyberduck.core.b2.B2FindFeature;
|
||||
@@ -85,17 +85,17 @@ public class CopyWorkerTest extends AbstractB2Test {
|
||||
final byte[] content = RandomUtils.nextBytes(40500);
|
||||
final TransferStatus status = new TransferStatus();
|
||||
final B2VersionIdProvider fileid = new B2VersionIdProvider(session);
|
||||
new CryptoBulkFeature<>(session, new DisabledBulkFeature(), cryptomator).pre(Transfer.Type.upload, Collections.singletonMap(new TransferItem(source), status), new DisabledConnectionCallback());
|
||||
new StreamCopier(new TransferStatus(), new TransferStatus()).transfer(new ByteArrayInputStream(content), new CryptoWriteFeature<>(session, new B2WriteFeature(session, fileid), cryptomator).write(source, status.setLength(content.length), new DisabledConnectionCallback()));
|
||||
new CryptoBulkFeature<>(session, new DisabledBulkFeature(), cryptomator).pre(Transfer.Type.upload, Collections.singletonMap(new TransferItem(source), status), ConnectionCallback.noop);
|
||||
new StreamCopier(new TransferStatus(), new TransferStatus()).transfer(new ByteArrayInputStream(content), new CryptoWriteFeature<>(session, new B2WriteFeature(session, fileid), cryptomator).write(source, status.setLength(content.length), ConnectionCallback.noop));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(source));
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(source, target), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback());
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(source, target), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(source));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(target));
|
||||
final ByteArrayOutputStream out = new ByteArrayOutputStream(content.length);
|
||||
assertEquals(content.length, IOUtils.copy(new CryptoReadFeature(session, new B2ReadFeature(session, fileid), cryptomator).read(target, new TransferStatus().setLength(content.length), new DisabledConnectionCallback()), out));
|
||||
assertEquals(content.length, IOUtils.copy(new CryptoReadFeature(session, new B2ReadFeature(session, fileid), cryptomator).read(target, new TransferStatus().setLength(content.length), ConnectionCallback.noop), out));
|
||||
assertArrayEquals(content, out.toByteArray());
|
||||
new DeleteWorker(new DisabledLoginCallback(), Collections.singletonList(vault), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Collections.singletonList(vault), ProgressListener.noop).run(session);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -116,12 +116,12 @@ public class CopyWorkerTest extends AbstractB2Test {
|
||||
cryptomator.getFeature(session, Directory.class, new B2DirectoryFeature(session, fileid)).mkdir(
|
||||
cryptomator.getFeature(session, Write.class, new B2WriteFeature(session, fileid)), targetFolder, new TransferStatus());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(targetFolder));
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(source, target), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback());
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(source, target), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(source));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(target));
|
||||
registry.clear();
|
||||
new DeleteWorker(new DisabledLoginCallback(), Collections.singletonList(vault), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Collections.singletonList(vault), ProgressListener.noop).run(session);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -143,12 +143,12 @@ public class CopyWorkerTest extends AbstractB2Test {
|
||||
cryptomator.getFeature(session, Directory.class, new B2DirectoryFeature(session, fileid)).mkdir(
|
||||
cryptomator.getFeature(session, Write.class, new B2WriteFeature(session, fileid)), targetFolder, new TransferStatus());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(targetFolder));
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(source, target), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback());
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(source, target), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(source));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(target));
|
||||
registry.clear();
|
||||
new DeleteWorker(new DisabledLoginCallback(), Collections.singletonList(vault), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Collections.singletonList(vault), ProgressListener.noop).run(session);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -170,18 +170,18 @@ public class CopyWorkerTest extends AbstractB2Test {
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(file));
|
||||
// copy file
|
||||
final Path fileRenamed = new Path(folder, "f1", EnumSet.of(Path.Type.file));
|
||||
new CopyWorker(Collections.singletonMap(file, fileRenamed), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback()).run(session);
|
||||
new CopyWorker(Collections.singletonMap(file, fileRenamed), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop).run(session);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(file));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(fileRenamed));
|
||||
// copy folder
|
||||
final Path folderRenamed = new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
|
||||
new CopyWorker(Collections.singletonMap(folder, folderRenamed), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback()).run(session);
|
||||
new CopyWorker(Collections.singletonMap(folder, folderRenamed), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop).run(session);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(folder));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(folderRenamed));
|
||||
final Path fileRenamedInRenamedFolder = new Path(folderRenamed, "f1", EnumSet.of(Path.Type.file));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(fileRenamedInRenamedFolder));
|
||||
registry.clear();
|
||||
new DeleteWorker(new DisabledLoginCallback(), Collections.singletonList(vault), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Collections.singletonList(vault), ProgressListener.noop).run(session);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -202,12 +202,12 @@ public class CopyWorkerTest extends AbstractB2Test {
|
||||
cryptomator.getFeature(session, Write.class, new B2WriteFeature(session, fileid)), encryptedFolder, new TransferStatus());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(encryptedFolder));
|
||||
// copy file into vault
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(cleartextFile, encryptedFile), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback());
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(cleartextFile, encryptedFile), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(new B2FindFeature(session, fileid).find(cleartextFile));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(encryptedFile));
|
||||
registry.clear();
|
||||
new DeleteWorker(new DisabledLoginCallback(), Collections.singletonList(vault), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Collections.singletonList(vault), ProgressListener.noop).run(session);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -228,14 +228,14 @@ public class CopyWorkerTest extends AbstractB2Test {
|
||||
// move directory into vault
|
||||
final Path encryptedFolder = new Path(vault, cleartextFolder.getName(), EnumSet.of(Path.Type.directory));
|
||||
final Path encryptedFile = new Path(encryptedFolder, cleartextFile.getName(), EnumSet.of(Path.Type.file));
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(cleartextFolder, encryptedFolder), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback());
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(cleartextFolder, encryptedFolder), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(encryptedFolder));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(encryptedFile));
|
||||
assertTrue(new B2FindFeature(session, fileid).find(cleartextFolder));
|
||||
assertTrue(new B2FindFeature(session, fileid).find(cleartextFile));
|
||||
registry.clear();
|
||||
new DeleteWorker(new DisabledLoginCallback(), Collections.singletonList(vault), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Collections.singletonList(vault), ProgressListener.noop).run(session);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -259,12 +259,12 @@ public class CopyWorkerTest extends AbstractB2Test {
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(encryptedFile));
|
||||
// move file outside vault
|
||||
final Path cleartextFile = new Path(clearFolder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(encryptedFile, cleartextFile), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback());
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(encryptedFile, cleartextFile), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(encryptedFile));
|
||||
assertTrue(new B2FindFeature(session, fileid).find(cleartextFile));
|
||||
registry.clear();
|
||||
new DeleteWorker(new DisabledLoginCallback(), Arrays.asList(vault, clearFolder), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Arrays.asList(vault, clearFolder), ProgressListener.noop).run(session);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -286,7 +286,7 @@ public class CopyWorkerTest extends AbstractB2Test {
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(encryptedFile));
|
||||
// copy directory outside vault
|
||||
final Path cleartextFolder = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(encryptedFolder, cleartextFolder), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback());
|
||||
final CopyWorker worker = new CopyWorker(Collections.singletonMap(encryptedFolder, cleartextFolder), new SessionPool.SingleSessionPool(session, registry), PathCache.empty(), ProgressListener.noop, ConnectionCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(encryptedFolder));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(encryptedFile));
|
||||
@@ -294,6 +294,6 @@ public class CopyWorkerTest extends AbstractB2Test {
|
||||
final Path fileRenamed = new Path(cleartextFolder, encryptedFile.getName(), EnumSet.of(Path.Type.file));
|
||||
assertTrue(new B2FindFeature(session, fileid).find(fileRenamed));
|
||||
registry.clear();
|
||||
new DeleteWorker(new DisabledLoginCallback(), Arrays.asList(cleartextFolder, vault), new DisabledProgressListener()).run(session);
|
||||
new DeleteWorker(LoginCallback.noop, Arrays.asList(cleartextFolder, vault), ProgressListener.noop).run(session);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-8
@@ -16,14 +16,14 @@ package ch.cyberduck.core.cryptomator;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.Host;
|
||||
import ch.cyberduck.core.Local;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.NullFilter;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.TestProtocol;
|
||||
import ch.cyberduck.core.b2.AbstractB2Test;
|
||||
import ch.cyberduck.core.b2.B2AttributesFinderFeature;
|
||||
@@ -35,8 +35,8 @@ import ch.cyberduck.core.cryptomator.features.CryptoReadFeature;
|
||||
import ch.cyberduck.core.features.AttributesFinder;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.features.Find;
|
||||
import ch.cyberduck.core.io.DisabledStreamListener;
|
||||
import ch.cyberduck.core.io.StreamCopier;
|
||||
import ch.cyberduck.core.io.StreamListener;
|
||||
import ch.cyberduck.core.local.DefaultLocalDirectoryFeature;
|
||||
import ch.cyberduck.core.notification.DisabledNotificationService;
|
||||
import ch.cyberduck.core.transfer.DisabledTransferErrorCallback;
|
||||
@@ -101,7 +101,7 @@ public class CryptoB2SingleTransferWorkerTest extends AbstractB2Test {
|
||||
return TransferAction.overwrite;
|
||||
}
|
||||
}, new DisabledTransferErrorCallback(),
|
||||
new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledNotificationService()) {
|
||||
ProgressListener.noop, StreamListener.noop, LoginCallback.noop, new DisabledNotificationService()) {
|
||||
|
||||
}.run(session));
|
||||
final B2VersionIdProvider fileid = new B2VersionIdProvider(session);
|
||||
@@ -109,18 +109,18 @@ public class CryptoB2SingleTransferWorkerTest extends AbstractB2Test {
|
||||
assertEquals(content.length, cryptomator.getFeature(session, AttributesFinder.class, new B2AttributesFinderFeature(session, fileid)).find(file1).getSize());
|
||||
{
|
||||
final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
|
||||
final InputStream in = new CryptoReadFeature(session, new B2ReadFeature(session, fileid), cryptomator).read(file1, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream in = new CryptoReadFeature(session, new B2ReadFeature(session, fileid), cryptomator).read(file1, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
new StreamCopier(new TransferStatus(), new TransferStatus()).transfer(in, buffer);
|
||||
assertArrayEquals(content, buffer.toByteArray());
|
||||
}
|
||||
assertEquals(content.length, cryptomator.getFeature(session, AttributesFinder.class, new B2AttributesFinderFeature(session, fileid)).find(file2).getSize());
|
||||
{
|
||||
final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
|
||||
final InputStream in = new CryptoReadFeature(session, new B2ReadFeature(session, fileid), cryptomator).read(file1, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream in = new CryptoReadFeature(session, new B2ReadFeature(session, fileid), cryptomator).read(file1, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
new StreamCopier(new TransferStatus(), new TransferStatus()).transfer(in, buffer);
|
||||
assertArrayEquals(content, buffer.toByteArray());
|
||||
}
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(file1, file2, dir1, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(file1, file2, dir1, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
localFile1.delete();
|
||||
localFile2.delete();
|
||||
localDirectory1.delete();
|
||||
|
||||
@@ -16,11 +16,11 @@ package ch.cyberduck.core.cryptomator;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathCache;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.b2.AbstractB2Test;
|
||||
import ch.cyberduck.core.b2.B2DeleteFeature;
|
||||
import ch.cyberduck.core.b2.B2DirectoryFeature;
|
||||
@@ -76,11 +76,11 @@ public class MoveWorkerTest extends AbstractB2Test {
|
||||
cryptomator.getFeature(session, Write.class, new B2WriteFeature(session, fileid)), encryptedFolder, new TransferStatus());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(encryptedFolder));
|
||||
// move file into vault
|
||||
final MoveWorker worker = new MoveWorker(Collections.singletonMap(clearFile, encryptedFile), new SessionPool.SingleSessionPool(session), PathCache.empty(), new DisabledProgressListener(), new DisabledLoginCallback());
|
||||
final MoveWorker worker = new MoveWorker(Collections.singletonMap(clearFile, encryptedFile), new SessionPool.SingleSessionPool(session), PathCache.empty(), ProgressListener.noop, LoginCallback.noop);
|
||||
worker.run(session);
|
||||
assertFalse(new DefaultFindFeature(session).find(clearFile));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(encryptedFile));
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(encryptedFile, encryptedFolder, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(encryptedFile, encryptedFolder, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
registry.clear();
|
||||
}
|
||||
|
||||
@@ -102,13 +102,13 @@ public class MoveWorkerTest extends AbstractB2Test {
|
||||
// move directory into vault
|
||||
final Path encryptedFolder = new Path(vault, clearFolder.getName(), EnumSet.of(Path.Type.directory));
|
||||
final Path encryptedFile = new Path(encryptedFolder, clearFile.getName(), EnumSet.of(Path.Type.file));
|
||||
final MoveWorker worker = new MoveWorker(Collections.singletonMap(clearFolder, encryptedFolder), new SessionPool.SingleSessionPool(session), PathCache.empty(), new DisabledProgressListener(), new DisabledLoginCallback());
|
||||
final MoveWorker worker = new MoveWorker(Collections.singletonMap(clearFolder, encryptedFolder), new SessionPool.SingleSessionPool(session), PathCache.empty(), ProgressListener.noop, LoginCallback.noop);
|
||||
worker.run(session);
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(encryptedFolder));
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(encryptedFile));
|
||||
assertFalse(new DefaultFindFeature(session).find(clearFolder));
|
||||
assertThrows(NotfoundException.class, () -> new DefaultFindFeature(session).find(clearFile));
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(encryptedFile, encryptedFolder, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(encryptedFile, encryptedFolder, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
registry.clear();
|
||||
}
|
||||
|
||||
@@ -133,12 +133,12 @@ public class MoveWorkerTest extends AbstractB2Test {
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(encryptedFile));
|
||||
// move file outside vault
|
||||
final Path fileRenamed = new Path(clearFolder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
final MoveWorker worker = new MoveWorker(Collections.singletonMap(encryptedFile, fileRenamed), new SessionPool.SingleSessionPool(session), PathCache.empty(), new DisabledProgressListener(), new DisabledLoginCallback());
|
||||
final MoveWorker worker = new MoveWorker(Collections.singletonMap(encryptedFile, fileRenamed), new SessionPool.SingleSessionPool(session), PathCache.empty(), ProgressListener.noop, LoginCallback.noop);
|
||||
worker.run(session);
|
||||
assertFalse(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(encryptedFile));
|
||||
assertTrue(new DefaultFindFeature(session).find(fileRenamed));
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(encryptedFolder, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(fileRenamed, clearFolder), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(encryptedFolder, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(fileRenamed, clearFolder), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
registry.clear();
|
||||
}
|
||||
|
||||
@@ -161,15 +161,15 @@ public class MoveWorkerTest extends AbstractB2Test {
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new DefaultFindFeature(session)).find(encryptedFile));
|
||||
// move directory outside vault
|
||||
final Path directoryRenamed = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
|
||||
final MoveWorker worker = new MoveWorker(Collections.singletonMap(encryptedFolder, directoryRenamed), new SessionPool.SingleSessionPool(session), PathCache.empty(), new DisabledProgressListener(), new DisabledLoginCallback());
|
||||
final MoveWorker worker = new MoveWorker(Collections.singletonMap(encryptedFolder, directoryRenamed), new SessionPool.SingleSessionPool(session), PathCache.empty(), ProgressListener.noop, LoginCallback.noop);
|
||||
worker.run(session);
|
||||
assertFalse(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(encryptedFolder));
|
||||
assertFalse(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(encryptedFile));
|
||||
assertTrue(new B2FindFeature(session, fileid).find(directoryRenamed));
|
||||
final Path fileRenamed = new Path(directoryRenamed, encryptedFile.getName(), EnumSet.of(Path.Type.file));
|
||||
assertTrue(new B2FindFeature(session, fileid).find(fileRenamed));
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Collections.singletonList(vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(fileRenamed, directoryRenamed), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Collections.singletonList(vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Arrays.asList(fileRenamed, directoryRenamed), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
registry.clear();
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -18,8 +18,8 @@ package ch.cyberduck.core.shared;
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.Attributes;
|
||||
import ch.cyberduck.core.CachingAttributesFinderFeature;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ListProgressListener;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.PathCache;
|
||||
@@ -90,6 +90,6 @@ public class CachingAttributesFinderFeatureTest extends AbstractB2Test {
|
||||
catch(NotfoundException e) {
|
||||
// Expected
|
||||
}
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ package ch.cyberduck.core.shared;
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.CachingAttributesFinderFeature;
|
||||
import ch.cyberduck.core.CachingFindFeature;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ListProgressListener;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.PathCache;
|
||||
@@ -59,7 +59,7 @@ public class CachingFindFeatureTest extends AbstractB2Test {
|
||||
assertTrue(f.find(test));
|
||||
// Find without version id set in attributes
|
||||
assertTrue(f.find(new Path(test).withAttributes(PathAttributes.EMPTY)));
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -92,7 +92,7 @@ public class CachingFindFeatureTest extends AbstractB2Test {
|
||||
}).find(new Path(test).withAttributes(PathAttributes.EMPTY)));
|
||||
// Test wrong type
|
||||
assertFalse(f.find(new Path(bucket, test.getName(), EnumSet.of(Path.Type.directory))));
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(bucket), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ package ch.cyberduck.core.shared;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.b2.AbstractB2Test;
|
||||
import ch.cyberduck.core.b2.B2DeleteFeature;
|
||||
@@ -50,7 +50,7 @@ public class DefaultAttributesFinderFeatureTest extends AbstractB2Test {
|
||||
new B2TouchFeature(session, fileid).touch(new B2WriteFeature(session, fileid), file, new TransferStatus());
|
||||
// Find without version id set in attributes
|
||||
assertNotNull(new DefaultAttributesFinderFeature(session).find(file).getVersionId());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -16,9 +16,9 @@ package ch.cyberduck.core.shared;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.Local;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.b2.AbstractB2Test;
|
||||
import ch.cyberduck.core.b2.B2DeleteFeature;
|
||||
@@ -29,8 +29,8 @@ import ch.cyberduck.core.b2.B2WriteFeature;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.http.HttpResponseOutputStream;
|
||||
import ch.cyberduck.core.io.BandwidthThrottle;
|
||||
import ch.cyberduck.core.io.DisabledStreamListener;
|
||||
import ch.cyberduck.core.io.StreamCopier;
|
||||
import ch.cyberduck.core.io.StreamListener;
|
||||
import ch.cyberduck.core.transfer.TransferStatus;
|
||||
import ch.cyberduck.test.IntegrationTest;
|
||||
|
||||
@@ -65,7 +65,7 @@ public class DefaultDownloadFeatureTest extends AbstractB2Test {
|
||||
new Random().nextBytes(content);
|
||||
{
|
||||
final TransferStatus status = new TransferStatus().setLength(content.length);
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(test, status, new DisabledConnectionCallback());
|
||||
final HttpResponseOutputStream<BaseB2Response> out = new B2WriteFeature(session, fileid).write(test, status, ConnectionCallback.noop);
|
||||
assertNotNull(out);
|
||||
new StreamCopier(status, status).withLimit(new Long(content.length)).transfer(new ByteArrayInputStream(content), out);
|
||||
out.close();
|
||||
@@ -74,15 +74,15 @@ public class DefaultDownloadFeatureTest extends AbstractB2Test {
|
||||
final Local local = new Local(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString());
|
||||
final TransferStatus status = new TransferStatus().setLength(content.length);
|
||||
new DefaultDownloadFeature(session).download(
|
||||
new B2ReadFeature(session, fileid), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(),
|
||||
new B2ReadFeature(session, fileid), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), StreamListener.noop,
|
||||
status,
|
||||
new DisabledConnectionCallback());
|
||||
ConnectionCallback.noop);
|
||||
final byte[] buffer = new byte[content.length];
|
||||
final InputStream in = local.getInputStream();
|
||||
IOUtils.readFully(in, buffer);
|
||||
in.close();
|
||||
assertArrayEquals(content, buffer);
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -95,7 +95,7 @@ public class DefaultDownloadFeatureTest extends AbstractB2Test {
|
||||
new Random().nextBytes(content);
|
||||
{
|
||||
final TransferStatus status = new TransferStatus().setLength(content.length);
|
||||
final OutputStream out = new B2WriteFeature(session, fileid).write(test, status, new DisabledConnectionCallback());
|
||||
final OutputStream out = new B2WriteFeature(session, fileid).write(test, status, ConnectionCallback.noop);
|
||||
assertNotNull(out);
|
||||
new StreamCopier(status, status).withLimit(new Long(content.length)).transfer(new ByteArrayInputStream(content), out);
|
||||
out.close();
|
||||
@@ -104,15 +104,15 @@ public class DefaultDownloadFeatureTest extends AbstractB2Test {
|
||||
{
|
||||
final TransferStatus status = new TransferStatus().setLength(-1L);
|
||||
new DefaultDownloadFeature(session).download(
|
||||
new B2ReadFeature(session, fileid), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(),
|
||||
new B2ReadFeature(session, fileid), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), StreamListener.noop,
|
||||
status,
|
||||
new DisabledConnectionCallback());
|
||||
ConnectionCallback.noop);
|
||||
}
|
||||
final byte[] buffer = new byte[content.length];
|
||||
final InputStream in = local.getInputStream();
|
||||
IOUtils.readFully(in, buffer);
|
||||
in.close();
|
||||
assertArrayEquals(content, buffer);
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ package ch.cyberduck.core.shared;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.b2.AbstractB2Test;
|
||||
import ch.cyberduck.core.b2.B2DeleteFeature;
|
||||
@@ -55,14 +55,14 @@ public class DefaultFindFeatureTest extends AbstractB2Test {
|
||||
// Find without version id set in attributes
|
||||
assertTrue(new DefaultFindFeature(session).find(file));
|
||||
assertTrue(new DefaultFindFeature(session).find(test));
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFindLargeUpload() throws Exception {
|
||||
final Path bucket = new Path("test-cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
|
||||
final Path file = new Path(bucket, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
final StatusOutputStream<BaseB2Response> out = new B2LargeUploadWriteFeature(session, new B2VersionIdProvider(session)).write(file, new TransferStatus(), new DisabledConnectionCallback());
|
||||
final StatusOutputStream<BaseB2Response> out = new B2LargeUploadWriteFeature(session, new B2VersionIdProvider(session)).write(file, new TransferStatus(), ConnectionCallback.noop);
|
||||
IOUtils.copyLarge(new ByteArrayInputStream(RandomUtils.nextBytes(100)), out);
|
||||
out.close();
|
||||
assertTrue(new DefaultFindFeature(session).find(file));
|
||||
|
||||
+9
-9
@@ -16,17 +16,17 @@ package ch.cyberduck.core.worker;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.BytecountStreamListener;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.Credentials;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledHostKeyCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.DisabledTranscriptListener;
|
||||
import ch.cyberduck.core.Host;
|
||||
import ch.cyberduck.core.HostKeyCallback;
|
||||
import ch.cyberduck.core.Local;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.LoginConnectionService;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.ProtocolFactory;
|
||||
import ch.cyberduck.core.Session;
|
||||
import ch.cyberduck.core.b2.AbstractB2Test;
|
||||
@@ -110,10 +110,10 @@ public class B2ConcurrentTransferWorkerTest extends AbstractB2Test {
|
||||
return super.getProperty(key);
|
||||
}
|
||||
};
|
||||
final LoginConnectionService connect = new LoginConnectionService(new DisabledLoginCallback(),
|
||||
new DisabledHostKeyCallback(),
|
||||
final LoginConnectionService connect = new LoginConnectionService(LoginCallback.noop,
|
||||
HostKeyCallback.noop,
|
||||
new TestPasswordStore(),
|
||||
new DisabledProgressListener());
|
||||
ProgressListener.noop);
|
||||
final DefaultSessionPool pool = new DefaultSessionPool(connect,
|
||||
new DefaultVaultRegistry(new DisabledPasswordCallback()), new DisabledTranscriptListener(), host,
|
||||
new GenericObjectPool<>(new PooledSessionFactory(connect, new DisabledX509TrustManager(), new DefaultX509KeyManager(),
|
||||
@@ -171,7 +171,7 @@ public class B2ConcurrentTransferWorkerTest extends AbstractB2Test {
|
||||
public boolean prompt(final TransferItem item, final TransferStatus status, final BackgroundException failure, final int pending) {
|
||||
return true;
|
||||
}
|
||||
}, new DisabledConnectionCallback(), new DisabledProgressListener(), counter, new DisabledNotificationService());
|
||||
}, ConnectionCallback.noop, ProgressListener.noop, counter, new DisabledNotificationService());
|
||||
|
||||
assertTrue(worker.run(session));
|
||||
local.delete();
|
||||
@@ -181,6 +181,6 @@ public class B2ConcurrentTransferWorkerTest extends AbstractB2Test {
|
||||
assertEquals(content.length, counter.getRecv(), 0L);
|
||||
assertEquals(content.length, counter.getSent(), 0L);
|
||||
assertTrue(failed.get());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,15 +17,14 @@ package ch.cyberduck.core.worker;
|
||||
|
||||
import ch.cyberduck.core.BytecountStreamListener;
|
||||
import ch.cyberduck.core.Credentials;
|
||||
import ch.cyberduck.core.DisabledCancelCallback;
|
||||
import ch.cyberduck.core.DisabledHostKeyCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.Host;
|
||||
import ch.cyberduck.core.HostKeyCallback;
|
||||
import ch.cyberduck.core.Local;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.LoginConnectionService;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.ProtocolFactory;
|
||||
import ch.cyberduck.core.b2.B2AttributesFinderFeature;
|
||||
import ch.cyberduck.core.b2.B2DeleteFeature;
|
||||
@@ -40,6 +39,7 @@ import ch.cyberduck.core.notification.DisabledNotificationService;
|
||||
import ch.cyberduck.core.serializer.impl.dd.ProfilePlistReader;
|
||||
import ch.cyberduck.core.ssl.DefaultX509KeyManager;
|
||||
import ch.cyberduck.core.ssl.DefaultX509TrustManager;
|
||||
import ch.cyberduck.core.threading.CancelCallback;
|
||||
import ch.cyberduck.core.transfer.DisabledTransferErrorCallback;
|
||||
import ch.cyberduck.core.transfer.DisabledTransferPrompt;
|
||||
import ch.cyberduck.core.transfer.Transfer;
|
||||
@@ -136,10 +136,10 @@ public class B2SingleTransferWorkerTest extends VaultTest {
|
||||
return super._getFeature(type);
|
||||
}
|
||||
};
|
||||
new LoginConnectionService(new DisabledLoginCallback(),
|
||||
new DisabledHostKeyCallback(),
|
||||
new LoginConnectionService(LoginCallback.noop,
|
||||
HostKeyCallback.noop,
|
||||
new TestPasswordStore(),
|
||||
new DisabledProgressListener()).check(session, new DisabledCancelCallback());
|
||||
ProgressListener.noop).check(session, CancelCallback.noop);
|
||||
final Path bucket = new Path("test-cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
|
||||
final Path test = new Path(bucket, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
|
||||
final Transfer t = new UploadTransfer(host, test, local);
|
||||
@@ -150,7 +150,7 @@ public class B2SingleTransferWorkerTest extends VaultTest {
|
||||
return TransferAction.overwrite;
|
||||
}
|
||||
}, new DisabledTransferErrorCallback(),
|
||||
new DisabledProgressListener(), counter, new DisabledLoginCallback(), new DisabledNotificationService()) {
|
||||
ProgressListener.noop, counter, LoginCallback.noop, new DisabledNotificationService()) {
|
||||
|
||||
}.run(session));
|
||||
local.delete();
|
||||
@@ -162,6 +162,6 @@ public class B2SingleTransferWorkerTest extends VaultTest {
|
||||
assertEquals(content.length, counter.getRecv(), 0L);
|
||||
assertEquals(content.length, counter.getSent(), 0L);
|
||||
assertTrue(failed.get());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new B2DeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
<parent>
|
||||
<groupId>ch.cyberduck</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>9.4.0-SNAPSHOT</version>
|
||||
<version>9.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>binding</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
@@ -89,6 +89,8 @@ public abstract class WindowController extends BundleController implements NSWin
|
||||
this.window.recalculateKeyViewLoop();
|
||||
this.window.setReleasedWhenClosed(true);
|
||||
this.window.setDelegate(this.id());
|
||||
this.window.setCollectionBehavior(window.collectionBehavior()
|
||||
| NSWindow.NSWindowCollectionBehavior.NSWindowCollectionBehaviorTransient);
|
||||
}
|
||||
|
||||
public NSWindow window() {
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<groupId>ch.cyberduck</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
<version>9.4.0-SNAPSHOT</version>
|
||||
<version>9.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>Cyberduck.Bonjour</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<groupId>ch.cyberduck</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
<version>9.4.0-SNAPSHOT</version>
|
||||
<version>9.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>Cyberduck.Bonjour.Native</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
<parent>
|
||||
<artifactId>parent</artifactId>
|
||||
<groupId>ch.cyberduck</groupId>
|
||||
<version>9.4.0-SNAPSHOT</version>
|
||||
<version>9.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
<parent>
|
||||
<artifactId>parent</artifactId>
|
||||
<groupId>ch.cyberduck</groupId>
|
||||
<version>9.4.0-SNAPSHOT</version>
|
||||
<version>9.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>box</artifactId>
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ public class BoxWriteFeature extends AbstractHttpWriteFeature<File> {
|
||||
private final BoxApiClient client;
|
||||
|
||||
public BoxWriteFeature(final BoxSession session, final BoxFileidProvider fileid) {
|
||||
super(new BoxAttributesFinderFeature(session, fileid));
|
||||
super(session.getHost(), new BoxAttributesFinderFeature(session, fileid));
|
||||
this.session = session;
|
||||
this.fileid = fileid;
|
||||
this.client = new BoxApiClient(session.getClient());
|
||||
|
||||
@@ -16,19 +16,19 @@ package ch.cyberduck.core.box;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.Credentials;
|
||||
import ch.cyberduck.core.DisabledCancelCallback;
|
||||
import ch.cyberduck.core.DisabledHostKeyCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.Host;
|
||||
import ch.cyberduck.core.HostKeyCallback;
|
||||
import ch.cyberduck.core.LoginConnectionService;
|
||||
import ch.cyberduck.core.LoginOptions;
|
||||
import ch.cyberduck.core.Profile;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.ProtocolFactory;
|
||||
import ch.cyberduck.core.cryptomator.CryptoVault;
|
||||
import ch.cyberduck.core.serializer.impl.dd.ProfilePlistReader;
|
||||
import ch.cyberduck.core.ssl.DefaultX509KeyManager;
|
||||
import ch.cyberduck.core.ssl.DefaultX509TrustManager;
|
||||
import ch.cyberduck.core.threading.CancelCallback;
|
||||
import ch.cyberduck.test.VaultTest;
|
||||
|
||||
import org.junit.After;
|
||||
@@ -70,8 +70,8 @@ public class AbstractBoxTest extends VaultTest {
|
||||
fail(reason);
|
||||
return null;
|
||||
}
|
||||
}, new DisabledHostKeyCallback(),
|
||||
new TestPasswordStore(), new DisabledProgressListener());
|
||||
login.check(session, new DisabledCancelCallback());
|
||||
}, HostKeyCallback.noop,
|
||||
new TestPasswordStore(), ProgressListener.noop);
|
||||
login.check(session, CancelCallback.noop);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ package ch.cyberduck.core.box;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.exception.NotfoundException;
|
||||
@@ -46,7 +46,7 @@ public class BoxAttributesFinderFeatureTest extends AbstractBoxTest {
|
||||
f.find(test);
|
||||
}
|
||||
finally {
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(folder), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(folder), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class BoxAttributesFinderFeatureTest extends AbstractBoxTest {
|
||||
catch(NotfoundException e) {
|
||||
// Expected
|
||||
}
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(folder), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(folder), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -110,6 +110,6 @@ public class BoxAttributesFinderFeatureTest extends AbstractBoxTest {
|
||||
catch(NotfoundException e) {
|
||||
// Expected
|
||||
}
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(folder), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(folder), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@ package ch.cyberduck.core.box;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.exception.NotfoundException;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.features.Find;
|
||||
import ch.cyberduck.core.io.DisabledStreamListener;
|
||||
import ch.cyberduck.core.io.StreamListener;
|
||||
import ch.cyberduck.core.shared.DefaultFindFeature;
|
||||
import ch.cyberduck.core.shared.DefaultHomeFinderService;
|
||||
import ch.cyberduck.core.transfer.TransferStatus;
|
||||
@@ -47,11 +47,11 @@ public class BoxCopyFeatureTest extends AbstractBoxTest {
|
||||
final Path test = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
new BoxTouchFeature(session, fileid).touch(new BoxWriteFeature(session, fileid), test, new TransferStatus());
|
||||
final Path copy = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
new BoxCopyFeature(session, fileid).copy(test, copy, new TransferStatus(), new DisabledConnectionCallback(), new DisabledStreamListener());
|
||||
new BoxCopyFeature(session, fileid).copy(test, copy, new TransferStatus(), ConnectionCallback.noop, StreamListener.noop);
|
||||
assertTrue(new BoxFindFeature(session, fileid).find(test.withAttributes(PathAttributes.EMPTY)));
|
||||
assertTrue(new BoxFindFeature(session, fileid).find(copy.withAttributes(PathAttributes.EMPTY)));
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.<Path>singletonList(copy), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.<Path>singletonList(copy), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -63,11 +63,11 @@ public class BoxCopyFeatureTest extends AbstractBoxTest {
|
||||
new BoxTouchFeature(session, fileid).touch(new BoxWriteFeature(session, fileid), test, new TransferStatus());
|
||||
final Path copy = new Path(folder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
final Path existing = new BoxTouchFeature(session, fileid).touch(new BoxWriteFeature(session, fileid), copy, new TransferStatus());
|
||||
new BoxCopyFeature(session, fileid).copy(test, copy, new TransferStatus().setExists(true).setRemote(existing.attributes()), new DisabledConnectionCallback(), new DisabledStreamListener());
|
||||
new BoxCopyFeature(session, fileid).copy(test, copy, new TransferStatus().setExists(true).setRemote(existing.attributes()), ConnectionCallback.noop, StreamListener.noop);
|
||||
final Find find = new DefaultFindFeature(session);
|
||||
assertTrue(find.find(test));
|
||||
assertTrue(find.find(copy));
|
||||
new BoxDeleteFeature(session, fileid).delete(Arrays.asList(test, copy), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Arrays.asList(test, copy), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -78,11 +78,11 @@ public class BoxCopyFeatureTest extends AbstractBoxTest {
|
||||
final String name = new AlphanumericRandomStringService().random();
|
||||
final Path file = new BoxTouchFeature(session, fileid).touch(new BoxWriteFeature(session, fileid), new Path(directory, name, EnumSet.of(Path.Type.file)), new TransferStatus());
|
||||
final Path copy = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
|
||||
new BoxCopyFeature(session, fileid).copy(directory, copy, new TransferStatus(), new DisabledConnectionCallback(), new DisabledStreamListener());
|
||||
new BoxCopyFeature(session, fileid).copy(directory, copy, new TransferStatus(), ConnectionCallback.noop, StreamListener.noop);
|
||||
assertTrue(new BoxFindFeature(session, fileid).find(file));
|
||||
assertTrue(new BoxFindFeature(session, fileid).find(copy));
|
||||
assertTrue(new BoxFindFeature(session, fileid).find(new Path(copy, name, EnumSet.of(Path.Type.file))));
|
||||
new BoxDeleteFeature(session, fileid).delete(Arrays.asList(copy, directory), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Arrays.asList(copy, directory), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test(expected = NotfoundException.class)
|
||||
@@ -90,6 +90,6 @@ public class BoxCopyFeatureTest extends AbstractBoxTest {
|
||||
final BoxFileidProvider fileid = new BoxFileidProvider(session);
|
||||
final Path test = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
new BoxCopyFeature(session, fileid).copy(test, new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(),
|
||||
new DisabledLoginCallback(), new DisabledStreamListener());
|
||||
LoginCallback.noop, StreamListener.noop);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ package ch.cyberduck.core.box;
|
||||
import ch.cyberduck.core.AbstractPath;
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledListProgressListener;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.exception.NotfoundException;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
@@ -44,7 +44,7 @@ public class BoxDeleteFeatureTest extends AbstractBoxTest {
|
||||
public void testDeleteNotFound() throws Exception {
|
||||
final Path test = new Path(new DefaultHomeFinderService(session).find(), UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
|
||||
final BoxFileidProvider fileid = new BoxFileidProvider(session);
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonMap(test, new TransferStatus()), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonMap(test, new TransferStatus()), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -53,7 +53,7 @@ public class BoxDeleteFeatureTest extends AbstractBoxTest {
|
||||
final Path directory = new BoxDirectoryFeature(session, fileid).mkdir(new BoxWriteFeature(session, fileid), new Path(
|
||||
new AlphanumericRandomStringService().random(), EnumSet.of(AbstractPath.Type.directory)), new TransferStatus());
|
||||
assertTrue(new BoxFindFeature(session, fileid).find(directory, new DisabledListProgressListener()));
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(directory), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(directory), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertFalse((new BoxFindFeature(session, fileid).find(directory, new DisabledListProgressListener())));
|
||||
}
|
||||
|
||||
@@ -65,11 +65,11 @@ public class BoxDeleteFeatureTest extends AbstractBoxTest {
|
||||
final Path file2 = new BoxTouchFeature(session, fileid).touch(new BoxWriteFeature(session, fileid), new Path(folder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
|
||||
assertTrue(new BoxFindFeature(session, fileid).find(file1));
|
||||
assertTrue(new BoxFindFeature(session, fileid).find(file2));
|
||||
new BoxDeleteFeature(session, fileid).delete(Arrays.asList(file1, file2), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Arrays.asList(file1, file2), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertFalse((new BoxFindFeature(session, fileid).find(file1, new DisabledListProgressListener())));
|
||||
assertFalse((new BoxFindFeature(session, fileid).find(file2, new DisabledListProgressListener())));
|
||||
assertTrue(new BoxFindFeature(session, fileid).find(folder, new DisabledListProgressListener()));
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(folder), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(folder), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertFalse((new BoxFindFeature(session, fileid).find(folder, new DisabledListProgressListener())));
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ package ch.cyberduck.core.box;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.exception.ConflictException;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
@@ -46,7 +46,7 @@ public class BoxDirectoryFeatureTest extends AbstractBoxTest {
|
||||
assertEquals(0L, folder.attributes().getSize());
|
||||
assertNotEquals(-1L, folder.attributes().getModificationDate());
|
||||
assertThrows(ConflictException.class, () -> new BoxDirectoryFeature(session, fileid).mkdir(new BoxWriteFeature(session, fileid), folder, new TransferStatus()));
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(folder), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(folder), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
assertFalse(new DefaultFindFeature(session).find(folder));
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ package ch.cyberduck.core.box;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.exception.NotfoundException;
|
||||
@@ -65,6 +65,6 @@ public class BoxFileidProviderTest extends AbstractBoxTest {
|
||||
catch(NotfoundException e) {
|
||||
// Expected
|
||||
}
|
||||
new BoxDeleteFeature(session, nodeid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, nodeid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ package ch.cyberduck.core.box;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.shared.DefaultHomeFinderService;
|
||||
@@ -54,7 +54,7 @@ public class BoxFindFeatureTest extends AbstractBoxTest {
|
||||
new BoxWriteFeature(session, fileid), new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
|
||||
assertTrue(new BoxFindFeature(session, fileid).find(folder));
|
||||
assertFalse(new BoxFindFeature(session, fileid).find(new Path(folder.getAbsolute(), EnumSet.of(Path.Type.file))));
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(folder), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(folder), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -64,6 +64,6 @@ public class BoxFindFeatureTest extends AbstractBoxTest {
|
||||
new BoxTouchFeature(session, fileid).touch(new BoxWriteFeature(session, fileid), file, new TransferStatus());
|
||||
assertTrue(new BoxFindFeature(session, fileid).find(file));
|
||||
assertFalse(new BoxFindFeature(session, fileid).find(new Path(file.getAbsolute(), EnumSet.of(Path.Type.directory))));
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
@@ -18,11 +18,11 @@ package ch.cyberduck.core.box;
|
||||
import ch.cyberduck.core.AbstractPath;
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.BytecountStreamListener;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.Local;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.box.io.swagger.client.model.File;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.io.BandwidthThrottle;
|
||||
@@ -58,7 +58,7 @@ public class BoxLargeUploadServiceTest extends AbstractBoxTest {
|
||||
status.setChecksum(new SHA1ChecksumCompute().compute(local.getInputStream(), new TransferStatus()));
|
||||
status.setLength(content.length);
|
||||
final BytecountStreamListener count = new BytecountStreamListener();
|
||||
final File response = s.upload(new BoxWriteFeature(session, fileid), file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledConnectionCallback());
|
||||
final File response = s.upload(new BoxWriteFeature(session, fileid), file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), ProgressListener.noop, count, status, ConnectionCallback.noop);
|
||||
assertTrue(status.isComplete());
|
||||
assertNotNull(response.getSha1());
|
||||
assertEquals(content.length, count.getSent());
|
||||
@@ -67,9 +67,9 @@ public class BoxLargeUploadServiceTest extends AbstractBoxTest {
|
||||
assertTrue(new BoxFindFeature(session, fileid).find(file));
|
||||
assertEquals(content.length, new BoxAttributesFinderFeature(session, fileid).find(file).getSize());
|
||||
final byte[] compare = new byte[content.length];
|
||||
IOUtils.readFully(new BoxReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), new DisabledConnectionCallback()), compare);
|
||||
IOUtils.readFully(new BoxReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), ConnectionCallback.noop), compare);
|
||||
assertArrayEquals(content, compare);
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(container), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(container), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
local.delete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ package ch.cyberduck.core.box;
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
import ch.cyberduck.core.exception.NotfoundException;
|
||||
@@ -48,7 +48,7 @@ public class BoxMoveFeatureTest extends AbstractBoxTest {
|
||||
assertEquals(0L, test.attributes().getSize());
|
||||
assertNotEquals(-1L, test.attributes().getModificationDate());
|
||||
final Path target = new BoxMoveFeature(session, fileid).move(test,
|
||||
new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
|
||||
new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(), new Delete.DisabledCallback(), ConnectionCallback.noop);
|
||||
assertFalse(new BoxFindFeature(session, fileid).find(new Path(test).withAttributes(PathAttributes.EMPTY)));
|
||||
assertTrue(new BoxFindFeature(session, fileid).find(target));
|
||||
assertEquals(test.attributes().getModificationDate(), target.attributes().getModificationDate());
|
||||
@@ -56,7 +56,7 @@ public class BoxMoveFeatureTest extends AbstractBoxTest {
|
||||
assertNotEquals(test.attributes().getETag(), target.attributes().getETag());
|
||||
assertEquals(target.attributes(), new BoxAttributesFinderFeature(session, fileid).find(target));
|
||||
assertEquals(Comparison.equal, session.getHost().getProtocol().getFeature(ComparisonService.class).compare(Path.Type.file, test.attributes(), target.attributes()));
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(target), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(target), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -65,10 +65,10 @@ public class BoxMoveFeatureTest extends AbstractBoxTest {
|
||||
final Path test = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
|
||||
new BoxDirectoryFeature(session, fileid).mkdir(new BoxWriteFeature(session, fileid), test, new TransferStatus());
|
||||
final Path target = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
|
||||
new BoxMoveFeature(session, fileid).move(test, target, new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
|
||||
new BoxMoveFeature(session, fileid).move(test, target, new TransferStatus(), new Delete.DisabledCallback(), ConnectionCallback.noop);
|
||||
assertFalse(new BoxFindFeature(session, fileid).find(test.withAttributes(PathAttributes.EMPTY)));
|
||||
assertTrue(new BoxFindFeature(session, fileid).find(target));
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.<Path>singletonList(target), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.<Path>singletonList(target), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -79,19 +79,19 @@ public class BoxMoveFeatureTest extends AbstractBoxTest {
|
||||
final Path target = new BoxTouchFeature(session, fileid).touch(
|
||||
new BoxWriteFeature(session, fileid), new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
|
||||
final Path override = new BoxMoveFeature(session, fileid).move(test, target,
|
||||
new TransferStatus().setExists(true).setRemote(target.attributes()), new Delete.DisabledCallback(), new DisabledConnectionCallback());
|
||||
new TransferStatus().setExists(true).setRemote(target.attributes()), new Delete.DisabledCallback(), ConnectionCallback.noop);
|
||||
assertFalse(new BoxFindFeature(session, fileid).find(test));
|
||||
assertTrue(new BoxFindFeature(session, fileid).find(override));
|
||||
assertEquals(test.attributes().getModificationDate(), override.attributes().getModificationDate());
|
||||
assertEquals(test.attributes().getChecksum(), override.attributes().getChecksum());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.<Path>singletonList(target), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.<Path>singletonList(target), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test(expected = NotfoundException.class)
|
||||
public void testMoveNotFound() throws Exception {
|
||||
final BoxFileidProvider fileid = new BoxFileidProvider(session);
|
||||
final Path test = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
new BoxMoveFeature(session, fileid).move(test, new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
|
||||
new BoxMoveFeature(session, fileid).move(test, new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(), new Delete.DisabledCallback(), ConnectionCallback.noop);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -100,7 +100,7 @@ public class BoxMoveFeatureTest extends AbstractBoxTest {
|
||||
final String name = new AlphanumericRandomStringService().random();
|
||||
final Path file = new BoxTouchFeature(session, fileid).touch(new BoxWriteFeature(session, fileid), new Path(new DefaultHomeFinderService(session).find(), StringUtils.capitalize(name), EnumSet.of(Path.Type.file)), new TransferStatus());
|
||||
final Path rename = new Path(new DefaultHomeFinderService(session).find(), StringUtils.lowerCase(name), EnumSet.of(Path.Type.file));
|
||||
new BoxMoveFeature(session, fileid).move(file, rename, new TransferStatus().setExists(true), new Delete.DisabledCallback(), new DisabledConnectionCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(rename), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxMoveFeature(session, fileid).move(file, rename, new TransferStatus().setExists(true), new Delete.DisabledCallback(), ConnectionCallback.noop);
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(rename), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package ch.cyberduck.core.box;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.exception.NotfoundException;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
@@ -32,7 +32,7 @@ public class BoxReadFeatureTest extends AbstractBoxTest {
|
||||
public void testReadNotFound() throws Exception {
|
||||
final BoxFileidProvider fileid = new BoxFileidProvider(session);
|
||||
final TransferStatus status = new TransferStatus();
|
||||
new BoxReadFeature(session, fileid).read(new Path(new DefaultHomeFinderService(session).find(), "nosuchname", EnumSet.of(Path.Type.file)), status, new DisabledConnectionCallback());
|
||||
new BoxReadFeature(session, fileid).read(new Path(new DefaultHomeFinderService(session).find(), "nosuchname", EnumSet.of(Path.Type.file)), status, ConnectionCallback.noop);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -40,10 +40,10 @@ public class BoxReadFeatureTest extends AbstractBoxTest {
|
||||
final BoxFileidProvider fileid = new BoxFileidProvider(session);
|
||||
final Path test = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
new BoxTouchFeature(session, fileid).touch(new BoxWriteFeature(session, fileid), test, new TransferStatus());
|
||||
final InputStream in = new BoxReadFeature(session, fileid).read(test, new TransferStatus().setLength(0L), new DisabledConnectionCallback());
|
||||
final InputStream in = new BoxReadFeature(session, fileid).read(test, new TransferStatus().setLength(0L), ConnectionCallback.noop);
|
||||
assertNotNull(in);
|
||||
in.close();
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.<Path>singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.<Path>singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
session.close();
|
||||
}
|
||||
|
||||
@@ -52,14 +52,14 @@ public class BoxReadFeatureTest extends AbstractBoxTest {
|
||||
final BoxFileidProvider fileid = new BoxFileidProvider(session);
|
||||
final Path test = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
final byte[] content = RandomUtils.nextBytes(1432);
|
||||
final OutputStream out = new BoxWriteFeature(session, fileid).write(test, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final OutputStream out = new BoxWriteFeature(session, fileid).write(test, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
assertNotNull(out);
|
||||
new StreamCopier(new TransferStatus(), new TransferStatus()).transfer(new ByteArrayInputStream(content), out);
|
||||
final TransferStatus status = new TransferStatus();
|
||||
status.setLength(content.length);
|
||||
status.setAppend(true);
|
||||
status.setOffset(100L);
|
||||
final InputStream in = new BoxReadFeature(session, fileid).read(test, status.setLength(content.length - 100), new DisabledConnectionCallback());
|
||||
final InputStream in = new BoxReadFeature(session, fileid).read(test, status.setLength(content.length - 100), ConnectionCallback.noop);
|
||||
assertNotNull(in);
|
||||
final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length - 100);
|
||||
new StreamCopier(status, status).transfer(in, buffer);
|
||||
@@ -67,7 +67,7 @@ public class BoxReadFeatureTest extends AbstractBoxTest {
|
||||
System.arraycopy(content, 100, reference, 0, content.length - 100);
|
||||
assertArrayEquals(reference, buffer.toByteArray());
|
||||
in.close();
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.<Path>singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.<Path>singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
session.close();
|
||||
}
|
||||
|
||||
@@ -76,14 +76,14 @@ public class BoxReadFeatureTest extends AbstractBoxTest {
|
||||
final BoxFileidProvider fileid = new BoxFileidProvider(session);
|
||||
final Path test = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
final byte[] content = RandomUtils.nextBytes(1432);
|
||||
final OutputStream out = new BoxWriteFeature(session, fileid).write(test, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final OutputStream out = new BoxWriteFeature(session, fileid).write(test, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
assertNotNull(out);
|
||||
new StreamCopier(new TransferStatus(), new TransferStatus()).transfer(new ByteArrayInputStream(content), out);
|
||||
final TransferStatus status = new TransferStatus();
|
||||
status.setLength(-1L);
|
||||
status.setAppend(true);
|
||||
status.setOffset(100L);
|
||||
final InputStream in = new BoxReadFeature(session, fileid).read(test, status, new DisabledConnectionCallback());
|
||||
final InputStream in = new BoxReadFeature(session, fileid).read(test, status, ConnectionCallback.noop);
|
||||
assertNotNull(in);
|
||||
final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length - 100);
|
||||
new StreamCopier(status, status).transfer(in, buffer);
|
||||
@@ -91,6 +91,6 @@ public class BoxReadFeatureTest extends AbstractBoxTest {
|
||||
System.arraycopy(content, 100, reference, 0, content.length - 100);
|
||||
assertArrayEquals(reference, buffer.toByteArray());
|
||||
in.close();
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.<Path>singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.<Path>singletonList(test), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ package ch.cyberduck.core.box;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.BytecountStreamListener;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.MimeTypeService;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.PathAttributes;
|
||||
@@ -65,7 +65,7 @@ public class BoxWriteFeatureTest extends AbstractBoxTest {
|
||||
status.setRemote(file.attributes());
|
||||
status.setMime(MimeTypeService.DEFAULT_CONTENT_TYPE);
|
||||
status.setChecksum(feature.checksum(file, status).compute(new ByteArrayInputStream(content), status));
|
||||
final HttpResponseOutputStream<File> out = feature.write(file, status, new DisabledConnectionCallback());
|
||||
final HttpResponseOutputStream<File> out = feature.write(file, status, ConnectionCallback.noop);
|
||||
final ByteArrayInputStream in = new ByteArrayInputStream(content);
|
||||
final TransferStatus progress = new TransferStatus();
|
||||
final BytecountStreamListener count = new BytecountStreamListener();
|
||||
@@ -79,7 +79,7 @@ public class BoxWriteFeatureTest extends AbstractBoxTest {
|
||||
final PathAttributes attributes = new BoxAttributesFinderFeature(session, fileid).find(file);
|
||||
assertEquals(content.length, attributes.getSize());
|
||||
final byte[] compare = new byte[content.length];
|
||||
final InputStream stream = new BoxReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream stream = new BoxReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
IOUtils.readFully(stream, compare);
|
||||
stream.close();
|
||||
assertArrayEquals(content, compare);
|
||||
@@ -91,6 +91,6 @@ public class BoxWriteFeatureTest extends AbstractBoxTest {
|
||||
assertNotEquals(file.attributes().getModificationDate(), fileAttr.getModificationDate());
|
||||
assertEquals(1503654615000L, fileAttr.getCreationDate()); //milliseconds are ignored by the Box - GMT: Friday, 25. August 2017 09:50:14
|
||||
assertEquals(1503654614000L, fileAttr.getModificationDate()); //milliseconds are ignored by the Box - GMT: Friday, 25. August 2017 09:50:14
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(folder), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(folder), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ package ch.cyberduck.core.box;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.BytecountStreamListener;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.features.Delete;
|
||||
import ch.cyberduck.core.io.StatusOutputStream;
|
||||
@@ -51,7 +51,7 @@ public class BufferWriteFeatureTest extends AbstractBoxTest {
|
||||
final TransferStatus status = new TransferStatus();
|
||||
status.setLength(content.length);
|
||||
final Path file = new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
final StatusOutputStream<Void> out = feature.write(file, status, new DisabledConnectionCallback());
|
||||
final StatusOutputStream<Void> out = feature.write(file, status, ConnectionCallback.noop);
|
||||
final ByteArrayInputStream in = new ByteArrayInputStream(content);
|
||||
final BytecountStreamListener count = new BytecountStreamListener();
|
||||
new StreamCopier(status, status).withListener(count).transfer(in, out);
|
||||
@@ -60,11 +60,11 @@ public class BufferWriteFeatureTest extends AbstractBoxTest {
|
||||
assertNull(out.getStatus());
|
||||
assertTrue(new DefaultFindFeature(session).find(file));
|
||||
final byte[] compare = new byte[content.length];
|
||||
final InputStream stream = new BoxReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream stream = new BoxReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
IOUtils.readFully(stream, compare);
|
||||
stream.close();
|
||||
assertArrayEquals(content, compare);
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -76,13 +76,13 @@ public class BufferWriteFeatureTest extends AbstractBoxTest {
|
||||
final byte[] content = RandomUtils.nextBytes(42512);
|
||||
final TransferStatus status = new TransferStatus();
|
||||
status.setLength(content.length);
|
||||
final StatusOutputStream<Void> out = feature.write(file, status, new DisabledConnectionCallback());
|
||||
final StatusOutputStream<Void> out = feature.write(file, status, ConnectionCallback.noop);
|
||||
final ByteArrayInputStream in = new ByteArrayInputStream(content);
|
||||
new StreamCopier(status, status).transfer(in, out);
|
||||
assertNull(out.getStatus());
|
||||
assertTrue(new DefaultFindFeature(session).find(file));
|
||||
final byte[] compare = new byte[content.length];
|
||||
final InputStream stream = new BoxReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream stream = new BoxReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
IOUtils.readFully(stream, compare);
|
||||
stream.close();
|
||||
assertArrayEquals(content, compare);
|
||||
@@ -91,18 +91,18 @@ public class BufferWriteFeatureTest extends AbstractBoxTest {
|
||||
final byte[] content = RandomUtils.nextBytes(33221);
|
||||
final TransferStatus status = new TransferStatus().setExists(true);
|
||||
status.setLength(content.length);
|
||||
final StatusOutputStream<Void> out = feature.write(file, status, new DisabledConnectionCallback());
|
||||
final StatusOutputStream<Void> out = feature.write(file, status, ConnectionCallback.noop);
|
||||
final ByteArrayInputStream in = new ByteArrayInputStream(content);
|
||||
new StreamCopier(status, status).transfer(in, out);
|
||||
assertNull(out.getStatus());
|
||||
assertTrue(new DefaultFindFeature(session).find(file));
|
||||
final byte[] compare = new byte[content.length];
|
||||
final InputStream stream = new BoxReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream stream = new BoxReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
IOUtils.readFully(stream, compare);
|
||||
stream.close();
|
||||
assertArrayEquals(content, compare);
|
||||
}
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -113,17 +113,17 @@ public class BufferWriteFeatureTest extends AbstractBoxTest {
|
||||
final TransferStatus status = new TransferStatus();
|
||||
status.setLength(-1L);
|
||||
final Path file = new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
final StatusOutputStream<Void> out = feature.write(file, status, new DisabledConnectionCallback());
|
||||
final StatusOutputStream<Void> out = feature.write(file, status, ConnectionCallback.noop);
|
||||
final ByteArrayInputStream in = new ByteArrayInputStream(content);
|
||||
new StreamCopier(status, status).transfer(in, out);
|
||||
assertNull(out.getStatus());
|
||||
assertTrue(new DefaultFindFeature(session).find(file));
|
||||
final byte[] compare = new byte[content.length];
|
||||
final InputStream stream = new BoxReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream stream = new BoxReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
IOUtils.readFully(stream, compare);
|
||||
stream.close();
|
||||
assertArrayEquals(content, compare);
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -134,16 +134,16 @@ public class BufferWriteFeatureTest extends AbstractBoxTest {
|
||||
final TransferStatus status = new TransferStatus();
|
||||
status.setLength(-1L);
|
||||
final Path file = new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
|
||||
final StatusOutputStream<Void> out = feature.write(file, status, new DisabledConnectionCallback());
|
||||
final StatusOutputStream<Void> out = feature.write(file, status, ConnectionCallback.noop);
|
||||
final ByteArrayInputStream in = new ByteArrayInputStream(content);
|
||||
new StreamCopier(status, status).transfer(in, out);
|
||||
assertNull(out.getStatus());
|
||||
assertTrue(new DefaultFindFeature(session).find(file));
|
||||
final byte[] compare = new byte[content.length];
|
||||
final InputStream stream = new BoxReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream stream = new BoxReadFeature(session, fileid).read(file, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
IOUtils.readFully(stream, compare);
|
||||
stream.close();
|
||||
assertArrayEquals(content, compare);
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(file), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,12 +18,12 @@ package ch.cyberduck.core.cryptomator;
|
||||
import ch.cyberduck.core.AbstractPath;
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.BytecountStreamListener;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.DisabledProgressListener;
|
||||
import ch.cyberduck.core.Local;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.box.AbstractBoxTest;
|
||||
import ch.cyberduck.core.box.BoxAttributesFinderFeature;
|
||||
import ch.cyberduck.core.box.BoxDeleteFeature;
|
||||
@@ -91,13 +91,13 @@ public class BoxThresholdUploadServiceTest extends AbstractBoxTest {
|
||||
writeStatus.setHeader(cryptomator.getFileHeaderCryptor().encryptHeader(header));
|
||||
writeStatus.setLength(content.length);
|
||||
final CryptoBulkFeature<Map<TransferItem, TransferStatus>> bulk = new CryptoBulkFeature<>(session, new DisabledBulkFeature(), cryptomator);
|
||||
bulk.pre(Transfer.Type.upload, Collections.singletonMap(new TransferItem(test), writeStatus), new DisabledConnectionCallback());
|
||||
bulk.pre(Transfer.Type.upload, Collections.singletonMap(new TransferItem(test), writeStatus), ConnectionCallback.noop);
|
||||
final BytecountStreamListener count = new BytecountStreamListener();
|
||||
final CryptoUploadFeature feature = new CryptoUploadFeature<>(session,
|
||||
new BoxThresholdUploadService(session, fileid, registry),
|
||||
cryptomator);
|
||||
feature.upload(
|
||||
new CryptoWriteFeature<>(session, new BoxWriteFeature(session, fileid), cryptomator), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, writeStatus, new DisabledConnectionCallback());
|
||||
new CryptoWriteFeature<>(session, new BoxWriteFeature(session, fileid), cryptomator), test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), ProgressListener.noop, count, writeStatus, ConnectionCallback.noop);
|
||||
assertEquals(content.length, count.getSent());
|
||||
assertEquals(content.length, writeStatus.getResponse().getSize());
|
||||
assertTrue(writeStatus.isComplete());
|
||||
@@ -105,10 +105,10 @@ public class BoxThresholdUploadServiceTest extends AbstractBoxTest {
|
||||
assertEquals(content.length, cryptomator.getFeature(session, AttributesFinder.class, new BoxAttributesFinderFeature(session, fileid)).find(test).getSize());
|
||||
final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
|
||||
final TransferStatus readStatus = new TransferStatus().setLength(content.length);
|
||||
final InputStream in = new CryptoReadFeature(session, new BoxReadFeature(session, fileid), cryptomator).read(test, readStatus, new DisabledConnectionCallback());
|
||||
final InputStream in = new CryptoReadFeature(session, new BoxReadFeature(session, fileid), cryptomator).read(test, readStatus, ConnectionCallback.noop);
|
||||
new StreamCopier(readStatus, readStatus).transfer(in, buffer);
|
||||
assertArrayEquals(content, buffer.toByteArray());
|
||||
cryptomator.getFeature(session, Delete.class, new BoxDeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new BoxDeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
local.delete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@ package ch.cyberduck.core.cryptomator;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.BytecountStreamListener;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.box.AbstractBoxTest;
|
||||
import ch.cyberduck.core.box.BoxDeleteFeature;
|
||||
@@ -76,7 +76,7 @@ public class BoxWriteFeatureTest extends AbstractBoxTest {
|
||||
writeStatus.setHeader(cryptomator.getFileHeaderCryptor().encryptHeader(header));
|
||||
writeStatus.setNonces(new RandomNonceGenerator(cryptomator.getNonceSize()));
|
||||
writeStatus.setLength(-1L);
|
||||
final StatusOutputStream out = feature.write(test, writeStatus, new DisabledConnectionCallback());
|
||||
final StatusOutputStream out = feature.write(test, writeStatus, ConnectionCallback.noop);
|
||||
final ByteArrayInputStream in = new ByteArrayInputStream(content);
|
||||
final TransferStatus progress = new TransferStatus();
|
||||
final BytecountStreamListener count = new BytecountStreamListener();
|
||||
@@ -86,11 +86,11 @@ public class BoxWriteFeatureTest extends AbstractBoxTest {
|
||||
assertNotNull(out.getStatus());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new BoxFindFeature(session, fileid)).find(test));
|
||||
final byte[] compare = new byte[content.length];
|
||||
final InputStream stream = new CryptoReadFeature(session, new BoxReadFeature(session, fileid), cryptomator).read(test, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream stream = new CryptoReadFeature(session, new BoxReadFeature(session, fileid), cryptomator).read(test, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
IOUtils.readFully(stream, compare);
|
||||
stream.close();
|
||||
assertArrayEquals(content, compare);
|
||||
cryptomator.getFeature(session, Delete.class, new BoxDeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new BoxDeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -110,7 +110,7 @@ public class BoxWriteFeatureTest extends AbstractBoxTest {
|
||||
writeStatus.setNonces(new RandomNonceGenerator(cryptomator.getNonceSize()));
|
||||
writeStatus.setLength(-1L);
|
||||
writeStatus.setModified(Instant.now().getEpochSecond());
|
||||
final StatusOutputStream out = feature.write(test, writeStatus, new DisabledConnectionCallback());
|
||||
final StatusOutputStream out = feature.write(test, writeStatus, ConnectionCallback.noop);
|
||||
final ByteArrayInputStream in = new ByteArrayInputStream(content);
|
||||
final TransferStatus progress = new TransferStatus();
|
||||
final BytecountStreamListener count = new BytecountStreamListener();
|
||||
@@ -120,10 +120,10 @@ public class BoxWriteFeatureTest extends AbstractBoxTest {
|
||||
assertNotNull(out.getStatus());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new BoxFindFeature(session, fileid)).find(test));
|
||||
final byte[] compare = new byte[content.length];
|
||||
final InputStream stream = new CryptoReadFeature(session, new BoxReadFeature(session, fileid), cryptomator).read(test, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream stream = new CryptoReadFeature(session, new BoxReadFeature(session, fileid), cryptomator).read(test, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
IOUtils.readFully(stream, compare);
|
||||
stream.close();
|
||||
assertArrayEquals(content, compare);
|
||||
cryptomator.getFeature(session, Delete.class, new BoxDeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new BoxDeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@ package ch.cyberduck.core.cryptomator;
|
||||
|
||||
import ch.cyberduck.core.AlphanumericRandomStringService;
|
||||
import ch.cyberduck.core.BytecountStreamListener;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DisabledPasswordCallback;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.box.AbstractBoxTest;
|
||||
import ch.cyberduck.core.box.BoxDeleteFeature;
|
||||
@@ -77,7 +77,7 @@ public class BufferWriteFeatureTest extends AbstractBoxTest {
|
||||
writeStatus.setNonces(new RandomNonceGenerator(cryptomator.getNonceSize()));
|
||||
writeStatus.setChecksum(feature.checksum(test, new TransferStatus()).compute(new ByteArrayInputStream(content), new TransferStatus()));
|
||||
writeStatus.setLength(content.length);
|
||||
final StatusOutputStream out = feature.write(test, writeStatus, new DisabledConnectionCallback());
|
||||
final StatusOutputStream out = feature.write(test, writeStatus, ConnectionCallback.noop);
|
||||
final ByteArrayInputStream in = new ByteArrayInputStream(content);
|
||||
final TransferStatus progress = new TransferStatus();
|
||||
final BytecountStreamListener count = new BytecountStreamListener();
|
||||
@@ -86,10 +86,10 @@ public class BufferWriteFeatureTest extends AbstractBoxTest {
|
||||
assertEquals(content.length, count.getRecv());
|
||||
assertTrue(cryptomator.getFeature(session, Find.class, new BoxFindFeature(session, fileid)).find(test));
|
||||
final byte[] compare = new byte[content.length];
|
||||
final InputStream stream = new CryptoReadFeature(session, new BoxReadFeature(session, fileid), cryptomator).read(test, new TransferStatus().setLength(content.length), new DisabledConnectionCallback());
|
||||
final InputStream stream = new CryptoReadFeature(session, new BoxReadFeature(session, fileid), cryptomator).read(test, new TransferStatus().setLength(content.length), ConnectionCallback.noop);
|
||||
IOUtils.readFully(stream, compare);
|
||||
stream.close();
|
||||
assertArrayEquals(content, compare);
|
||||
cryptomator.getFeature(session, Delete.class, new BoxDeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
|
||||
cryptomator.getFeature(session, Delete.class, new BoxDeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), LoginCallback.noop, new Delete.DisabledCallback());
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
<parent>
|
||||
<groupId>ch.cyberduck</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>9.4.0-SNAPSHOT</version>
|
||||
<version>9.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>brick</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
@@ -62,7 +62,7 @@ public class BrickCopyFeature extends BrickFileMigrationFeature implements Copy
|
||||
if(entity.getFileMigrationId() != null) {
|
||||
this.poll(client, entity);
|
||||
}
|
||||
return new Path(target).withAttributes(new DefaultPathAttributes(file.attributes()).setVault(null));
|
||||
return new Path(target).withAttributes(new DefaultPathAttributes(file.attributes()));
|
||||
}
|
||||
catch(ApiException e) {
|
||||
throw new BrickExceptionMappingService().map("Cannot copy {0}", e, file);
|
||||
|
||||
@@ -60,7 +60,7 @@ public class BrickMoveFeature extends BrickFileMigrationFeature implements Move
|
||||
if(entity.getFileMigrationId() != null) {
|
||||
this.poll(client, entity);
|
||||
}
|
||||
return new Path(target).withAttributes(new DefaultPathAttributes(file.attributes()).setVault(null));
|
||||
return new Path(target).withAttributes(new DefaultPathAttributes(file.attributes()));
|
||||
}
|
||||
catch(ApiException e) {
|
||||
throw new BrickExceptionMappingService().map("Cannot rename {0}", e, file);
|
||||
|
||||
@@ -17,7 +17,6 @@ package ch.cyberduck.core.brick;
|
||||
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DefaultIOExceptionMappingService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.ProgressListener;
|
||||
import ch.cyberduck.core.brick.io.swagger.client.ApiException;
|
||||
@@ -128,7 +127,7 @@ public class BrickMultipartWriteFeature implements MultipartWrite<FileEntity> {
|
||||
status.setChecksum(writer.checksum(file, status).compute(new ByteArrayInputStream(b, off, len), status));
|
||||
status.setUrl(uploadPartEntity.getUploadUri());
|
||||
status.setSegment(true);
|
||||
final HttpResponseOutputStream<FileEntity> proxy = writer.write(file, status, new DisabledConnectionCallback());
|
||||
final HttpResponseOutputStream<FileEntity> proxy = writer.write(file, status, ConnectionCallback.noop);
|
||||
final byte[] content = Arrays.copyOfRange(b, off, len);
|
||||
try {
|
||||
IOUtils.write(content, proxy);
|
||||
|
||||
@@ -19,11 +19,11 @@ import ch.cyberduck.core.CertificateStoreFactory;
|
||||
import ch.cyberduck.core.DefaultIOExceptionMappingService;
|
||||
import ch.cyberduck.core.DisabledCertificateIdentityCallback;
|
||||
import ch.cyberduck.core.DisabledCertificateTrustCallback;
|
||||
import ch.cyberduck.core.DisabledLoginCallback;
|
||||
import ch.cyberduck.core.DisabledTranscriptListener;
|
||||
import ch.cyberduck.core.Host;
|
||||
import ch.cyberduck.core.HostPasswordStore;
|
||||
import ch.cyberduck.core.HostUrlProvider;
|
||||
import ch.cyberduck.core.LoginCallback;
|
||||
import ch.cyberduck.core.PasswordStoreFactory;
|
||||
import ch.cyberduck.core.exception.BackgroundException;
|
||||
import ch.cyberduck.core.features.Pairing;
|
||||
@@ -70,7 +70,7 @@ public class BrickPairingFeature implements Pairing {
|
||||
CertificateStoreFactory.get());
|
||||
final HttpConnectionPoolBuilder builder = new HttpConnectionPoolBuilder(bookmark,
|
||||
new ThreadLocalHostnameDelegatingTrustManager(trust, bookmark.getHostname()), key, ProxyFactory.get());
|
||||
final HttpClientBuilder configuration = builder.build(ProxyFactory.get(), new DisabledTranscriptListener(), new DisabledLoginCallback());
|
||||
final HttpClientBuilder configuration = builder.build(ProxyFactory.get(), new DisabledTranscriptListener(), LoginCallback.noop);
|
||||
configuration.setDefaultAuthSchemeRegistry(RegistryBuilder.<AuthSchemeProvider>create().build());
|
||||
final CloseableHttpClient client = configuration.build();
|
||||
final HttpRequestBase resource = new HttpDelete(
|
||||
|
||||
@@ -100,7 +100,7 @@ public class BrickSession extends HttpSession<BrickApiClient> {
|
||||
}
|
||||
else {
|
||||
// No prompt on explicit connect
|
||||
this.pair(host, new DisabledConnectionCallback(), prompt, cancel,
|
||||
this.pair(host, ConnectionCallback.noop, prompt, cancel,
|
||||
LocaleFactory.localizedString("Connect an account", "Brick"),
|
||||
LocaleFactory.localizedString("Please complete the login process in your browser.", "Brick"));
|
||||
retryHandler.setApiKey(credentials.getPassword());
|
||||
|
||||
@@ -15,8 +15,8 @@ package ch.cyberduck.core.brick;
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
import ch.cyberduck.core.ConnectionCallback;
|
||||
import ch.cyberduck.core.DefaultIOExceptionMappingService;
|
||||
import ch.cyberduck.core.DisabledConnectionCallback;
|
||||
import ch.cyberduck.core.Path;
|
||||
import ch.cyberduck.core.brick.io.swagger.client.model.FileEntity;
|
||||
import ch.cyberduck.core.brick.io.swagger.client.model.FileUploadPartEntity;
|
||||
@@ -46,7 +46,7 @@ public class BrickTouchFeature implements Touch<FileEntity> {
|
||||
status.setSegment(true);
|
||||
status.setModified(System.currentTimeMillis());
|
||||
status.setPart(1);
|
||||
new BrickWriteFeature(session).write(file, status, new DisabledConnectionCallback()).close();
|
||||
new BrickWriteFeature(session).write(file, status, ConnectionCallback.noop).close();
|
||||
final FileEntity entity = upload.completeUpload(file, uploadPartEntity.getRef(), status, Collections.singletonList(status));
|
||||
return file.withAttributes(new BrickAttributesFinderFeature(session).toAttributes(entity));
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user