Package com.mku.salmonfs.handler
Class AesStreamHandler
java.lang.Object
java.net.URLStreamHandler
com.mku.salmonfs.handler.AesStreamHandler
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
Modifier and TypeMethodDescriptionstatic AesStreamHandlerGet the instance.protected URLConnectionOpen a local connection to an encrypted stream.Register a unique key associated to an encrypted AesFile.voidsetProperties(int buffers, int bufferSize, int threads, int backOffset) Set this stream handler with optional properties, use zero to keep the defaultvoidunregister(String path) Unregister a path.Methods inherited from class java.net.URLStreamHandler
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, openConnection, parseURL, sameFile, setURL, setURL, toExternalForm
-
Method Details
-
setProperties
public void setProperties(int buffers, int bufferSize, int threads, int backOffset) Set this stream handler with optional properties, use zero to keep the default- Parameters:
buffers- Number of buffers to use.bufferSize- The length of each buffer.threads- The number of threads/streams to source the file in parallel.backOffset- The back offset.
-
getInstance
Get the instance.- Returns:
- A URL stream handler for encrypted streams.
-
register
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
Unregister a path.- Parameters:
path- The URL path
-
openConnection
Open a local connection to an encrypted stream.- Specified by:
openConnectionin classURLStreamHandler- Parameters:
u- the URL that this connects to.- Returns:
- URLConnection to inject the decoded stream
-