public interface Document extends SdxObject
SDX is mainly a search engine for XML documents, but these documents can be linked with other documents or they may not be in XML at first. That's why we abstracted the concept of documents with this interface.
SdxObject.ConfigurationNode
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_NAME_SUFFIX |
static java.lang.String |
DOCTYPE_BINARY
doctype Binary
|
static java.lang.String |
DOCTYPE_GROUP
doctype Group
|
static java.lang.String |
DOCTYPE_HTML
doctype HTMLDocument
|
static java.lang.String |
DOCTYPE_USER
doctype User
|
static java.lang.String |
DOCTYPE_XML
doctype XMLDocument
|
DEFAULT_ENCODING
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDocType()
Gets the docType for the document
|
int |
getLength()
Returns the length of the document (-1 if length can't be known).
|
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() |
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 r)
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 mime type for the document
|
void |
setPreferredFilename(java.lang.String filename)
Sets the preferred filename for this document.
|
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.
|
getId
getDescription, setDescription
getEncoding, setEncoding
getLocale, getXmlLang, setLocale, setXmlLang
static final java.lang.String CLASS_NAME_SUFFIX
static final java.lang.String DOCTYPE_HTML
static final java.lang.String DOCTYPE_XML
static final java.lang.String DOCTYPE_USER
static final java.lang.String DOCTYPE_GROUP
static final java.lang.String DOCTYPE_BINARY
void setId(java.lang.String id) throws SDXException
setId
in interface Identifiable
SDXException
java.io.InputStream openStream() throws SDXException
SDXException
void setContent(byte[] b)
void setContent(java.io.File f)
void setContent(java.net.URL r)
void setContent(java.io.InputStream is)
void save(Repository r) throws SDXException
SDXException
int getLength()
java.lang.String getPreferredFilename()
java.net.URL getURL() throws SDXException
SDXException
void setURL(java.net.URL url)
java.lang.String getMimeType()
void setMimeType(java.lang.String mimeType)
java.lang.String getDocType()
void setPreferredFilename(java.lang.String filename)
void setIdGenerator(IDGenerator idGen, java.lang.String idPrefix, java.lang.String idSuffix)
void setIdGenerator(IDGenerator idGen)
java.lang.String getRepositoryForStorage()
void setRepositoryForStorage(java.lang.String repoId)
Copyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.