Class Content
- java.lang.Object
-
- coza.opencollab.epub.creator.model.Content
-
public class Content extends Object
Representation of content in the book- Author:
- OpenCollab
-
-
Constructor Summary
Constructors Constructor Description Content(String href, byte[] content)
Creates new instance of ContentContent(String href, InputStream content)
Creates new instance of ContentContent(String mediaType, String href, byte[] content)
Creates new instance of ContentContent(String mediaType, String href, InputStream content)
Creates new instance of ContentContent(String href, String id, String properties, byte[] content)
Creates a new instance of ContentContent(String href, String id, String properties, InputStream content)
Creates a new instance of ContentContent(String mediaType, String href, String id, String properties, byte[] content)
Creates a new instance of ContentContent(String mediaType, String href, String id, String properties, InputStream content)
Creates a new instance of Content
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getContent()
Content
getFallBack()
String
getHref()
String
getId()
String
getMediaType()
String
getProperties()
boolean
hasFallBack()
Indicates whether a fallback content has been setboolean
isLinear()
boolean
isSpine()
boolean
isToc()
void
setContent(byte[] content)
void
setFallBack(Content fallBack)
The spine parameter will be set to false as we do not want to add the fallback content to the spine.void
setHref(String href)
void
setId(String id)
void
setLinear(boolean linear)
void
setMediaType(String mediaType)
void
setProperties(String properties)
void
setSpine(boolean spine)
void
setToc(boolean toc)
-
-
-
Constructor Detail
-
Content
public Content(String mediaType, String href, byte[] content)
Creates new instance of Content- Parameters:
mediaType
- the mime typehref
- the link to the content itemcontent
- the file byte array
-
Content
public Content(String href, byte[] content)
Creates new instance of Content- Parameters:
href
- the link to the content itemcontent
- the file byte array
-
Content
public Content(String mediaType, String href, String id, String properties, byte[] content)
Creates a new instance of Content- Parameters:
mediaType
- the mime typehref
- the link to the content itemid
- used as the id attribute value in the OPF manifest items and the id ref in the spineproperties
- the properties attribute value in the OPFcontent
- the file byte array
-
Content
public Content(String href, String id, String properties, byte[] content)
Creates a new instance of Content- Parameters:
href
- the link to the content itemid
- used as the id attribute value in the OPF manifest items and the id ref in the spineproperties
- the properties attribute value in the OPFcontent
- the file byte array
-
Content
public Content(String mediaType, String href, InputStream content) throws IOException
Creates new instance of Content- Parameters:
mediaType
- the mime typehref
- the link to the content itemcontent
- the file byte array- Throws:
IOException
- if content could not be converted to byte array
-
Content
public Content(String href, InputStream content) throws IOException
Creates new instance of Content- Parameters:
href
- the link to the content itemcontent
- the file byte array- Throws:
IOException
- if content could not be converted to byte array
-
Content
public Content(String mediaType, String href, String id, String properties, InputStream content) throws IOException
Creates a new instance of Content- Parameters:
mediaType
- the mime typehref
- the link to the content itemid
- used as the id attribute value in the OPF manifest items and the id ref in the spineproperties
- the properties attribute value in the OPFcontent
- the file byte array- Throws:
IOException
- if content could not be converted to byte array
-
Content
public Content(String href, String id, String properties, InputStream content) throws IOException
Creates a new instance of Content- Parameters:
href
- the link to the content itemid
- used as the id attribute value in the OPF manifest items and the id ref in the spineproperties
- the properties attribute value in the OPFcontent
- the file byte array- Throws:
IOException
- if content could not be converted to byte array
-
-
Method Detail
-
hasFallBack
public boolean hasFallBack()
Indicates whether a fallback content has been set- Returns:
- the fallback flag
-
getMediaType
public String getMediaType()
- Returns:
- the mediaType
-
setMediaType
public void setMediaType(String mediaType)
- Parameters:
mediaType
- the mediaType to set
-
getHref
public String getHref()
- Returns:
- the HREF
-
setHref
public void setHref(String href)
- Parameters:
href
- the HREF to set
-
getId
public String getId()
- Returns:
- the id
-
setId
public void setId(String id)
- Parameters:
id
- the id to set
-
getProperties
public String getProperties()
- Returns:
- the properties
-
setProperties
public void setProperties(String properties)
- Parameters:
properties
- the properties to set
-
getContent
public byte[] getContent()
- Returns:
- the content
-
setContent
public void setContent(byte[] content)
- Parameters:
content
- the content to set
-
isLinear
public boolean isLinear()
- Returns:
- the linear
-
setLinear
public void setLinear(boolean linear)
- Parameters:
linear
- the linear to set
-
isSpine
public boolean isSpine()
- Returns:
- the spine
-
setSpine
public void setSpine(boolean spine)
- Parameters:
spine
- the spine to set
-
isToc
public boolean isToc()
- Returns:
- the TOC
-
setToc
public void setToc(boolean toc)
- Parameters:
toc
- the TOC to set
-
getFallBack
public Content getFallBack()
- Returns:
- the fallBack
-
setFallBack
public void setFallBack(Content fallBack)
The spine parameter will be set to false as we do not want to add the fallback content to the spine. To override default behavior call getFallBack to set spine property.- Parameters:
fallBack
- the fallBack to set
-
-