org.xoe.core.content
Class ContentElementFactory

java.lang.Object
  |
  +--org.xoe.core.content.ContentElementFactory

public class ContentElementFactory
extends Object

The ContentElementFactory class is used to construct content elements for the Content Cache and the Stash.


Method Summary
 ContentElement createContentElement(URL url)
          Returns the content element associated with the content at url.
 ContentElement createContentElement(URL url, byte[] dataArray)
          Returns the content element associated with the content at url.
 ContentElement createContentElement(URL url, byte[] dataArray, Date d)
          Returns the content element associated with the content at url.
 ContentElement createContentElement(URL url, InputStream dataStream)
          Returns the content element associated with the content at url.
 ContentElement createContentElement(URL url, InputStream dataStream, Date d)
          Returns the content element associated with the content at url.
 ContentElement createContentElement(URL url, InputStream dataStream, int len)
          Returns the content element associated with the content at url.
 ContentElement createContentElement(URL url, InputStream dataStream, int len, Date d)
          Returns the content element associated with the content at url.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createContentElement

public ContentElement createContentElement(URL url)
                                    throws IOException
Returns the content element associated with the content at url.
Parameters:
url - the URL associated with the desired content
Returns:
the content element associated with url
Throws:
IOException - if an I/O error occurs

createContentElement

public ContentElement createContentElement(URL url,
                                           InputStream dataStream)
                                    throws IOException
Returns the content element associated with the content at url. Uses dataStream to build the content element's internal byte array of data.

Important: closing dataStream must be handled by the caller.

Parameters:
url - the URL associated with the desired content
dataStream - the InputStream representing the content's binary data
Returns:
the content element associated with url
Throws:
IOException - if an I/O error occurs

createContentElement

public ContentElement createContentElement(URL url,
                                           InputStream dataStream,
                                           int len)
                                    throws IOException
Returns the content element associated with the content at url. Uses dataStream to build the content element's internal byte array of data.

Important: closing dataStream must be handled by the caller.

Parameters:
url - the URL associated with the desired content
dataStream - the InputStream representing the content's data
len - the length, in bytes, of the data
Returns:
the content element associated with url
Throws:
IOException - if an I/O error occurs

createContentElement

public ContentElement createContentElement(URL url,
                                           InputStream dataStream,
                                           Date d)
                                    throws IOException
Returns the content element associated with the content at url. Uses dataStream to build the content element's internal byte array of data.

Important: closing dataStream must be handled by the caller.

Parameters:
url - the URL associated with the desired content
dataStream - the InputStream representing the content's binary data
d - the Date to use as the last modified for this content
Returns:
the content element associated with url
Throws:
IOException - if an I/O error occurs

createContentElement

public ContentElement createContentElement(URL url,
                                           InputStream dataStream,
                                           int len,
                                           Date d)
                                    throws IOException
Returns the content element associated with the content at url. Uses dataStream to build the content element's internal byte array of data.

Important: closing dataStream must be handled by the caller.


Parameters:
url - the URL associated with the desired content
dataStream - the InputStream representing the content's binary data
len - the length, in bytes, of the data
d - the Date to use as the last modified for this content
Returns:
the content element associated with url
Throws:
IOException - if an I/O error occurs

createContentElement

public ContentElement createContentElement(URL url,
                                           byte[] dataArray)
                                    throws IOException
Returns the content element associated with the content at url. Uses dataArray for the content's internal byte array of data.
Parameters:
url - the URL associated with the desired content
dataArray - the content's binary data
Returns:
the content element associated with url
Throws:
IOException - if an I/O error occurs

createContentElement

public ContentElement createContentElement(URL url,
                                           byte[] dataArray,
                                           Date d)
                                    throws IOException
Returns the content element associated with the content at url. Uses dataArray for the content's internal byte array of data.
Parameters:
url - the URL associated with the desired content
dataArray - the content's binary data
d - the Date to use as the last modified for this content
Returns:
the content element associated with url
Throws:
IOException - if an I/O error occurs