Skip to content

Commit

Permalink
Skip reading configuration when not using custom versioning.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Mar 7, 2024
1 parent 121a7b5 commit 94f6f40
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
16 changes: 10 additions & 6 deletions core/src/main/java/ch/cyberduck/core/transfer/UploadTransfer.java
Original file line number Diff line number Diff line change
Expand Up @@ -313,13 +313,17 @@ public void post(final Session<?> source, final Session<?> destination, final Ma
}
}
if(options.versioning) {
final Versioning versioning = source.getFeature(Versioning.class);
if(versioning != null) {
for(TransferItem item : files.keySet()) {
if(versioning.getConfiguration(item.remote).isEnabled()) {
versioning.cleanup(item.remote, callback);
// Cleanup of previous files
switch(source.getHost().getProtocol().getVersioningMode()) {
case custom:
final Versioning versioning = source.getFeature(Versioning.class);
if(versioning != null) {
for(TransferItem item : files.keySet()) {
if(versioning.getConfiguration(item.remote).isEnabled()) {
versioning.cleanup(item.remote, callback);
}
}
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,17 @@ public void apply(final Path file, final Local local, final TransferStatus statu
if(file.isFile()) {
if(status.isExists() && !status.isAppend()) {
if(options.versioning) {
final Versioning feature = session.getFeature(Versioning.class);
if(feature != null && feature.getConfiguration(file).isEnabled()) {
if(feature.save(file)) {
if(log.isDebugEnabled()) {
log.debug(String.format("Clear exist flag for file %s", file));
switch(session.getHost().getProtocol().getVersioningMode()) {
case custom:
final Versioning feature = session.getFeature(Versioning.class);
if(feature != null && feature.getConfiguration(file).isEnabled()) {
if(feature.save(file)) {
if(log.isDebugEnabled()) {
log.debug(String.format("Clear exist flag for file %s", file));
}
status.exists(false).getDisplayname().exists(false);
}
}
status.exists(false).getDisplayname().exists(false);
}
}
}
}
Expand Down

0 comments on commit 94f6f40

Please sign in to comment.