Class TusURLMemoryStore

  • All Implemented Interfaces:
    TusURLStore

    public class TusURLMemoryStore
    extends java.lang.Object
    implements TusURLStore
    This class is used to map an upload's fingerprint with the corresponding upload URL by storing the entries in a HashMap. This functionality is used to allow resuming uploads. The fingerprint is usually retrieved using 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.URL get​(java.lang.String fingerprint)
      Retrieve an upload's URL for a fingerprint.
      void remove​(java.lang.String fingerprint)
      Remove an entry from the store.
      void set​(java.lang.String fingerprint, java.net.URL url)
      Store a new fingerprint and its upload URL.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TusURLMemoryStore

        public TusURLMemoryStore()
    • Method Detail

      • set

        public void set​(java.lang.String fingerprint,
                        java.net.URL url)
        Description copied from interface: TusURLStore
        Store a new fingerprint and its upload URL.
        Specified by:
        set in interface TusURLStore
        Parameters:
        fingerprint - An upload's fingerprint.
        url - The corresponding upload URL.
      • get

        public java.net.URL get​(java.lang.String fingerprint)
        Description copied from interface: TusURLStore
        Retrieve an upload's URL for a fingerprint. If no matching entry is found this method will return null.
        Specified by:
        get in interface TusURLStore
        Parameters:
        fingerprint - An upload's fingerprint.
        Returns:
        The corresponding upload URL.
      • remove

        public void remove​(java.lang.String fingerprint)
        Description copied from interface: TusURLStore
        Remove an entry from the store. Calling TusURLStore.get(String) with the same fingerprint will return null. If no entry exists for this fingerprint no exception should be thrown.
        Specified by:
        remove in interface TusURLStore
        Parameters:
        fingerprint - An upload's fingerprint.