From e4ab8421cbbdbf8a528e6bda6b0250b1333cff3b Mon Sep 17 00:00:00 2001 From: David Kocher Date: Fri, 8 Nov 2024 20:40:07 +0100 Subject: [PATCH 1/3] Add default no-op implementation to interface. --- .../core/box/BoxDirectoryFeature.java | 6 ------ .../core/brick/BrickDirectoryFeature.java | 6 ------ .../ch/cyberduck/core/features/Directory.java | 4 +++- .../cyberduck/core/NullDirectoryFeature.java | 6 ------ .../cyberduck/core/worker/MoveWorkerTest.java | 10 ++------- .../features/CryptoDirectoryV6Feature.java | 5 ----- .../features/CryptoDirectoryV7Feature.java | 5 ----- .../CryptoChecksumComputeTest.java | 10 ++------- .../cryptomator/CryptoOutputStreamTest.java | 6 ------ .../core/cryptomator/CryptoVaultTest.java | 21 ------------------- .../cryptomator/CryptoWriteFeatureTest.java | 11 ---------- .../features/CryptoBulkFeatureTest.java | 11 ---------- .../core/deepbox/DeepboxDirectoryFeature.java | 6 ------ .../core/sds/SDSDirectoryFeature.java | 6 ------ .../core/dropbox/DropboxDirectoryFeature.java | 8 +------ .../core/eue/EueDirectoryFeature.java | 6 ------ .../core/ftp/FTPDirectoryFeature.java | 6 ------ .../googledrive/DriveDirectoryFeature.java | 7 ------- .../core/irods/IRODSDirectoryFeature.java | 6 ------ .../core/manta/MantaDirectoryFeature.java | 6 ------ .../core/nio/LocalDirectoryFeature.java | 6 ------ .../features/GraphDirectoryFeature.java | 6 ------ .../core/smb/SMBDirectoryFeature.java | 6 ------ .../core/sftp/SFTPDirectoryFeature.java | 6 ------ .../storegate/StoregateDirectoryFeature.java | 6 ------ .../core/dav/DAVDirectoryFeature.java | 6 ------ 26 files changed, 8 insertions(+), 180 deletions(-) diff --git a/box/src/main/java/ch/cyberduck/core/box/BoxDirectoryFeature.java b/box/src/main/java/ch/cyberduck/core/box/BoxDirectoryFeature.java index 668bf3ed37f..9ed74be19ce 100644 --- a/box/src/main/java/ch/cyberduck/core/box/BoxDirectoryFeature.java +++ b/box/src/main/java/ch/cyberduck/core/box/BoxDirectoryFeature.java @@ -24,7 +24,6 @@ import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.exception.InvalidFilenameException; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import java.text.MessageFormat; @@ -53,11 +52,6 @@ public Path mkdir(final Path folder, final TransferStatus status) throws Backgro } } - @Override - public Directory withWriter(final Write writer) { - return this; - } - @Override public void preflight(final Path workdir, final String filename) throws BackgroundException { if(!BoxTouchFeature.validate(filename)) { diff --git a/brick/src/main/java/ch/cyberduck/core/brick/BrickDirectoryFeature.java b/brick/src/main/java/ch/cyberduck/core/brick/BrickDirectoryFeature.java index c125d7f49ef..0a22085be01 100644 --- a/brick/src/main/java/ch/cyberduck/core/brick/BrickDirectoryFeature.java +++ b/brick/src/main/java/ch/cyberduck/core/brick/BrickDirectoryFeature.java @@ -21,7 +21,6 @@ import ch.cyberduck.core.brick.io.swagger.client.model.FileEntity; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import org.apache.commons.lang3.StringUtils; @@ -45,9 +44,4 @@ public Path mkdir(final Path folder, final TransferStatus status) throws Backgro throw new BrickExceptionMappingService().map("Cannot create folder {0}", e, folder); } } - - @Override - public Directory withWriter(final Write writer) { - return this; - } } diff --git a/core/src/main/java/ch/cyberduck/core/features/Directory.java b/core/src/main/java/ch/cyberduck/core/features/Directory.java index d599ebfbf51..f670e86f672 100644 --- a/core/src/main/java/ch/cyberduck/core/features/Directory.java +++ b/core/src/main/java/ch/cyberduck/core/features/Directory.java @@ -57,7 +57,9 @@ default boolean isSupported(final Path workdir, final String filename) { /** * Retrieve write implementation for implementations using placeholder files for folders */ - Directory withWriter(Write writer); + default Directory withWriter(Write writer) { + return this; + } /** * @throws AccessDeniedException Permission failure for target directory diff --git a/core/src/test/java/ch/cyberduck/core/NullDirectoryFeature.java b/core/src/test/java/ch/cyberduck/core/NullDirectoryFeature.java index 1fb24a7b910..dbe95f19b2c 100644 --- a/core/src/test/java/ch/cyberduck/core/NullDirectoryFeature.java +++ b/core/src/test/java/ch/cyberduck/core/NullDirectoryFeature.java @@ -17,7 +17,6 @@ import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; public class NullDirectoryFeature implements Directory { @@ -25,9 +24,4 @@ public class NullDirectoryFeature implements Directory { public Path mkdir(final Path folder, final TransferStatus status) throws BackgroundException { return folder; } - - @Override - public Directory withWriter(final Write writer) { - return this; - } } diff --git a/core/src/test/java/ch/cyberduck/core/worker/MoveWorkerTest.java b/core/src/test/java/ch/cyberduck/core/worker/MoveWorkerTest.java index 4a2a2a189fa..7a9f1e00df7 100644 --- a/core/src/test/java/ch/cyberduck/core/worker/MoveWorkerTest.java +++ b/core/src/test/java/ch/cyberduck/core/worker/MoveWorkerTest.java @@ -31,7 +31,6 @@ import ch.cyberduck.core.features.Delete; import ch.cyberduck.core.features.Directory; import ch.cyberduck.core.features.Move; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.pool.SessionPool; import ch.cyberduck.core.transfer.TransferStatus; @@ -84,11 +83,6 @@ public boolean isRecursive() { public Path mkdir(final Path folder, final TransferStatus status) { return folder; } - - @Override - public Directory withWriter(final Write writer) { - return this; - } }; } if(type == Move.class) { @@ -155,8 +149,8 @@ public AttributedList list(final Path file, final ListProgressListener lis } }; final MoveWorker worker = new MoveWorker( - Collections.singletonMap(new Path("/t", EnumSet.of(Path.Type.directory)), new Path("/t2", EnumSet.of(Path.Type.directory))), - new SessionPool.SingleSessionPool(session), PathCache.empty(), new DisabledProgressListener(), new DisabledLoginCallback()); + Collections.singletonMap(new Path("/t", EnumSet.of(Path.Type.directory)), new Path("/t2", EnumSet.of(Path.Type.directory))), + new SessionPool.SingleSessionPool(session), PathCache.empty(), new DisabledProgressListener(), new DisabledLoginCallback()); final Collection targets = worker.run(session).values(); assertEquals(4, targets.size()); assertTrue(targets.contains(new Path("/t2", EnumSet.of(Path.Type.directory)))); diff --git a/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoDirectoryV6Feature.java b/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoDirectoryV6Feature.java index df744c1db43..0e85d46efbe 100644 --- a/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoDirectoryV6Feature.java +++ b/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoDirectoryV6Feature.java @@ -90,11 +90,6 @@ public void preflight(final Path workdir, final String filename) throws Backgrou delegate.preflight(workdir, filename); } - @Override - public CryptoDirectoryV6Feature withWriter(final Write writer) { - return this; - } - @Override public String toString() { final StringBuilder sb = new StringBuilder("CryptoDirectoryFeature{"); diff --git a/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoDirectoryV7Feature.java b/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoDirectoryV7Feature.java index 1cf5dc8c7e7..2f93b1876b9 100644 --- a/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoDirectoryV7Feature.java +++ b/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoDirectoryV7Feature.java @@ -96,11 +96,6 @@ public void preflight(final Path workdir, final String filename) throws Backgrou delegate.preflight(workdir, filename); } - @Override - public CryptoDirectoryV7Feature withWriter(final Write writer) { - return this; - } - @Override public String toString() { final StringBuilder sb = new StringBuilder("CryptoDirectoryFeature{"); diff --git a/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/CryptoChecksumComputeTest.java b/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/CryptoChecksumComputeTest.java index e5aea8c1b6f..3f747d5acc3 100644 --- a/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/CryptoChecksumComputeTest.java +++ b/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/CryptoChecksumComputeTest.java @@ -22,7 +22,6 @@ import ch.cyberduck.core.cryptomator.features.CryptoChecksumCompute; import ch.cyberduck.core.cryptomator.random.RandomNonceGenerator; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.io.SHA256ChecksumCompute; import ch.cyberduck.core.transfer.TransferStatus; import ch.cyberduck.core.vault.VaultCredentials; @@ -52,11 +51,6 @@ public Path mkdir(final Path folder, final TransferStatus status) { assertTrue(folder.equals(vault) || folder.isChild(vault)); return folder; } - - @Override - public Directory withWriter(final Write writer) { - return this; - } }; } return super._getFeature(type); @@ -72,11 +66,11 @@ public Directory withWriter(final Write writer) { final RandomNonceGenerator nonces = new RandomNonceGenerator(cryptomator.getNonceSize()); assertNotNull(compute.compute(new NullInputStream(1025L), new TransferStatus().withLength(1025L).withHeader(header).withNonces(nonces)).hash); assertNotEquals(compute.compute(new NullInputStream(1025L), new TransferStatus().withLength(1025L).withHeader(header).withNonces(nonces)), - compute.compute(new NullInputStream(1025L), new TransferStatus().withLength(1025L).withHeader(header).withNonces(nonces))); + compute.compute(new NullInputStream(1025L), new TransferStatus().withLength(1025L).withHeader(header).withNonces(nonces))); assertNotNull(compute.compute(new NullInputStream(0L), new TransferStatus().withLength(0L).withHeader(header).withNonces(nonces)).hash); assertEquals(compute.compute(new NullInputStream(0L), new TransferStatus().withHeader(header).withNonces(nonces)), compute.compute(new NullInputStream(0L), new TransferStatus().withHeader(header).withNonces(nonces))); assertNotEquals(compute.compute(new NullInputStream(0L), new TransferStatus().withHeader(header).withNonces(nonces)), - sha.compute(new NullInputStream(0L), new TransferStatus())); + sha.compute(new NullInputStream(0L), new TransferStatus())); } } diff --git a/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/CryptoOutputStreamTest.java b/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/CryptoOutputStreamTest.java index bbc2dc9bf81..40c16fe647f 100644 --- a/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/CryptoOutputStreamTest.java +++ b/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/CryptoOutputStreamTest.java @@ -21,7 +21,6 @@ import ch.cyberduck.core.TestProtocol; import ch.cyberduck.core.cryptomator.random.RandomNonceGenerator; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import ch.cyberduck.core.vault.VaultCredentials; @@ -54,11 +53,6 @@ public Path mkdir(final Path folder, final TransferStatus status) { assertTrue(folder.equals(home) || folder.isChild(home)); return folder; } - - @Override - public Directory withWriter(final Write writer) { - return this; - } }; } return super._getFeature(type); diff --git a/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/CryptoVaultTest.java b/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/CryptoVaultTest.java index 2c688b35210..4bcfc9c8d12 100644 --- a/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/CryptoVaultTest.java +++ b/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/CryptoVaultTest.java @@ -33,7 +33,6 @@ import ch.cyberduck.core.features.Directory; import ch.cyberduck.core.features.Read; import ch.cyberduck.core.features.Vault; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.preferences.PreferencesFactory; import ch.cyberduck.core.serializer.PathDictionary; import ch.cyberduck.core.transfer.TransferStatus; @@ -424,11 +423,6 @@ public Path mkdir(final Path folder, final TransferStatus status) { assertTrue(folder.equals(home) || folder.isChild(home)); return folder; } - - @Override - public Directory withWriter(final Write writer) { - return this; - } }; } return super._getFeature(type); @@ -453,11 +447,6 @@ public Path mkdir(final Path folder, final TransferStatus status) { assertTrue(folder.equals(home) || folder.isChild(home)); return folder; } - - @Override - public Directory withWriter(final Write writer) { - return this; - } }; } return super._getFeature(type); @@ -503,11 +492,6 @@ public Path mkdir(final Path folder, final TransferStatus status) { assertTrue(folder.equals(home) || folder.isChild(home)); return folder; } - - @Override - public Directory withWriter(final Write writer) { - return this; - } }; } return super._getFeature(type); @@ -558,11 +542,6 @@ public Path mkdir(final Path folder, final TransferStatus status) { public boolean isSupported(final Path workdir, final String name) { throw new UnsupportedOperationException(); } - - @Override - public Directory withWriter(final Write writer) { - return this; - } }; } return super._getFeature(type); diff --git a/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/CryptoWriteFeatureTest.java b/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/CryptoWriteFeatureTest.java index 8a421e55721..c27c6df290a 100644 --- a/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/CryptoWriteFeatureTest.java +++ b/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/CryptoWriteFeatureTest.java @@ -20,7 +20,6 @@ import ch.cyberduck.core.Path; import ch.cyberduck.core.TestProtocol; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import ch.cyberduck.core.vault.VaultCredentials; @@ -48,11 +47,6 @@ public Path mkdir(final Path folder, final TransferStatus status) { assertTrue(folder.equals(home) || folder.isChild(home)); return folder; } - - @Override - public Directory withWriter(final Write writer) { - return this; - } }; } return super._getFeature(type); @@ -90,11 +84,6 @@ public Path mkdir(final Path folder, final TransferStatus status) { assertTrue(folder.equals(home) || folder.isChild(home)); return folder; } - - @Override - public Directory withWriter(final Write writer) { - return this; - } }; } return super._getFeature(type); diff --git a/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/features/CryptoBulkFeatureTest.java b/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/features/CryptoBulkFeatureTest.java index f2e71a90609..52f12e31f97 100644 --- a/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/features/CryptoBulkFeatureTest.java +++ b/cryptomator/src/test/java/ch/cyberduck/core/cryptomator/features/CryptoBulkFeatureTest.java @@ -27,7 +27,6 @@ import ch.cyberduck.core.features.Bulk; import ch.cyberduck.core.features.Delete; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.Transfer; import ch.cyberduck.core.transfer.TransferItem; import ch.cyberduck.core.transfer.TransferStatus; @@ -59,11 +58,6 @@ public T _getFeature(final Class type) { public Path mkdir(final Path folder, final TransferStatus status) { return folder; } - - @Override - public Directory withWriter(final Write writer) { - return this; - } }; } return super._getFeature(type); @@ -137,11 +131,6 @@ public T _getFeature(final Class type) { public Path mkdir(final Path folder, final TransferStatus status) { return folder; } - - @Override - public Directory withWriter(final Write writer) { - return this; - } }; } return super._getFeature(type); diff --git a/deepbox/src/main/java/ch/cyberduck/core/deepbox/DeepboxDirectoryFeature.java b/deepbox/src/main/java/ch/cyberduck/core/deepbox/DeepboxDirectoryFeature.java index 8f3ff55524b..b5b4ad13ff6 100644 --- a/deepbox/src/main/java/ch/cyberduck/core/deepbox/DeepboxDirectoryFeature.java +++ b/deepbox/src/main/java/ch/cyberduck/core/deepbox/DeepboxDirectoryFeature.java @@ -27,7 +27,6 @@ import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.exception.ConflictException; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import org.apache.logging.log4j.LogManager; @@ -90,11 +89,6 @@ public Path mkdir(final Path folder, final TransferStatus status) throws Backgro } } - @Override - public Directory withWriter(final Write writer) { - return this; - } - @Override public void preflight(final Path workdir, final String filename) throws BackgroundException { if(workdir.isRoot() || (new DeepboxPathContainerService(session, fileid).isContainer(workdir) && !new DeepboxPathContainerService(session, fileid).isDocuments(workdir))) { diff --git a/dracoon/src/main/java/ch/cyberduck/core/sds/SDSDirectoryFeature.java b/dracoon/src/main/java/ch/cyberduck/core/sds/SDSDirectoryFeature.java index 9c165b2d20b..b4f71adba4d 100644 --- a/dracoon/src/main/java/ch/cyberduck/core/sds/SDSDirectoryFeature.java +++ b/dracoon/src/main/java/ch/cyberduck/core/sds/SDSDirectoryFeature.java @@ -23,7 +23,6 @@ import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.exception.InvalidFilenameException; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.preferences.HostPreferences; import ch.cyberduck.core.sds.io.swagger.client.ApiException; import ch.cyberduck.core.sds.io.swagger.client.api.NodesApi; @@ -120,9 +119,4 @@ public void preflight(final Path workdir, final String filename) throws Backgrou throw new AccessDeniedException(MessageFormat.format(LocaleFactory.localizedString("Cannot create folder {0}", "Error"), filename)).withFile(workdir); } } - - @Override - public Directory withWriter(final Write writer) { - return this; - } } diff --git a/dropbox/src/main/java/ch/cyberduck/core/dropbox/DropboxDirectoryFeature.java b/dropbox/src/main/java/ch/cyberduck/core/dropbox/DropboxDirectoryFeature.java index fb4b4b67a17..299be45ced9 100644 --- a/dropbox/src/main/java/ch/cyberduck/core/dropbox/DropboxDirectoryFeature.java +++ b/dropbox/src/main/java/ch/cyberduck/core/dropbox/DropboxDirectoryFeature.java @@ -21,7 +21,6 @@ import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.exception.InvalidFilenameException; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import java.text.MessageFormat; @@ -44,7 +43,7 @@ public DropboxDirectoryFeature(final DropboxSession session) { public Path mkdir(final Path folder, final TransferStatus status) throws BackgroundException { try { final CreateFolderResult result = new DbxUserFilesRequests(session.getClient(folder.getParent())) - .createFolderV2(containerService.getKey(folder), false); + .createFolderV2(containerService.getKey(folder), false); return folder.withAttributes(new DropboxAttributesFinderFeature(session).toAttributes(result.getMetadata())); } catch(DbxException e) { @@ -58,9 +57,4 @@ public void preflight(final Path workdir, final String filename) throws Backgrou throw new InvalidFilenameException(MessageFormat.format(LocaleFactory.localizedString("Cannot create folder {0}", "Error"), filename)); } } - - @Override - public DropboxDirectoryFeature withWriter(final Write writer) { - return this; - } } diff --git a/eue/src/main/java/ch/cyberduck/core/eue/EueDirectoryFeature.java b/eue/src/main/java/ch/cyberduck/core/eue/EueDirectoryFeature.java index ce02bf06d66..a400b91d48f 100644 --- a/eue/src/main/java/ch/cyberduck/core/eue/EueDirectoryFeature.java +++ b/eue/src/main/java/ch/cyberduck/core/eue/EueDirectoryFeature.java @@ -28,7 +28,6 @@ import ch.cyberduck.core.exception.InvalidFilenameException; import ch.cyberduck.core.exception.NotfoundException; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import org.apache.commons.lang3.StringUtils; @@ -94,9 +93,4 @@ public void preflight(final Path workdir, final String filename) throws Backgrou throw new InvalidFilenameException(MessageFormat.format(LocaleFactory.localizedString("Cannot create folder {0}", "Error"), filename)); } } - - @Override - public Directory withWriter(final Write writer) { - return this; - } } diff --git a/ftp/src/main/java/ch/cyberduck/core/ftp/FTPDirectoryFeature.java b/ftp/src/main/java/ch/cyberduck/core/ftp/FTPDirectoryFeature.java index 70e0088459b..8e0a726fc1e 100644 --- a/ftp/src/main/java/ch/cyberduck/core/ftp/FTPDirectoryFeature.java +++ b/ftp/src/main/java/ch/cyberduck/core/ftp/FTPDirectoryFeature.java @@ -21,7 +21,6 @@ import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.exception.ConflictException; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import org.apache.commons.net.ftp.FTPReply; @@ -60,9 +59,4 @@ public Path mkdir(final Path folder, final TransferStatus status) throws Backgro public void preflight(final Path workdir, final String filename) { // Skip checking permission mask } - - @Override - public FTPDirectoryFeature withWriter(final Write writer) { - return this; - } } diff --git a/googledrive/src/main/java/ch/cyberduck/core/googledrive/DriveDirectoryFeature.java b/googledrive/src/main/java/ch/cyberduck/core/googledrive/DriveDirectoryFeature.java index 0a8581b1157..65c372aae88 100644 --- a/googledrive/src/main/java/ch/cyberduck/core/googledrive/DriveDirectoryFeature.java +++ b/googledrive/src/main/java/ch/cyberduck/core/googledrive/DriveDirectoryFeature.java @@ -24,7 +24,6 @@ import ch.cyberduck.core.exception.ConflictException; import ch.cyberduck.core.exception.NotfoundException; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.preferences.HostPreferences; import ch.cyberduck.core.transfer.TransferStatus; @@ -80,12 +79,6 @@ public Path mkdir(final Path folder, final TransferStatus status) throws Backgro } } - @Override - public DriveDirectoryFeature withWriter(final Write writer) { - return this; - } - - @Override public void preflight(final Path workdir, final String filename) throws BackgroundException { new DriveTouchFeature(session, fileid).preflight(workdir, filename); diff --git a/irods/src/main/java/ch/cyberduck/core/irods/IRODSDirectoryFeature.java b/irods/src/main/java/ch/cyberduck/core/irods/IRODSDirectoryFeature.java index 892bfae3823..0547329941b 100644 --- a/irods/src/main/java/ch/cyberduck/core/irods/IRODSDirectoryFeature.java +++ b/irods/src/main/java/ch/cyberduck/core/irods/IRODSDirectoryFeature.java @@ -20,7 +20,6 @@ import ch.cyberduck.core.Path; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import org.irods.jargon.core.exception.JargonException; @@ -47,9 +46,4 @@ public Path mkdir(final Path folder, final TransferStatus status) throws Backgro throw new IRODSExceptionMappingService().map("Cannot create folder {0}", e, folder); } } - - @Override - public IRODSDirectoryFeature withWriter(final Write writer) { - return this; - } } diff --git a/manta/src/main/java/ch/cyberduck/core/manta/MantaDirectoryFeature.java b/manta/src/main/java/ch/cyberduck/core/manta/MantaDirectoryFeature.java index ff5d1cb3e20..17d8bbb732c 100644 --- a/manta/src/main/java/ch/cyberduck/core/manta/MantaDirectoryFeature.java +++ b/manta/src/main/java/ch/cyberduck/core/manta/MantaDirectoryFeature.java @@ -21,7 +21,6 @@ import ch.cyberduck.core.exception.AccessDeniedException; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import java.io.IOException; @@ -61,9 +60,4 @@ public void preflight(final Path workdir, final String filename) throws Backgrou throw new AccessDeniedException(MessageFormat.format(LocaleFactory.localizedString("Cannot create folder {0}", "Error"), filename)).withFile(workdir); } } - - @Override - public Directory withWriter(final Write writer) { - return this; - } } diff --git a/nio/src/main/java/ch/cyberduck/core/nio/LocalDirectoryFeature.java b/nio/src/main/java/ch/cyberduck/core/nio/LocalDirectoryFeature.java index b22e19c4769..0fb4d958dc9 100644 --- a/nio/src/main/java/ch/cyberduck/core/nio/LocalDirectoryFeature.java +++ b/nio/src/main/java/ch/cyberduck/core/nio/LocalDirectoryFeature.java @@ -18,7 +18,6 @@ import ch.cyberduck.core.Path; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import java.io.IOException; @@ -42,9 +41,4 @@ public Path mkdir(final Path folder, final TransferStatus status) throws Backgro } return folder; } - - @Override - public Directory withWriter(final Write writer) { - return this; - } } diff --git a/onedrive/src/main/java/ch/cyberduck/core/onedrive/features/GraphDirectoryFeature.java b/onedrive/src/main/java/ch/cyberduck/core/onedrive/features/GraphDirectoryFeature.java index 10af76d1752..af53b85ac3b 100644 --- a/onedrive/src/main/java/ch/cyberduck/core/onedrive/features/GraphDirectoryFeature.java +++ b/onedrive/src/main/java/ch/cyberduck/core/onedrive/features/GraphDirectoryFeature.java @@ -22,7 +22,6 @@ import ch.cyberduck.core.exception.AccessDeniedException; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.onedrive.GraphExceptionMappingService; import ch.cyberduck.core.onedrive.GraphSession; import ch.cyberduck.core.transfer.TransferStatus; @@ -69,9 +68,4 @@ public void preflight(final Path workdir, final String filename) throws Backgrou throw new AccessDeniedException(MessageFormat.format(LocaleFactory.localizedString("Cannot create folder {0}", "Error"), filename)).withFile(workdir); } } - - @Override - public Directory withWriter(final Write writer) { - return this; - } } diff --git a/smb/src/main/java/ch/cyberduck/core/smb/SMBDirectoryFeature.java b/smb/src/main/java/ch/cyberduck/core/smb/SMBDirectoryFeature.java index 64f2fdee108..80907b9bab5 100644 --- a/smb/src/main/java/ch/cyberduck/core/smb/SMBDirectoryFeature.java +++ b/smb/src/main/java/ch/cyberduck/core/smb/SMBDirectoryFeature.java @@ -18,7 +18,6 @@ import ch.cyberduck.core.Path; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import com.hierynomus.smbj.common.SMBRuntimeException; @@ -45,9 +44,4 @@ public Path mkdir(final Path folder, final TransferStatus status) throws Backgro } return folder; } - - @Override - public SMBDirectoryFeature withWriter(final Write writer) { - return this; - } } diff --git a/ssh/src/main/java/ch/cyberduck/core/sftp/SFTPDirectoryFeature.java b/ssh/src/main/java/ch/cyberduck/core/sftp/SFTPDirectoryFeature.java index cceb70cbb0b..49389a4e9e3 100644 --- a/ssh/src/main/java/ch/cyberduck/core/sftp/SFTPDirectoryFeature.java +++ b/ssh/src/main/java/ch/cyberduck/core/sftp/SFTPDirectoryFeature.java @@ -21,7 +21,6 @@ import ch.cyberduck.core.Permission; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import java.io.IOException; @@ -53,9 +52,4 @@ public Path mkdir(final Path folder, final TransferStatus status) throws Backgro } return folder; } - - @Override - public SFTPDirectoryFeature withWriter(final Write writer) { - return this; - } } diff --git a/storegate/src/main/java/ch/cyberduck/core/storegate/StoregateDirectoryFeature.java b/storegate/src/main/java/ch/cyberduck/core/storegate/StoregateDirectoryFeature.java index 415b3371695..5b72c185259 100644 --- a/storegate/src/main/java/ch/cyberduck/core/storegate/StoregateDirectoryFeature.java +++ b/storegate/src/main/java/ch/cyberduck/core/storegate/StoregateDirectoryFeature.java @@ -21,7 +21,6 @@ import ch.cyberduck.core.exception.AccessDeniedException; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.storegate.io.swagger.client.ApiException; import ch.cyberduck.core.storegate.io.swagger.client.api.FilesApi; import ch.cyberduck.core.storegate.io.swagger.client.model.CreateFolderRequest; @@ -56,11 +55,6 @@ public Path mkdir(final Path folder, final TransferStatus status) throws Backgro } } - @Override - public Directory withWriter(final Write writer) { - return this; - } - @Override public void preflight(final Path workdir, final String filename) throws BackgroundException { if(workdir.isRoot()) { diff --git a/webdav/src/main/java/ch/cyberduck/core/dav/DAVDirectoryFeature.java b/webdav/src/main/java/ch/cyberduck/core/dav/DAVDirectoryFeature.java index 5b848650670..b6049237d67 100644 --- a/webdav/src/main/java/ch/cyberduck/core/dav/DAVDirectoryFeature.java +++ b/webdav/src/main/java/ch/cyberduck/core/dav/DAVDirectoryFeature.java @@ -21,7 +21,6 @@ import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.AttributesFinder; import ch.cyberduck.core.features.Directory; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.http.HttpExceptionMappingService; import ch.cyberduck.core.transfer.TransferStatus; @@ -54,9 +53,4 @@ public Path mkdir(final Path folder, final TransferStatus status) throws Backgro } return folder; } - - @Override - public DAVDirectoryFeature withWriter(final Write writer) { - return this; - } } From 2408f461075628216947aecf70bce19f2245d0a5 Mon Sep 17 00:00:00 2001 From: David Kocher Date: Fri, 8 Nov 2024 20:43:04 +0100 Subject: [PATCH 2/3] Add default no-op implementation to interface. --- .../java/ch/cyberduck/core/brick/BrickTouchFeature.java | 6 ------ core/src/main/java/ch/cyberduck/core/features/Touch.java | 4 +++- .../core/cryptomator/features/CryptoTouchFeature.java | 5 ----- .../ch/cyberduck/core/googledrive/DriveTouchFeature.java | 6 ------ .../java/ch/cyberduck/core/irods/IRODSTouchFeature.java | 8 +------- .../java/ch/cyberduck/core/manta/MantaTouchFeature.java | 6 ------ .../java/ch/cyberduck/core/nio/LocalTouchFeature.java | 6 ------ .../core/onedrive/features/GraphTouchFeature.java | 6 ------ .../java/ch/cyberduck/core/sftp/SFTPTouchFeature.java | 6 ------ 9 files changed, 4 insertions(+), 49 deletions(-) diff --git a/brick/src/main/java/ch/cyberduck/core/brick/BrickTouchFeature.java b/brick/src/main/java/ch/cyberduck/core/brick/BrickTouchFeature.java index a0449225ee7..caa2251ce36 100644 --- a/brick/src/main/java/ch/cyberduck/core/brick/BrickTouchFeature.java +++ b/brick/src/main/java/ch/cyberduck/core/brick/BrickTouchFeature.java @@ -22,7 +22,6 @@ import ch.cyberduck.core.brick.io.swagger.client.model.FileUploadPartEntity; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Touch; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import java.io.IOException; @@ -54,9 +53,4 @@ public Path touch(final Path file, final TransferStatus status) throws Backgroun throw new DefaultIOExceptionMappingService().map("Cannot create {0}", e, file); } } - - @Override - public Touch withWriter(final Write writer) { - return this; - } } diff --git a/core/src/main/java/ch/cyberduck/core/features/Touch.java b/core/src/main/java/ch/cyberduck/core/features/Touch.java index 5a32502c8f5..aa7e7f5b617 100644 --- a/core/src/main/java/ch/cyberduck/core/features/Touch.java +++ b/core/src/main/java/ch/cyberduck/core/features/Touch.java @@ -43,7 +43,9 @@ default boolean isSupported(final Path workdir, final String filename) { } } - Touch withWriter(Write writer); + default Touch withWriter(Write writer) { + return this; + } /** * @throws AccessDeniedException Permission failure for target directory diff --git a/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoTouchFeature.java b/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoTouchFeature.java index 205c84312a8..4fe570196a1 100644 --- a/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoTouchFeature.java +++ b/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoTouchFeature.java @@ -70,11 +70,6 @@ public void preflight(final Path workdir, final String filename) throws Backgrou proxy.preflight(workdir, filename); } - @Override - public CryptoTouchFeature withWriter(final Write writer) { - return this; - } - @Override public String toString() { final StringBuilder sb = new StringBuilder("CryptoTouchFeature{"); diff --git a/googledrive/src/main/java/ch/cyberduck/core/googledrive/DriveTouchFeature.java b/googledrive/src/main/java/ch/cyberduck/core/googledrive/DriveTouchFeature.java index 8f97d42ec05..841be9ca4e3 100644 --- a/googledrive/src/main/java/ch/cyberduck/core/googledrive/DriveTouchFeature.java +++ b/googledrive/src/main/java/ch/cyberduck/core/googledrive/DriveTouchFeature.java @@ -24,7 +24,6 @@ import ch.cyberduck.core.exception.ConflictException; import ch.cyberduck.core.exception.NotfoundException; import ch.cyberduck.core.features.Touch; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.preferences.HostPreferences; import ch.cyberduck.core.transfer.TransferStatus; @@ -71,11 +70,6 @@ public Path touch(final Path file, final TransferStatus status) throws Backgroun } } - @Override - public DriveTouchFeature withWriter(final Write writer) { - return this; - } - @Override public void preflight(final Path workdir, final String filename) throws BackgroundException { if(workdir.isRoot()) { diff --git a/irods/src/main/java/ch/cyberduck/core/irods/IRODSTouchFeature.java b/irods/src/main/java/ch/cyberduck/core/irods/IRODSTouchFeature.java index e2b699e7609..acd8db1949a 100644 --- a/irods/src/main/java/ch/cyberduck/core/irods/IRODSTouchFeature.java +++ b/irods/src/main/java/ch/cyberduck/core/irods/IRODSTouchFeature.java @@ -20,7 +20,6 @@ import ch.cyberduck.core.Path; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Touch; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import org.irods.jargon.core.exception.JargonException; @@ -40,7 +39,7 @@ public Path touch(final Path file, final TransferStatus status) throws Backgroun try { final IRODSFileSystemAO fs = session.getClient(); final int descriptor = fs.createFile(file.getAbsolute(), - DataObjInp.OpenFlags.WRITE_TRUNCATE, DataObjInp.DEFAULT_CREATE_MODE); + DataObjInp.OpenFlags.WRITE_TRUNCATE, DataObjInp.DEFAULT_CREATE_MODE); fs.fileClose(descriptor, false); return file; } @@ -48,9 +47,4 @@ public Path touch(final Path file, final TransferStatus status) throws Backgroun throw new IRODSExceptionMappingService().map("Cannot create {0}", e, file); } } - - @Override - public Touch withWriter(final Write writer) { - return this; - } } diff --git a/manta/src/main/java/ch/cyberduck/core/manta/MantaTouchFeature.java b/manta/src/main/java/ch/cyberduck/core/manta/MantaTouchFeature.java index 5b3752aa357..4beb05b2c84 100644 --- a/manta/src/main/java/ch/cyberduck/core/manta/MantaTouchFeature.java +++ b/manta/src/main/java/ch/cyberduck/core/manta/MantaTouchFeature.java @@ -21,7 +21,6 @@ import ch.cyberduck.core.exception.AccessDeniedException; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Touch; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import java.io.IOException; @@ -65,9 +64,4 @@ public void preflight(final Path workdir, final String filename) throws Backgrou throw new AccessDeniedException(MessageFormat.format(LocaleFactory.localizedString("Cannot create {0}", "Error"), filename)).withFile(workdir); } } - - @Override - public Touch withWriter(final Write writer) { - return this; - } } diff --git a/nio/src/main/java/ch/cyberduck/core/nio/LocalTouchFeature.java b/nio/src/main/java/ch/cyberduck/core/nio/LocalTouchFeature.java index 1e15c9e37f9..b727e0666ce 100644 --- a/nio/src/main/java/ch/cyberduck/core/nio/LocalTouchFeature.java +++ b/nio/src/main/java/ch/cyberduck/core/nio/LocalTouchFeature.java @@ -17,7 +17,6 @@ import ch.cyberduck.core.Path; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Touch; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import java.io.IOException; @@ -47,10 +46,5 @@ public Path touch(final Path file, final TransferStatus status) throws Backgroun } return file; } - - @Override - public Touch withWriter(final Write writer) { - return this; - } } diff --git a/onedrive/src/main/java/ch/cyberduck/core/onedrive/features/GraphTouchFeature.java b/onedrive/src/main/java/ch/cyberduck/core/onedrive/features/GraphTouchFeature.java index ce3928dfe79..261598cc3d0 100644 --- a/onedrive/src/main/java/ch/cyberduck/core/onedrive/features/GraphTouchFeature.java +++ b/onedrive/src/main/java/ch/cyberduck/core/onedrive/features/GraphTouchFeature.java @@ -24,7 +24,6 @@ import ch.cyberduck.core.exception.AccessDeniedException; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Touch; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.onedrive.GraphExceptionMappingService; import ch.cyberduck.core.onedrive.GraphSession; import ch.cyberduck.core.transfer.TransferStatus; @@ -71,9 +70,4 @@ public void preflight(final Path workdir, final String filename) throws Backgrou throw new AccessDeniedException(MessageFormat.format(LocaleFactory.localizedString("Cannot create {0}", "Error"), filename)).withFile(workdir); } } - - @Override - public Touch withWriter(final Write writer) { - return this; - } } diff --git a/ssh/src/main/java/ch/cyberduck/core/sftp/SFTPTouchFeature.java b/ssh/src/main/java/ch/cyberduck/core/sftp/SFTPTouchFeature.java index 1d19dfdfe75..494686d3f09 100644 --- a/ssh/src/main/java/ch/cyberduck/core/sftp/SFTPTouchFeature.java +++ b/ssh/src/main/java/ch/cyberduck/core/sftp/SFTPTouchFeature.java @@ -21,7 +21,6 @@ import ch.cyberduck.core.Permission; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Touch; -import ch.cyberduck.core.features.Write; import ch.cyberduck.core.transfer.TransferStatus; import java.io.IOException; @@ -58,9 +57,4 @@ public Path touch(final Path file, final TransferStatus status) throws Backgroun } return file; } - - @Override - public SFTPTouchFeature withWriter(final Write writer) { - return this; - } } From 944c2995c4c527664dfff1723d2b6e59f77da764 Mon Sep 17 00:00:00 2001 From: David Kocher Date: Sat, 9 Nov 2024 13:02:22 +0100 Subject: [PATCH 3/3] Fix #15489. --- .../features/CryptoDirectoryV6Feature.java | 4 +-- .../features/CryptoDirectoryV7Feature.java | 4 +-- .../GoogleStorageListServiceTest.java | 30 +++++++++++++++---- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoDirectoryV6Feature.java b/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoDirectoryV6Feature.java index 0e85d46efbe..35f22439522 100644 --- a/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoDirectoryV6Feature.java +++ b/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoDirectoryV6Feature.java @@ -62,8 +62,8 @@ public Path mkdir(final Path folder, final TransferStatus status) throws Backgro log.debug("Write metadata {} for folder {}", directoryMetadataFile, folder); new ContentWriter(session).write(directoryMetadataFile, directoryId.getBytes(StandardCharsets.UTF_8)); final Path intermediate = encrypt.getParent(); - if(!find.find(intermediate)) { - delegate.mkdir(intermediate, new TransferStatus().withRegion(status.getRegion())); + if(!session._getFeature(Find.class).find(intermediate)) { + session._getFeature(Directory.class).mkdir(intermediate, new TransferStatus().withRegion(status.getRegion())); } // Write header final FileHeader header = vault.getFileHeaderCryptor().create(); diff --git a/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoDirectoryV7Feature.java b/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoDirectoryV7Feature.java index 2f93b1876b9..4a89c60ca22 100644 --- a/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoDirectoryV7Feature.java +++ b/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoDirectoryV7Feature.java @@ -68,8 +68,8 @@ public Path mkdir(final Path folder, final TransferStatus status) throws Backgro log.debug("Write metadata {} for folder {}", directoryMetadataFile, folder); new ContentWriter(session).write(directoryMetadataFile, directoryId.getBytes(StandardCharsets.UTF_8)); final Path intermediate = encrypt.getParent(); - if(!find.find(intermediate)) { - delegate.mkdir(intermediate, new TransferStatus().withRegion(status.getRegion())); + if(!session._getFeature(Find.class).find(intermediate)) { + session._getFeature(Directory.class).mkdir(intermediate, new TransferStatus().withRegion(status.getRegion())); } // Write header final FileHeader header = vault.getFileHeaderCryptor().create(); diff --git a/googlestorage/src/test/java/ch/cyberduck/core/cryptomator/GoogleStorageListServiceTest.java b/googlestorage/src/test/java/ch/cyberduck/core/cryptomator/GoogleStorageListServiceTest.java index 9485d5f82f9..76e4bd60082 100644 --- a/googlestorage/src/test/java/ch/cyberduck/core/cryptomator/GoogleStorageListServiceTest.java +++ b/googlestorage/src/test/java/ch/cyberduck/core/cryptomator/GoogleStorageListServiceTest.java @@ -22,14 +22,17 @@ import ch.cyberduck.core.DisabledPasswordStore; import ch.cyberduck.core.Path; import ch.cyberduck.core.SimplePathPredicate; +import ch.cyberduck.core.cryptomator.features.CryptoDirectoryV7Feature; import ch.cyberduck.core.cryptomator.features.CryptoListService; import ch.cyberduck.core.cryptomator.features.CryptoTouchFeature; import ch.cyberduck.core.features.Delete; import ch.cyberduck.core.googlestorage.AbstractGoogleStorageTest; import ch.cyberduck.core.googlestorage.GoogleStorageDeleteFeature; +import ch.cyberduck.core.googlestorage.GoogleStorageDirectoryFeature; +import ch.cyberduck.core.googlestorage.GoogleStorageFindFeature; import ch.cyberduck.core.googlestorage.GoogleStorageObjectListService; +import ch.cyberduck.core.googlestorage.GoogleStorageTouchFeature; import ch.cyberduck.core.googlestorage.GoogleStorageWriteFeature; -import ch.cyberduck.core.shared.DefaultTouchFeature; import ch.cyberduck.core.transfer.TransferStatus; import ch.cyberduck.core.vault.DefaultVaultRegistry; import ch.cyberduck.core.vault.VaultCredentials; @@ -43,6 +46,8 @@ import java.util.Arrays; import java.util.EnumSet; +import com.google.api.services.storage.model.StorageObject; + import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -57,11 +62,24 @@ public void testListCryptomator() throws Exception { new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory))); final Path vault = cryptomator.create(session, new VaultCredentials("test"), vaultVersion); session.withRegistry(new DefaultVaultRegistry(new DisabledPasswordStore(), new DisabledPasswordCallback(), cryptomator)); - final Path test = new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)); assertTrue(new CryptoListService(session, new GoogleStorageObjectListService(session), cryptomator).list(vault, new DisabledListProgressListener()).isEmpty()); - new CryptoTouchFeature<>(session, new DefaultTouchFeature<>(new GoogleStorageWriteFeature(session)), new GoogleStorageWriteFeature(session), cryptomator).touch(test, new TransferStatus()); - assertNotNull(new CryptoListService(session, new GoogleStorageObjectListService(session), cryptomator).list(vault, new DisabledListProgressListener()). - find(new SimplePathPredicate(test))); - cryptomator.getFeature(session, Delete.class, new GoogleStorageDeleteFeature(session)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback()); + final CryptoDirectoryV7Feature mkdir = new CryptoDirectoryV7Feature<>(session, new GoogleStorageDirectoryFeature(session), + new GoogleStorageWriteFeature(session), new GoogleStorageFindFeature(session), cryptomator); + final Path directory1 = mkdir.mkdir( + new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus()); + assertNotNull(new CryptoListService(session, new GoogleStorageObjectListService(session), cryptomator).list(vault, new DisabledListProgressListener()) + .find(new SimplePathPredicate(directory1))); + final CryptoTouchFeature touch = new CryptoTouchFeature<>(session, new GoogleStorageTouchFeature(session), + new GoogleStorageWriteFeature(session), cryptomator); + final Path test = touch.touch( + new Path(directory1, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus()); + assertNotNull(new CryptoListService(session, new GoogleStorageObjectListService(session), cryptomator).list(directory1, new DisabledListProgressListener()) + .find(new SimplePathPredicate(test))); + final Path directory2 = mkdir.mkdir( + new Path(directory1, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus()); + assertNotNull(new CryptoListService(session, new GoogleStorageObjectListService(session), cryptomator).list(directory1, new DisabledListProgressListener()) + .find(new SimplePathPredicate(directory2))); + cryptomator.getFeature(session, Delete.class, new GoogleStorageDeleteFeature(session)) + .delete(Arrays.asList(test, directory1, vault), new DisabledLoginCallback(), new Delete.DisabledCallback()); } }