Package com.tridion.data
Class BinaryDataFile
java.lang.Object
com.tridion.data.BinaryDataFile
- All Implemented Interfaces:
BinaryData
Binary data object that is stored in a
File.-
Constructor Summary
ConstructorsConstructorDescriptionBinaryDataFile(int namespaceId, int publicationId, int binaryId, File binaryFile) Creates a new instance of this object.BinaryDataFile(int namespaceId, int publicationId, int binaryId, File binaryFile, String variantId) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getBytes()Gets the binary data as an array of bytes.longGets the size of underlying binary data.intgetId()Gets the id of this binary data.Gets anInputStreamrepresenting the binary data.intGets the namespace id.intGets the publication id of this binary data.Returns the id of the variant for this binary data.toString()Returns a string representation of this binary data file.
-
Constructor Details
-
BinaryDataFile
Creates a new instance of this object.- Parameters:
namespaceId- The namespace id.publicationId- The publication id.binaryId- The binary id.binaryFile- TheFilecontaining the binary data.
-
BinaryDataFile
-
-
Method Details
-
getId
public int getId()Gets the id of this binary data.- Specified by:
getIdin interfaceBinaryData- Returns:
- The binary data id.
-
getNamespaceId
public int getNamespaceId()Description copied from interface:BinaryDataGets the namespace id.- Specified by:
getNamespaceIdin interfaceBinaryData- Returns:
- namespace id
-
getPublicationId
public int getPublicationId()Gets the publication id of this binary data.- Specified by:
getPublicationIdin interfaceBinaryData- Returns:
- The publication id.
-
getVariantId
Returns the id of the variant for this binary data.- Specified by:
getVariantIdin interfaceBinaryData
-
getInputStream
Gets anInputStreamrepresenting the binary data.- Specified by:
getInputStreamin interfaceBinaryData- Returns:
- The binary data as an
InputStream. - Throws:
IOException- If an error occurs accessing the binary data.
-
getBytes
Gets the binary data as an array of bytes.- Specified by:
getBytesin interfaceBinaryData- Returns:
- byte[] representation of the binary data.
- Throws:
IOException- If an error occurs accessing the binary data.
-
toString
Returns a string representation of this binary data file. The absolute file path representing the binary data is displayed instead of the binary data itself. -
getDataSize
public long getDataSize()Gets the size of underlying binary data.- Specified by:
getDataSizein interfaceBinaryData- Returns:
- The binary data size.
-