This repository has been archived by the owner on Apr 17, 2020. It is now read-only.
forked from davide-imbriaco/a-sync-browser
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Make response handling more modular * Remove shared state of the BlockPuller tasks * Implement dispatching errors at the file downloading * Remove unneeded locking * Count sums as long * Fix error caused by using notify without syncrhonized * Add TODOs * BlockPuller: Add timeout and concurrency limit * Cache file blocks on disk during downloading * Read downloaded files block by block * Add function to delete temp data in bulk * Implement deleting temp data at download failure * Fix error in progress reporting * Fix canceling * Fix handling timeouts at block requests * Add file caching The files were already cached (saved locally), but it was not tried to use them. This names files by their hash to ensure that no old file version is used. The side effect of this is that equal files are only downloaded and saved once. This closes #43 What's missing: - delete local files which are no longer provided by the server - delete local files which were not used for a long time - delete all local files when the menu item to clear the cache is used * Fix file caching failure when using the SyncthingProvider * Run auto reformat * Use status object for the block puller download progress * Improve file downloading by the SyncthingProvider * Fix NullPointerException when getting totalFileSize * Add additional check to cancel on race condition * Check integrity at IndexHandler.getFileInfoAndBlockByPath() * Use FileInfo.checkBlocks() for the integrity check
- Loading branch information
Showing
7 changed files
with
48 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
app/src/main/kotlin/net/syncthing/lite/library/DownloadFilePath.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package net.syncthing.lite.library | ||
|
||
import java.io.File | ||
|
||
data class DownloadFilePath (val baseDirectory: File, val fileHash: String) { | ||
val filesDirectory = File(baseDirectory, fileHash.substring(0, 2)) | ||
val targetFile = File(filesDirectory, fileHash.substring(2)) | ||
val tempFile = File(filesDirectory, fileHash.substring(2) + "_temp") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters