Class BinaryQueryParameter
java.lang.Object
ch.tocco.nice2.persist.core.api.entity.Binary
ch.tocco.nice2.persist.core.impl.hibernate.legacy.BinaryQueryParameter
- All Implemented Interfaces:
AutoCloseable
This is a dummy implementation of
Binary which enables querying binary fields
by hash.-
Nested Class Summary
Nested classes/interfaces inherited from class ch.tocco.nice2.persist.core.api.entity.Binary
Binary.BinaryUrl, Binary.Store -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Release any resources associated with this binary.@Nullable StringReturns the file extension when available.@Nullable Binary.BinaryUrlbooleanOpen an input stream to read the data.longsize()Return the size of this binary in bytes.toString()
-
Constructor Details
-
BinaryQueryParameter
-
-
Method Details
-
openStream
Description copied from class:BinaryOpen an input stream to read the data.- Overrides:
openStreamin classBinary- Throws:
IOException
-
size
public long size()Description copied from class:BinaryReturn the size of this binary in bytes. -
getMimeType
- Overrides:
getMimeTypein classBinary
-
getFileExtension
Description copied from class:BinaryReturns the file extension when available. The file extension can be more specific than the mime-type.- Overrides:
getFileExtensionin classBinary
-
close
public void close()Description copied from class:BinaryRelease any resources associated with this binary.- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classBinary
-
toString
-
getBase64DataUri
- Overrides:
getBase64DataUriin classBinary- Returns:
- a
Stringcontaining thebase64encoded binary as it might be used assrcanimgtag. - Throws:
IOException
-
getUrl
-
mayBeStored
public boolean mayBeStored()- Overrides:
mayBeStoredin classBinary- Returns:
- if false, this binary can only be used as query parameter and does not contain any data
-