|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.gouv.culture.sdx.utils.SdxObjectImpl
fr.gouv.culture.sdx.document.AbstractDocument
An abstract representation of a document.
Implements all methods from the Document interface.
Field Summary | |
protected IDGenerator |
idGenerator
The id generator for the document |
protected java.lang.String |
idPrefix
Prefix for generated id's |
protected java.lang.String |
idSuffix
Suffix for generated id's |
protected java.lang.String |
mimeType
The mime type of the document. |
protected java.lang.String |
storeRepo
The id of the repository in which the document should be stored |
Fields inherited from class fr.gouv.culture.sdx.utils.SdxObjectImpl |
encoding, logger |
Fields inherited from interface fr.gouv.culture.sdx.document.Document |
DOCTYPE_BINARY, DOCTYPE_GROUP, DOCTYPE_HTML, DOCTYPE_USER, DOCTYPE_XML |
Constructor Summary | |
AbstractDocument()
|
Method Summary | |
java.lang.String |
getId()
Returns the document's id. |
protected org.xml.sax.InputSource |
getInputSource()
Returns a SAX InputSource for this document |
int |
getLength()
Returns the length of the document. |
java.lang.String |
getMimeType()
Returns the mimeType field (A String) for this document |
java.lang.String |
getPreferredFilename()
Returns a preferred filename for this document. |
java.lang.String |
getRepositoryForStorage()
Sets the URL according to the source. |
java.net.URL |
getURL()
Returns a URL for this document, null if no URL can be given. |
java.io.InputStream |
openStream()
Opens a stream for reading the document's content. |
void |
save(Repository r)
Saves the document within a repository. |
void |
setContent(byte[] b)
Sets the content from a memory representation of the raw data. |
void |
setContent(java.io.File f)
Sets the content from a file. |
void |
setContent(java.io.InputStream is)
Sets the content from an InputStream. |
void |
setContent(java.net.URL u)
Sets the content from a URL. |
void |
setId(java.lang.String id)
Sets the document's id. |
void |
setIdGenerator(IDGenerator idGen)
|
void |
setIdGenerator(IDGenerator idGen,
java.lang.String idPrefix,
java.lang.String idSuffix)
|
void |
setMimeType(java.lang.String mimeType)
Sets the mimeType field (A String) for this document |
protected void |
setPreferredFilename()
Sets the preferred filename according to the source. |
void |
setPreferredFilename(java.lang.String filename)
Sets the preferred filename. |
void |
setRepositoryForStorage(java.lang.String repoId)
Sets the id of the repository in which the document should be stored |
void |
setURL(java.net.URL url)
Sets the URL of this document. |
Methods inherited from class fr.gouv.culture.sdx.utils.SdxObjectImpl |
enableLogging, getChildLogger, setEncoding |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface fr.gouv.culture.sdx.document.Document |
getDocType |
Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled |
enableLogging |
Field Detail |
protected java.lang.String storeRepo
protected java.lang.String mimeType
protected IDGenerator idGenerator
protected java.lang.String idPrefix
protected java.lang.String idSuffix
Constructor Detail |
public AbstractDocument()
Method Detail |
public java.lang.String getId()
getId
in interface Document
public void setId(java.lang.String id) throws SDXException
setId
in interface Document
id
- The id to set.
SDXException
public java.io.InputStream openStream() throws SDXException
openStream
in interface Document
SDXException
protected org.xml.sax.InputSource getInputSource() throws SDXException
SDXException
public java.lang.String getMimeType()
getMimeType
in interface Document
public void setMimeType(java.lang.String mimeType)
setMimeType
in interface Document
public void setContent(byte[] b)
setContent
in interface Document
public void setContent(java.io.File f)
setContent
in interface Document
public void setContent(java.net.URL u)
setContent
in interface Document
public void setContent(java.io.InputStream is)
Document
setContent
in interface Document
public void save(Repository r) throws SDXException
save
in interface Document
r
- The repository where to save the document.
SDXException
public int getLength()
getLength
in interface Document
public java.lang.String getPreferredFilename()
getPreferredFilename
in interface Document
protected void setPreferredFilename()
public java.net.URL getURL() throws SDXException
getURL
in interface Document
SDXException
public void setURL(java.net.URL url)
setURL
in interface Document
public void setPreferredFilename(java.lang.String filename)
setPreferredFilename
in interface Document
filename
- The filename (may be null).public void setIdGenerator(IDGenerator idGen)
setIdGenerator
in interface Document
public void setIdGenerator(IDGenerator idGen, java.lang.String idPrefix, java.lang.String idSuffix)
setIdGenerator
in interface Document
public java.lang.String getRepositoryForStorage()
getRepositoryForStorage
in interface Document
public void setRepositoryForStorage(java.lang.String repoId)
Document
setRepositoryForStorage
in interface Document
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |