io.tus.java.client.TusURLMemoryStore Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tus-java-client Show documentation
Show all versions of tus-java-client Show documentation
Java client for tus, the resumable file uploading protocol.
package io.tus.java.client;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
/**
* This class is used to map an upload's fingerprint with the corresponding upload URL by storing
* the entries in a {@link HashMap}. This functionality is used to allow resuming uploads. The
* fingerprint is usually retrieved using {@link TusUpload#getFingerprint()}.
*
* The values will only be stored as long as the application is running. This store will not
* keep the values after your application crashes or restarts.
*/
public class TusURLMemoryStore implements TusURLStore {
private Map store = new HashMap();
@Override
public void set(String fingerprint, URL url) {
store.put(fingerprint, url);
}
@Override
public URL get(String fingerprint) {
return store.get(fingerprint);
}
@Override
public void remove(String fingerprint) {
store.remove(fingerprint);
}
}