
Package ca.uhn.fhir.jpa.binstore
Class FilesystemBinaryStorageSvcImpl
java.lang.Object
ca.uhn.fhir.jpa.binary.svc.BaseBinaryStorageSvcImpl
ca.uhn.fhir.jpa.binstore.FilesystemBinaryStorageSvcImpl
- All Implemented Interfaces:
IBinaryStorageSvc
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
expungeBlob
(org.hl7.fhir.instance.model.api.IIdType theResourceId, String theBlobId) byte[]
Fetch the contents of the given blobfetchBlobDetails
(org.hl7.fhir.instance.model.api.IIdType theResourceId, String theBlobId) void
start()
storeBlob
(org.hl7.fhir.instance.model.api.IIdType theResourceId, String theBlobIdOrNull, String theContentType, InputStream theInputStream) Store a new binary blobboolean
writeBlob
(org.hl7.fhir.instance.model.api.IIdType theResourceId, String theBlobId, OutputStream theOutputStream) Methods inherited from class ca.uhn.fhir.jpa.binary.svc.BaseBinaryStorageSvcImpl
createCountingInputStream, createHashingInputStream, fetchDataBlobFromBinary, getMaximumBinarySize, getMinimumBinarySize, newBlobId, provideIdForNewBlob, setMaximumBinarySize, setMinimumBinarySize, shouldStoreBlob
-
Constructor Details
-
FilesystemBinaryStorageSvcImpl
-
-
Method Details
-
start
-
storeBlob
public StoredDetails storeBlob(org.hl7.fhir.instance.model.api.IIdType theResourceId, String theBlobIdOrNull, String theContentType, InputStream theInputStream) throws IOException Description copied from interface:IBinaryStorageSvc
Store a new binary blob- Parameters:
theResourceId
- The resource ID that owns this blob. Note that it should not be possible to retrieve a blob without both the resource ID and the blob ID being correct.theBlobIdOrNull
- If set, forcestheContentType
- The content type to associate with this blobtheInputStream
- An InputStream to read from. This method should close the stream when it has been fully consumed.- Returns:
- Returns details about the stored data
- Throws:
IOException
-
fetchBlobDetails
public StoredDetails fetchBlobDetails(org.hl7.fhir.instance.model.api.IIdType theResourceId, String theBlobId) throws IOException - Throws:
IOException
-
writeBlob
public boolean writeBlob(org.hl7.fhir.instance.model.api.IIdType theResourceId, String theBlobId, OutputStream theOutputStream) throws IOException - Returns:
- Returns
true
if the blob was found and written, offalse
if the blob was not found (i.e. it was expunged or the ID was invalid) - Throws:
IOException
-
expungeBlob
-
fetchBlob
public byte[] fetchBlob(org.hl7.fhir.instance.model.api.IIdType theResourceId, String theBlobId) throws IOException Description copied from interface:IBinaryStorageSvc
Fetch the contents of the given blob- Parameters:
theResourceId
- The resource IDtheBlobId
- The blob ID- Returns:
- The payload as a byte array
- Throws:
IOException
-