Class AesStreamHandler


  • public class AesStreamHandler
    extends java.net.URLStreamHandler
    Provides a local stream URL handler to read an AesFile as a source. This works with 3rd party libraries and apps that can read file via HTTP URLs.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static AesStreamHandler getInstance()
      Get the instance.
      protected java.net.URLConnection openConnection​(java.net.URL u)
      Open a local connection to an encrypted stream.
      java.lang.String register​(java.lang.String key, AesFile file)
      Register a unique key associated to an encrypted AesFile.
      void unregister​(java.lang.String path)
      Unregister a path.
      • Methods inherited from class java.net.URLStreamHandler

        equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, openConnection, parseURL, sameFile, setURL, setURL, toExternalForm
      • Methods inherited from class java.lang.Object

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

      • getInstance

        public static AesStreamHandler getInstance()
        Get the instance.
        Returns:
        A URL stream handler for encrypted streams.
      • register

        public java.lang.String register​(java.lang.String key,
                                         AesFile file)
        Register a unique key associated to an encrypted AesFile. This will return a URL path that you can use to pass to 3rd party libraries that support URLConnection.
        Parameters:
        key - A unique key.
        file - The file associated.
        Returns:
        The URL path to use.
      • unregister

        public void unregister​(java.lang.String path)
        Unregister a path.
        Parameters:
        path - The URL path
      • openConnection

        protected java.net.URLConnection openConnection​(java.net.URL u)
        Open a local connection to an encrypted stream.
        Specified by:
        openConnection in class java.net.URLStreamHandler
        Parameters:
        u - the URL that this connects to.
        Returns:
        URLConnection to inject the decoded stream