Skip to content

Commit

Permalink
Delete unused parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Nov 6, 2024
1 parent dd824f8 commit bab1684
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/

import ch.cyberduck.core.DirectoryDelimiterPathContainerService;
import ch.cyberduck.core.Local;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.PathContainerService;
import ch.cyberduck.core.exception.BackgroundException;
Expand Down Expand Up @@ -58,7 +57,7 @@ public AzureMetadataFeature(final AzureSession session, final OperationContext c
}

@Override
public Map<String, String> getDefault(final Local local) {
public Map<String, String> getDefault() {
return new HostPreferences(session.getHost()).getMap("azure.metadata.default");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* GNU General Public License for more details.
*/

import ch.cyberduck.core.Local;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.exception.BackgroundException;
import ch.cyberduck.core.features.Headers;
Expand All @@ -39,7 +38,7 @@ public B2MetadataFeature(final B2Session session, final B2VersionIdProvider file
}

@Override
public Map<String, String> getDefault(final Local file) {
public Map<String, String> getDefault() {
return new HostPreferences(session.getHost()).getMap("b2.metadata.default");
}

Expand Down
3 changes: 1 addition & 2 deletions core/src/main/java/ch/cyberduck/core/features/Metadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* GNU General Public License for more details.
*/

import ch.cyberduck.core.Local;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.exception.BackgroundException;
import ch.cyberduck.core.transfer.TransferStatus;
Expand All @@ -24,7 +23,7 @@

@Optional
public interface Metadata {
Map<String, String> getDefault(Local local);
Map<String, String> getDefault();

Map<String, String> getMetadata(Path file) throws BackgroundException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* GNU General Public License for more details.
*/

import ch.cyberduck.core.Local;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.features.Headers;
import ch.cyberduck.core.transfer.TransferStatus;
Expand All @@ -25,7 +24,7 @@

public class DisabledHeadersFeature implements Headers {
@Override
public Map<String, String> getDefault(final Local local) {
public Map<String, String> getDefault() {
return Collections.emptyMap();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ public TransferStatus prepare(final Path file, final Local local, final Transfer
// Look if there is directory or file that clashes with this upload
if(file.getType().contains(Path.Type.file)) {
if(find.find(new Path(file.getAbsolute(), EnumSet.of(Path.Type.directory)))) {
throw new AccessDeniedException(String.format("Cannot replace folder %s with file %s", file.getAbsolute(), local.getName()));
throw new AccessDeniedException(String.format("Cannot replace folder %s with file %s", file.getAbsolute(), file.getName()));
}
}
if(file.getType().contains(Path.Type.directory)) {
if(find.find(new Path(file.getAbsolute(), EnumSet.of(Path.Type.file)))) {
throw new AccessDeniedException(String.format("Cannot replace file %s with folder %s", file.getAbsolute(), local.getName()));
throw new AccessDeniedException(String.format("Cannot replace file %s with folder %s", file.getAbsolute(), file.getName()));
}
}
}
Expand Down Expand Up @@ -231,11 +231,11 @@ public TransferStatus prepare(final Path file, final Local local, final Transfer
status.setMetadata(feature.getMetadata(file));
}
catch(NotfoundException | AccessDeniedException | InteroperabilityException e) {
status.setMetadata(feature.getDefault(local));
status.setMetadata(feature.getDefault());
}
}
else {
status.setMetadata(feature.getDefault(local));
status.setMetadata(feature.getDefault());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* GNU General Public License for more details.
*/

import ch.cyberduck.core.Local;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.Session;
import ch.cyberduck.core.exception.BackgroundException;
Expand All @@ -38,8 +37,8 @@ public VaultRegistryHeadersFeature(final Session<?> session, final Headers proxy
}

@Override
public Map<String, String> getDefault(final Local local) {
return proxy.getDefault(local);
public Map<String, String> getDefault() {
return proxy.getDefault();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ch.cyberduck.core.worker;

import ch.cyberduck.core.Host;
import ch.cyberduck.core.Local;
import ch.cyberduck.core.NullSession;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.TestProtocol;
Expand Down Expand Up @@ -37,7 +36,7 @@ public <T> T _getFeature(final Class<T> type) {
if(type == Metadata.class) {
return (T) new Metadata() {
@Override
public Map<String, String> getDefault(final Local local) {
public Map<String, String> getDefault() {
return Collections.emptyMap();
}

Expand Down Expand Up @@ -76,7 +75,7 @@ public <T> T _getFeature(final Class<T> type) {
if(type == Metadata.class) {
return (T) new Metadata() {
@Override
public Map<String, String> getDefault(final Local local) {
public Map<String, String> getDefault() {
return Collections.emptyMap();
}

Expand Down Expand Up @@ -130,7 +129,7 @@ public <T> T _getFeature(final Class<T> type) {
if(type == Metadata.class) {
return (T) new Metadata() {
@Override
public Map<String, String> getDefault(final Local local) {
public Map<String, String> getDefault() {
return Collections.emptyMap();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import ch.cyberduck.core.DisabledProgressListener;
import ch.cyberduck.core.Host;
import ch.cyberduck.core.Local;
import ch.cyberduck.core.NullSession;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.Session;
Expand Down Expand Up @@ -122,7 +121,7 @@ public <T> T _getFeature(final Class<T> type) {
return (T) new Metadata() {

@Override
public Map<String, String> getDefault(Local local) {
public Map<String, String> getDefault() {
return Collections.emptyMap();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import ch.cyberduck.core.DisabledProgressListener;
import ch.cyberduck.core.Host;
import ch.cyberduck.core.Local;
import ch.cyberduck.core.NullSession;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.PathAttributes;
Expand Down Expand Up @@ -41,7 +40,7 @@ public <T> T _getFeature(final Class<T> type) {
if(type == Metadata.class) {
return (T) new Metadata() {
@Override
public Map<String, String> getDefault(final Local local) {
public Map<String, String> getDefault() {
return Collections.emptyMap();
}

Expand Down Expand Up @@ -86,7 +85,7 @@ public <T> T _getFeature(final Class<T> type) {
if(type == Metadata.class) {
return (T) new Metadata() {
@Override
public Map<String, String> getDefault(final Local local) {
public Map<String, String> getDefault() {
return Collections.emptyMap();
}

Expand Down Expand Up @@ -133,7 +132,7 @@ public <T> T _getFeature(final Class<T> type) {
if(type == Metadata.class) {
return (T) new Metadata() {
@Override
public Map<String, String> getDefault(final Local local) {
public Map<String, String> getDefault() {
return Collections.emptyMap();
}

Expand Down Expand Up @@ -184,7 +183,7 @@ public <T> T _getFeature(final Class<T> type) {
if(type == Metadata.class) {
return (T) new Metadata() {
@Override
public Map<String, String> getDefault(final Local local) {
public Map<String, String> getDefault() {
return Collections.emptyMap();
}

Expand Down Expand Up @@ -251,7 +250,7 @@ public <T> T _getFeature(final Class<T> type) {
if(type == Metadata.class) {
return (T) new Metadata() {
@Override
public Map<String, String> getDefault(final Local local) {
public Map<String, String> getDefault() {
return Collections.emptyMap();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* GNU General Public License for more details.
*/

import ch.cyberduck.core.Local;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.Session;
import ch.cyberduck.core.exception.BackgroundException;
Expand All @@ -38,8 +37,8 @@ public CryptoHeadersFeature(final Session<?> session, final Headers delegate, fi
}

@Override
public Map<String, String> getDefault(final Local local) {
return delegate.getDefault(local);
public Map<String, String> getDefault() {
return delegate.getDefault();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* GNU General Public License for more details.
*/

import ch.cyberduck.core.Local;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.exception.BackgroundException;
import ch.cyberduck.core.features.Metadata;
Expand All @@ -39,7 +38,7 @@ public DriveMetadataFeature(final DriveSession session, final DriveFileIdProvide
}

@Override
public Map<String, String> getDefault(final Local local) {
public Map<String, String> getDefault() {
return Collections.emptyMap();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* GNU General Public License for more details.
*/

import ch.cyberduck.core.Local;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.PathContainerService;
import ch.cyberduck.core.exception.BackgroundException;
Expand Down Expand Up @@ -46,7 +45,7 @@ public GoogleStorageMetadataFeature(final GoogleStorageSession session) {
}

@Override
public Map<String, String> getDefault(final Local local) {
public Map<String, String> getDefault() {
return new HostPreferences(session.getHost()).getMap("googlestorage.metadata.default");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import ch.cyberduck.core.DefaultIOExceptionMappingService;
import ch.cyberduck.core.DefaultPathContainerService;
import ch.cyberduck.core.Local;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.PathContainerService;
import ch.cyberduck.core.exception.BackgroundException;
Expand Down Expand Up @@ -55,7 +54,7 @@ public SwiftMetadataFeature(final SwiftSession session, final SwiftRegionService
}

@Override
public Map<String, String> getDefault(final Local local) {
public Map<String, String> getDefault() {
return new HostPreferences(session.getHost()).getMap("openstack.metadata.default");
}

Expand Down
3 changes: 1 addition & 2 deletions s3/src/main/java/ch/cyberduck/core/s3/S3MetadataFeature.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/

import ch.cyberduck.core.Acl;
import ch.cyberduck.core.Local;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.PathAttributes;
import ch.cyberduck.core.PathContainerService;
Expand Down Expand Up @@ -57,7 +56,7 @@ public S3MetadataFeature(final S3Session session, final S3AccessControlListFeatu
}

@Override
public Map<String, String> getDefault(final Local local) {
public Map<String, String> getDefault() {
return new HostPreferences(session.getHost()).getMap("s3.metadata.default");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* Bug fixes, suggestions and comments should be sent to [email protected]
*/

import ch.cyberduck.core.Local;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.exception.BackgroundException;
import ch.cyberduck.core.exception.InteroperabilityException;
Expand All @@ -33,7 +32,6 @@
import org.apache.logging.log4j.Logger;
import org.w3c.dom.Element;

import javax.xml.namespace.QName;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
Expand All @@ -44,9 +42,6 @@
import com.github.sardine.impl.SardineException;
import com.github.sardine.util.SardineUtil;

import static com.github.sardine.util.SardineUtil.CUSTOM_NAMESPACE_PREFIX;
import static com.github.sardine.util.SardineUtil.CUSTOM_NAMESPACE_URI;

public class DAVMetadataFeature implements Headers {
private static final Logger log = LogManager.getLogger(DAVMetadataFeature.class);

Expand All @@ -57,7 +52,7 @@ public DAVMetadataFeature(final DAVSession session) {
}

@Override
public Map<String, String> getDefault(final Local local) {
public Map<String, String> getDefault() {
return new HostPreferences(session.getHost()).getMap("webdav.metadata.default");
}

Expand Down

0 comments on commit bab1684

Please sign in to comment.