Update local folder creation timestamp with timestamp from OneDrive (#1934)

* When a new folder is created locally, use the lastModifiedDateTime as provided by OneDrive for the folders timestamp instead of the time when the client created the directory

Note: This only will impact new folder that are created, will not touch or modify existing folders
This commit is contained in:
abraunegg 2022-04-26 08:23:18 +10:00 committed by GitHub
parent f08039f511
commit 37bce6f82d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2667,6 +2667,12 @@ final class SyncEngine
// Configure the applicable permissions for the folder
log.vdebug("Setting directory permissions for: ", path);
path.setAttributes(cfg.returnRequiredDirectoryPermisions());
// Update the time of the folder to match the last modified time as is provided by OneDrive
// If there are any files then downloaded into this folder, the last modified time will get
// updated by the local Operating System with the latest timestamp - as this is normal operation
// as the directory has been modified
log.vdebug("Setting directory lastModifiedDateTime for: ", path , " to ", item.mtime);
setTimes(path, item.mtime, item.mtime);
}
} catch (FileException e) {
// display the error message