Skip to content

Commit

Permalink
ChunkedFileRemoteOperation: correctly use lastModificationTimestamp
Browse files Browse the repository at this point in the history
Otherwise the age of the copied file is used instead, which may not be desired.

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
  • Loading branch information
AlvaroBrey committed Nov 8, 2022
1 parent 12982fe commit 9cc80e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ protected RemoteOperationResult run(OwnCloudClient client) {
String originUri = uploadFolderUri + "/.file";

moveMethod = new MoveMethod(originUri, destinationUri, true);
moveMethod.addRequestHeader(OC_X_OC_MTIME_HEADER, String.valueOf(file.lastModified() / 1000));
moveMethod.addRequestHeader(OC_X_OC_MTIME_HEADER, lastModificationTimestamp);

if (creationTimestamp != null && creationTimestamp > 0) {
moveMethod.addRequestHeader(OC_X_OC_CTIME_HEADER, String.valueOf(creationTimestamp));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class UploadFileRemoteOperation extends RemoteOperation<String> {
protected String localPath;
protected String remotePath;
protected String mimeType;
private String lastModificationTimestamp;
protected String lastModificationTimestamp;
protected Long creationTimestamp = null;
protected boolean disableRetries = false;
PutMethod putMethod = null;
Expand Down

0 comments on commit 9cc80e1

Please sign in to comment.