All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.tus.java.client.TusURLStore Maven / Gradle / Ivy

There is a newer version: 0.5.0
Show newest version
package io.tus.java.client;

import java.net.URL;

/**
 * Implementations of this interface are used to map an upload's fingerprint with the corresponding
 * upload URL. This functionality is used to allow resuming uploads. The fingerprint is usually
 * retrieved using {@link TusUpload#getFingerprint()}.
 */
public interface TusURLStore {
    /**
     * Store a new fingerprint and its upload URL.
     *
     * @param fingerprint An upload's fingerprint.
     * @param url The corresponding upload URL.
     */
    void set(String fingerprint, URL url);

    /**
     * Retrieve an upload's URL for a fingerprint. If no matching entry is found this method will
     * return null.
     *
     * @param fingerprint An upload's fingerprint.
     * @return The corresponding upload URL.
     */
    URL get(String fingerprint);

    /**
     * Remove an entry from the store. Calling {@link #get(String)} with the same fingerprint will
     * return null. If no entry exists for this fingerprint no exception should be
     * thrown.
     *
     * @param fingerprint An upload's fingerprint.
     */
    void remove(String fingerprint);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy