Skip to content

Commit 69795a6

Browse files
committed
Add writer as parameter to allow wrapping with encryption feature.
1 parent 86d4d6a commit 69795a6

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

nextcloud/src/main/java/ch/cyberduck/core/nextcloud/NextcloudSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public <T> T _getFeature(final Class<T> type) {
9999
return (T) new DAVDirectoryFeature(this, new NextcloudAttributesFinderFeature(this));
100100
}
101101
if(type == Touch.class) {
102-
return (T) new DAVTouchFeature(new NextcloudWriteFeature(this));
102+
return (T) new DAVTouchFeature(this);
103103
}
104104
if(type == AttributesFinder.class) {
105105
return (T) new NextcloudAttributesFinderFeature(this);

nextcloud/src/test/java/ch/cyberduck/core/nextcloud/NextcloudAttributesFinderFeatureTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void testFindNotFound() throws Exception {
6767
@Test
6868
public void testFindFile() throws Exception {
6969
final Checksum checksum = ChecksumComputeFactory.get(HashAlgorithm.sha1).compute(new NullInputStream(0L), new TransferStatus());
70-
final Path test = new DAVTouchFeature(new NextcloudWriteFeature(session)).touch(new Path(new DefaultHomeFinderService(session).find(),
70+
final Path test = new DAVTouchFeature(session).touch(new NextcloudWriteFeature(session), new Path(new DefaultHomeFinderService(session).find(),
7171
new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus().setChecksum(checksum));
7272
final NextcloudAttributesFinderFeature f = new NextcloudAttributesFinderFeature(session);
7373
final PathAttributes attributes = f.find(test);
@@ -95,7 +95,7 @@ public void testFindFile() throws Exception {
9595
public void testFindDirectory() throws Exception {
9696
final Path home = new DefaultHomeFinderService(session).find();
9797
final Path directory = new DAVDirectoryFeature(session, new NextcloudAttributesFinderFeature(session)).mkdir(
98-
new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
98+
new NextcloudWriteFeature(session), new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
9999
final NextcloudAttributesFinderFeature f = new NextcloudAttributesFinderFeature(session);
100100
final PathAttributes attributes = f.find(directory);
101101
assertNotNull(attributes.getFileId());
@@ -189,7 +189,7 @@ public void testCustomModified_Epoch() {
189189

190190
@Test
191191
public void testFindLock() throws Exception {
192-
final Path test = new DAVTouchFeature(new NextcloudWriteFeature(session)).touch(new Path(new DefaultHomeFinderService(session).find(),
192+
final Path test = new DAVTouchFeature(session).touch(new NextcloudWriteFeature(session), new Path(new DefaultHomeFinderService(session).find(),
193193
new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
194194
final NextcloudAttributesFinderFeature f = new NextcloudAttributesFinderFeature(session);
195195
assertNull(f.find(test).getLockId());

nextcloud/src/test/java/ch/cyberduck/core/nextcloud/NextcloudListServiceTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void testListNotfound() throws Exception {
5656

5757
@Test(expected = NotfoundException.class)
5858
public void testListFileException() throws Exception {
59-
final Path test = new DAVTouchFeature(new NextcloudWriteFeature(session)).touch(new Path(new DefaultHomeFinderService(session).find(),
59+
final Path test = new DAVTouchFeature(session).touch(new NextcloudWriteFeature(session), new Path(new DefaultHomeFinderService(session).find(),
6060
new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
6161
try {
6262
final AttributedList<Path> list = new NextcloudListService(session).list(new Path(test.getAbsolute(), EnumSet.of(Path.Type.directory, Path.Type.volume)),
@@ -70,12 +70,12 @@ public void testListFileException() throws Exception {
7070
@Test
7171
public void testList() throws Exception {
7272
final Path home = new DefaultHomeFinderService(session).find();
73-
final Path directory = new DAVDirectoryFeature(session, new NextcloudAttributesFinderFeature(session)).mkdir(new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
73+
final Path directory = new DAVDirectoryFeature(session, new NextcloudAttributesFinderFeature(session)).mkdir(new NextcloudWriteFeature(session), new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
7474
final PathAttributes directoryAttributes = new DAVAttributesFinderFeature(session).find(directory);
7575
final String folderEtag = directoryAttributes.getETag();
7676
final long folderTimestamp = directoryAttributes.getModificationDate();
7777
Thread.sleep(1000L);
78-
final Path test = new DAVTouchFeature(new NextcloudWriteFeature(session)).touch(new Path(directory,
78+
final Path test = new DAVTouchFeature(session).touch(new NextcloudWriteFeature(session), new Path(directory,
7979
new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
8080
assertEquals(Protocol.DirectoryTimestamp.implicit, session.getHost().getProtocol().getDirectoryTimestamp());
8181
assertNotEquals(folderTimestamp, new DAVAttributesFinderFeature(session).find(directory).getModificationDate());

nextcloud/src/test/java/ch/cyberduck/core/nextcloud/NextcloudShareFeatureTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void testIsSupported() throws Exception {
5454
@Test
5555
public void testToDownloadUrlNoPassword() throws Exception {
5656
final Path home = new NextcloudHomeFeature(session.getHost()).find();
57-
final Path file = new DAVTouchFeature(new NextcloudWriteFeature(session)).touch(new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
57+
final Path file = new DAVTouchFeature(session).touch(new NextcloudWriteFeature(session), new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
5858
final DescriptiveUrl url = new NextcloudShareFeature(session).toDownloadUrl(file, Share.Sharee.world, null, new DisabledPasswordCallback());
5959
assertNotSame(DescriptiveUrl.EMPTY, url);
6060
new DAVDeleteFeature(session).delete(Collections.singletonList(file), new DisabledPasswordCallback(), new Delete.DisabledCallback());
@@ -63,7 +63,7 @@ public void testToDownloadUrlNoPassword() throws Exception {
6363
@Test
6464
public void testToDownloadUrlSharee() throws Exception {
6565
final Path home = new NextcloudHomeFeature(session.getHost()).find();
66-
final Path file = new DAVTouchFeature(new NextcloudWriteFeature(session)).touch(new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
66+
final Path file = new DAVTouchFeature(session).touch(new NextcloudWriteFeature(session), new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
6767
final NextcloudShareFeature provider = new NextcloudShareFeature(session);
6868
final Set<Share.Sharee> sharees = provider.getSharees(Share.Type.download);
6969
assertFalse(sharees.isEmpty());
@@ -80,7 +80,7 @@ public void testToDownloadUrlSharee() throws Exception {
8080
@Test
8181
public void testToUploadUrlNoPassword() throws Exception {
8282
final Path home = new NextcloudHomeFeature(session.getHost()).find();
83-
final Path folder = new DAVDirectoryFeature(session, new NextcloudAttributesFinderFeature(session)).mkdir(new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
83+
final Path folder = new DAVDirectoryFeature(session, new NextcloudAttributesFinderFeature(session)).mkdir(new NextcloudWriteFeature(session), new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
8484
final DescriptiveUrl url = new NextcloudShareFeature(session).toUploadUrl(folder, Share.Sharee.world, null, new DisabledPasswordCallback());
8585
assertNotSame(DescriptiveUrl.EMPTY, url);
8686
new DAVDeleteFeature(session).delete(Collections.singletonList(folder), new DisabledPasswordCallback(), new Delete.DisabledCallback());
@@ -89,7 +89,7 @@ public void testToUploadUrlNoPassword() throws Exception {
8989
@Test
9090
public void testToDownloadUrlPasswordTooShort() throws Exception {
9191
final Path home = new NextcloudHomeFeature(session.getHost()).find();
92-
final Path folder = new DAVDirectoryFeature(session, new NextcloudAttributesFinderFeature(session)).mkdir(new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
92+
final Path folder = new DAVDirectoryFeature(session, new NextcloudAttributesFinderFeature(session)).mkdir(new NextcloudWriteFeature(session), new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
9393
try {
9494
new NextcloudShareFeature(session).toDownloadUrl(folder, Share.Sharee.world, null, new DisabledPasswordCallback() {
9595
@Override
@@ -108,7 +108,7 @@ public Credentials prompt(final Host bookmark, final String title, final String
108108
@Test
109109
public void testToDownloadUrlPassword() throws Exception {
110110
final Path home = new NextcloudHomeFeature(session.getHost()).find();
111-
final Path file = new DAVTouchFeature(new NextcloudWriteFeature(session)).touch(new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
111+
final Path file = new DAVTouchFeature(session).touch(new NextcloudWriteFeature(session), new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
112112
final DescriptiveUrl url = new NextcloudShareFeature(session).toDownloadUrl(file, Share.Sharee.world, null, new DisabledPasswordCallback() {
113113
@Override
114114
public Credentials prompt(final Host bookmark, final String title, final String reason, final LoginOptions options) {
@@ -146,7 +146,7 @@ public Credentials prompt(final Host bookmark, final String title, final String
146146
@Test
147147
public void testToUploadUrl() throws Exception {
148148
final Path home = new NextcloudHomeFeature(session.getHost()).find();
149-
final Path folder = new DAVDirectoryFeature(session, new NextcloudAttributesFinderFeature(session)).mkdir(new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
149+
final Path folder = new DAVDirectoryFeature(session, new NextcloudAttributesFinderFeature(session)).mkdir(new NextcloudWriteFeature(session), new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
150150
final DescriptiveUrl url = new NextcloudShareFeature(session).toUploadUrl(folder, Share.Sharee.world, null, new DisabledPasswordCallback() {
151151
@Override
152152
public Credentials prompt(final Host bookmark, final String title, final String reason, final LoginOptions options) {
@@ -160,7 +160,7 @@ public Credentials prompt(final Host bookmark, final String title, final String
160160
@Test
161161
public void testToUploadUrlPasswordTooShort() throws Exception {
162162
final Path home = new NextcloudHomeFeature(session.getHost()).find();
163-
final Path folder = new DAVDirectoryFeature(session, new NextcloudAttributesFinderFeature(session)).mkdir(new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
163+
final Path folder = new DAVDirectoryFeature(session, new NextcloudAttributesFinderFeature(session)).mkdir(new NextcloudWriteFeature(session), new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
164164
try {
165165
new NextcloudShareFeature(session).toUploadUrl(folder, Share.Sharee.world, null, new DisabledPasswordCallback() {
166166
@Override

nextcloud/src/test/java/ch/cyberduck/core/nextcloud/NextcloudVersioningFeatureTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class NextcloudVersioningFeatureTest extends AbstractNextcloudTest {
4747

4848
@Test
4949
public void testRevert() throws Exception {
50-
final Path directory = new DAVDirectoryFeature(session, new NextcloudAttributesFinderFeature(session)).mkdir(new Path(new DefaultHomeFinderService(session).find(),
50+
final Path directory = new DAVDirectoryFeature(session, new NextcloudAttributesFinderFeature(session)).mkdir(new NextcloudWriteFeature(session), new Path(new DefaultHomeFinderService(session).find(),
5151
new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), new TransferStatus());
5252
final Path test = new Path(directory, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
5353
final TransferStatus status = new TransferStatus();

0 commit comments

Comments
 (0)