public class TemporaryStore extends Object implements Store<InputStream>
Constructor and Description |
---|
TemporaryStore(File folder,
boolean flushStoreage) |
Modifier and Type | Method and Description |
---|---|
URI |
getLocation(Handle handle)
Fixed location for a resource that has been stored before.
|
String |
hash(InputStream is,
OutputStream storeHere) |
InputStream |
load(Handle handle)
Load a T after (successfully) stored it before.
|
Handle |
store(InputStream inp)
Read incoming object of type T (for example an InputSteam)
|
public TemporaryStore(File folder, boolean flushStoreage)
public Handle store(InputStream inp) throws IOException
Store
store
in interface Store<InputStream>
inp
- object to be stored. Implementations are usually bound to a certain TIOException
- in case incoming object cannot be read (if it involves IO)public InputStream load(Handle handle) throws IOException
Store
load
in interface Store<InputStream>
handle
- identifier that has been returned from a previous srore call.IOException
- if loading resource involves IO, things can always go wrong.public URI getLocation(Handle handle) throws IOException
Store
getLocation
in interface Store<InputStream>
handle
- must refer to a previously stored object.IOException
- if IO is involved, things may go mad.public String hash(InputStream is, OutputStream storeHere) throws IOException
IOException
Copyright © 2006–2019 OPS4J - Open Participation Software for Java. All rights reserved.