-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tus#67 persistent url store #68
base: main
Are you sure you want to change the base?
Tus#67 persistent url store #68
Conversation
|
||
|
||
unmarshall(); | ||
marshall(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why this marshal/unmarshall step is necessary here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this property static? Does this mean that the user can only effectively use one TusURLPersistentStore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is here no marshall()
compared to the other constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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);
....