Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d57f45f authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

Merge branch '7341-fix-file-move' into 'main'

fix file move issue due to error in syncedFolder localPath

See merge request !250
parents 85a6ac3a 329bafbe
Loading
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -61,7 +61,6 @@ public class DownloadFileOperation extends RemoteOperation {
     * @param syncedFileState SyncedFileState corresponding to remote file
     */
    public DownloadFileOperation(@NonNull RemoteFile remoteFile, @NonNull SyncedFileState syncedFileState, @NonNull Context context) {
        Timber.tag(DownloadFileOperation.class.getSimpleName());
        this.remoteFile = remoteFile;
        this.syncedFileState = syncedFileState;
        this.previousEtag = syncedFileState.getLastEtag();
@@ -178,7 +177,10 @@ public class DownloadFileOperation extends RemoteOperation {
        try {
            if (!targetDir.exists()) targetDir.mkdirs();

            final Path copyResult = Files.copy(tmpFile.toPath(), targetFile.toPath(), REPLACE_EXISTING);
            final Path targetPath = targetFile.toPath();
            final Path tmpPath = tmpFile.toPath();

            final Path copyResult = Files.copy(tmpPath, targetPath, REPLACE_EXISTING);
            if (copyResult.toFile().length() == tmpFile.length()) {
                tmpFile.delete();
                return true;
+2 −2
Original line number Diff line number Diff line
@@ -106,15 +106,15 @@ public class CreateRemoteFolderWorker extends Worker {
        final Data data = getInputData();
        final String category = data.getString(DATA_KEY_LIBELLE);
        final String remotePath = data.getString(DATA_KEY_REMOTE_PATH);
        final String localPath = data.getString(DATA_KEY_REMOTE_PATH);
        final String localPath = data.getString(DATA_KEY_LOCAL_PATH);

        if( category == null || remotePath == null || localPath == null) {
            return null;
        }
        final SyncedFolder result = new SyncedFolder(
                category,
                remotePath,
                localPath,
                remotePath,
                data.getBoolean(DATA_KEY_SCAN_LOCAL, true),
                data.getBoolean(DATA_KEY_SCAN_REMOTE, true),
                data.getBoolean(DATA_KEY_ENABLE, true),