Package com.exedio.cope.vault
Class VaultFileService
- java.lang.Object
-
- com.exedio.cope.vault.VaultFileService
-
- All Implemented Interfaces:
VaultService
,AutoCloseable
public final class VaultFileService extends Object implements VaultService
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
get(String hash)
void
get(String hash, OutputStream sink)
long
getLength(String hash)
boolean
put(String hash, byte[] value, VaultPutInfo info)
Is not called, if service instance was created withVaultServiceParameters.isWritable()
==false.boolean
put(String hash, InputStream value, VaultPutInfo info)
Is not called, if service instance was created withVaultServiceParameters.isWritable()
==false.boolean
put(String hash, Path value, VaultPutInfo info)
The caller must make sure, thatvalue
is not modified during the call.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.exedio.cope.vault.VaultService
close, purgeSchema
-
-
-
-
Method Detail
-
getLength
public long getLength(String hash) throws VaultNotFoundException
- Specified by:
getLength
in interfaceVaultService
- Throws:
VaultNotFoundException
-
get
public byte[] get(String hash) throws VaultNotFoundException
- Specified by:
get
in interfaceVaultService
- Throws:
VaultNotFoundException
-
get
public void get(String hash, OutputStream sink) throws VaultNotFoundException, IOException
Description copied from interface:VaultService
Must notclose
orflush
sink
.If this method throws a
VaultNotFoundException
, it MUST not have modifiedsink
in any way. In particular it must not have written any byte tosink
.- Specified by:
get
in interfaceVaultService
- Throws:
VaultNotFoundException
IOException
-
put
public boolean put(String hash, byte[] value, VaultPutInfo info)
Description copied from interface:VaultService
Is not called, if service instance was created withVaultServiceParameters.isWritable()
==false.- Specified by:
put
in interfaceVaultService
- Returns:
true
ifhash
has been initially stored in the vault by this call. The result is used for statistics only. If the implementation does not have this information available, simply returntrue
.
-
put
public boolean put(String hash, InputStream value, VaultPutInfo info) throws IOException
Description copied from interface:VaultService
Is not called, if service instance was created withVaultServiceParameters.isWritable()
==false.- Specified by:
put
in interfaceVaultService
- Returns:
true
ifhash
has been initially stored in the vault by this call. The result is used for statistics only. If the implementation does not have this information available, simply returntrue
.- Throws:
IOException
-
put
public boolean put(String hash, Path value, VaultPutInfo info) throws IOException
Description copied from interface:VaultService
The caller must make sure, thatvalue
is not modified during the call. Is not called, if service instance was created withVaultServiceParameters.isWritable()
==false.- Specified by:
put
in interfaceVaultService
- Returns:
true
ifhash
has been initially stored in the vault by this call. The result is used for statistics only. If the implementation does not have this information available, simply returntrue
.- Throws:
IOException
-
-