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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Release any resources associated with this binary.@Nullable String
Returns the file extension when available.@Nullable Binary.BinaryUrl
boolean
Open an input stream to read the data.long
size()
Return the size of this binary in bytes.toString()
-
Constructor Details
-
BinaryQueryParameter
-
-
Method Details
-
openStream
Description copied from class:Binary
Open an input stream to read the data.- Overrides:
openStream
in classBinary
- Throws:
IOException
-
size
public long size()Description copied from class:Binary
Return the size of this binary in bytes. -
getMimeType
- Overrides:
getMimeType
in classBinary
-
getFileExtension
Description copied from class:Binary
Returns the file extension when available. The file extension can be more specific than the mime-type.- Overrides:
getFileExtension
in classBinary
-
close
public void close()Description copied from class:Binary
Release any resources associated with this binary.- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classBinary
-
toString
-
getBase64DataUri
- Overrides:
getBase64DataUri
in classBinary
- Returns:
- a
String
containing thebase64
encoded binary as it might be used assrc
animg
tag. - Throws:
IOException
-
getUrl
-
mayBeStored
public boolean mayBeStored()- Overrides:
mayBeStored
in classBinary
- Returns:
- if false, this binary can only be used as query parameter and does not contain any data
-