Class HashedUrlManifest

java.lang.Object
com.soklet.web.HashedUrlManifest

public class HashedUrlManifest extends Object
Since:
1.0.0
Author:
Mark Allen
  • Constructor Details

    • HashedUrlManifest

      public HashedUrlManifest()
    • HashedUrlManifest

      public HashedUrlManifest(Map<String,String> hashedUrlsByUrl)
    • HashedUrlManifest

      public HashedUrlManifest(InputStream inputStream)
    • HashedUrlManifest

      public HashedUrlManifest(Path hashedUrlManifestFile)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • defaultManifestFile

      public static Path defaultManifestFile()
    • hashedUrlWithFallback

      public String hashedUrlWithFallback(String url)
    • hashedUrl

      public Optional<String> hashedUrl(String url)
    • writeToOutputStream

      public void writeToOutputStream(OutputStream outputStream, HashedUrlManifest.PersistenceFormat persistenceFormat) throws IOException
      Serializes this manifest to the given outputStream. The inverse of this operation is HashedUrlManifest(InputStream).

      Caller is responsible for flushing and closing the outputStream after this method has completed.

      Note that the serialization format is not formally specified and is subject to change in the future.

      Parameters:
      outputStream - the stream to write to
      persistenceFormat - how the manifest should be written to the outputStream
      Throws:
      IOException - if an error occurs while writing to outputStream
    • hashedUrlsByUrl

      public Map<String,String> hashedUrlsByUrl()