|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jopendocument.dom.ODPackage
public class ODPackage
An OpenDocument package, ie a zip containing XML documents and their associated files.
| Constructor Summary | |
|---|---|
ODPackage()
|
|
ODPackage(File f)
|
|
ODPackage(InputStream ins)
|
|
ODPackage(ODPackage o)
|
|
| Method Summary | |
|---|---|
byte[] |
getBinaryFile(String entry)
|
ODXMLDocument |
getContent()
|
ContentTypeVersioned |
getContentType()
The type of this package, null if it cannot be found (eg this package is empty). |
protected Object |
getData(String entry)
|
org.jdom.Document |
getDocument(String xmlEntry)
Return an XML document. |
Set<String> |
getEntries()
|
ODPackageEntry |
getEntry(String entry)
|
File |
getFile()
|
ODMeta |
getMeta()
|
String |
getMimeType()
|
org.jdom.Element |
getStyle(org.jdom.Document referent,
String family,
String name)
Find the passed automatic or common style. |
org.jdom.Element |
getStyle(String family,
String name)
Find the passed automatic or common style referenced from the content. |
XMLVersion |
getVersion()
The version of this package, null if it cannot be found (eg this package is
empty, or contains no xml). |
ODXMLDocument |
getXMLFile(org.jdom.Document doc)
|
ODXMLDocument |
getXMLFile(String xmlEntry)
|
boolean |
isSingle()
|
static boolean |
isStandardFile(String name)
Whether the passed entry is specific to a package. |
void |
putFile(String entry,
Object data)
|
void |
putFile(String entry,
Object data,
String mediaType)
|
void |
putFile(String entry,
Object data,
String mediaType,
boolean compress)
|
void |
rmFile(String entry)
|
File |
save()
Save the content of this package to our file, overwriting it if it exists. |
void |
save(OutputStream out)
|
File |
saveAs(File fNoExt)
|
void |
setFile(File f)
|
ODSingleXMLDocument |
toSingle()
Transform this to use a ODSingleXMLDocument. |
Map<String,String> |
validateSubDocuments()
Call OOXML.isValid(Document) on each XML subdocuments. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ODPackage()
public ODPackage(InputStream ins)
throws IOException
IOException
public ODPackage(File f)
throws IOException
IOExceptionpublic ODPackage(ODPackage o)
| Method Detail |
|---|
public static final boolean isStandardFile(String name)
name - a entry name, eg "mimetype"
true if name is a standard file, eg true.public final File getFile()
public final void setFile(File f)
public final XMLVersion getVersion()
null if it cannot be found (eg this package is
empty, or contains no xml).
null.public final ContentTypeVersioned getContentType()
null if it cannot be found (eg this package is empty).
null.public final String getMimeType()
public final Map<String,String> validateSubDocuments()
OOXML.isValid(Document) on each XML subdocuments.
public final Set<String> getEntries()
public final ODPackageEntry getEntry(String entry)
protected final Object getData(String entry)
public final byte[] getBinaryFile(String entry)
public final ODXMLDocument getXMLFile(String xmlEntry)
public final ODXMLDocument getXMLFile(org.jdom.Document doc)
public final ODXMLDocument getContent()
public final ODMeta getMeta()
public org.jdom.Document getDocument(String xmlEntry)
xmlEntry - the filename, eg "styles.xml".
null if there's none.
org.jdom.JDOMException - if error about the XML.
IOException - if an error occurs while reading the file.
public final org.jdom.Element getStyle(String family,
String name)
family - the family, eg "paragraph".name - the name, eg "P1".
public final org.jdom.Element getStyle(org.jdom.Document referent,
String family,
String name)
referent is needed because
there can exist automatic styles with the same name in both "content.xml" and "styles.xml".
referent - the document referencing the style.family - the family, eg "paragraph".name - the name, eg "P1".
ODXMLDocument.getStyle(String, String)
public void putFile(String entry,
Object data)
public void putFile(String entry,
Object data,
String mediaType)
public void putFile(String entry,
Object data,
String mediaType,
boolean compress)
public void rmFile(String entry)
public ODSingleXMLDocument toSingle()
ODSingleXMLDocument. Ie after this method, only "content.xml"
remains and it's an instance of ODSingleXMLDocument.
public final boolean isSingle()
public final void save(OutputStream out)
throws IOException
IOException
public File save()
throws IOException
IOException - if an error occurs while saving.
public File saveAs(File fNoExt)
throws IOException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||