Conversation
|
|
||
|
|
||
| unmarshall(); | ||
| marshall(); |
There was a problem hiding this comment.
Could you explain why this marshal/unmarshall step is necessary here?
There was a problem hiding this comment.
I think I wrote it because unmarshall()/marshall() takes care of initialization too. It's probably a shortcutty way to do it.
|
|
||
| public class TusURLPersistentStore implements TusURLStore { | ||
|
|
||
| private static volatile TusUploadFileSet filesWithFingerprints; |
There was a problem hiding this comment.
Why is this property static? Does this mean that the user can only effectively use one TusURLPersistentStore?
There was a problem hiding this comment.
Honestly I don't remember why is it static. However I didn't recognize any use case for more than one TusUploadFileSet.
| public TusURLPersistentStore(String pathOfPersistentXmlFiles) { | ||
| super(); | ||
| this.pathOfPersistentXmlFiles = pathOfPersistentXmlFiles; | ||
| unmarshall(); |
There was a problem hiding this comment.
Why is here no marshall() compared to the other constructor?
There was a problem hiding this comment.
I assumed a custom path for a store is already initialized. Therefore no marshall(). Non existing file on custom path will generate RuntimeException.
| return null; | ||
| } | ||
|
|
||
| public TusUploadFile getTusUploadFile(String fingerprint) { |
There was a problem hiding this comment.
I see that you are implementing additional methods for storing and retrieving additional information about the uploads, such as the filename. We can implement such a more capable URL store for tus-js-client as well. I think we should do the same for tus-java-client in its next major release: #78
This is the pull request for issue #67. There is a TusURLPersistentStore which can continue uploads after restarting the computer. After successful upload finished, the URL will get deleted. Tested on Windows, and worked.
Usage:
TusURLPersistentStore persistentStore = new TusURLPersistentStore();
client.enableResuming(persistentStore);
....