Skip to content

Commit

Permalink
Add default no-op implementation to interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Nov 11, 2024
1 parent e4ab842 commit 2408f46
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<FileEntity> withWriter(final Write<FileEntity> writer) {
return this;
}
}
4 changes: 3 additions & 1 deletion core/src/main/java/ch/cyberduck/core/features/Touch.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ default boolean isSupported(final Path workdir, final String filename) {
}
}

Touch<Reply> withWriter(Write<Reply> writer);
default Touch<Reply> withWriter(Write<Reply> writer) {
return this;
}

/**
* @throws AccessDeniedException Permission failure for target directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ public void preflight(final Path workdir, final String filename) throws Backgrou
proxy.preflight(workdir, filename);
}

@Override
public CryptoTouchFeature<Reply> withWriter(final Write<Reply> writer) {
return this;
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder("CryptoTouchFeature{");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -71,11 +70,6 @@ public Path touch(final Path file, final TransferStatus status) throws Backgroun
}
}

@Override
public DriveTouchFeature withWriter(final Write<VersionId> writer) {
return this;
}

@Override
public void preflight(final Path workdir, final String filename) throws BackgroundException {
if(workdir.isRoot()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -40,17 +39,12 @@ 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;
}
catch(JargonException e) {
throw new IRODSExceptionMappingService().map("Cannot create {0}", e, file);
}
}

@Override
public Touch withWriter(final Write writer) {
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<DriveItem.Metadata> withWriter(final Write writer) {
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 2408f46

Please sign in to comment.