Methods Summary |
---|
public org.apache.poi.hpsf.DocumentSummaryInformation | getDocumentSummaryInformation()Fetch the Document Summary Information of the document
return dsInf;
|
protected org.apache.poi.hpsf.PropertySet | getPropertySet(java.lang.String setName)For a given named property entry, either return it or null if
if it wasn't found
DocumentInputStream dis;
try {
// Find the entry, and get an input stream for it
dis = filesystem.createDocumentInputStream(setName);
} catch(IOException ie) {
// Oh well, doesn't exist
System.err.println("Error getting property set with name " + setName + "\n" + ie);
return null;
}
try {
// Create the Property Set
PropertySet set = PropertySetFactory.create(dis);
return set;
} catch(IOException ie) {
// Must be corrupt or something like that
System.err.println("Error creating property set with name " + setName + "\n" + ie);
} catch(org.apache.poi.hpsf.HPSFException he) {
// Oh well, doesn't exist
System.err.println("Error creating property set with name " + setName + "\n" + he);
}
return null;
|
public org.apache.poi.hpsf.SummaryInformation | getSummaryInformation()Fetch the Summary Information of the document return sInf;
|
protected void | readProperties()Find, and create objects for, the standard
Documment Information Properties (HPSF)
// DocumentSummaryInformation
dsInf = (DocumentSummaryInformation)getPropertySet(DocumentSummaryInformation.DEFAULT_STREAM_NAME);
// SummaryInformation
sInf = (SummaryInformation)getPropertySet(SummaryInformation.DEFAULT_STREAM_NAME);
|
protected void | writeProperties(org.apache.poi.poifs.filesystem.POIFSFileSystem outFS)Writes out the standard Documment Information Properties (HPSF)
if(sInf != null) {
writePropertySet(SummaryInformation.DEFAULT_STREAM_NAME,sInf,outFS);
}
if(dsInf != null) {
writePropertySet(DocumentSummaryInformation.DEFAULT_STREAM_NAME,dsInf,outFS);
}
|
protected void | writePropertySet(java.lang.String name, org.apache.poi.hpsf.PropertySet set, org.apache.poi.poifs.filesystem.POIFSFileSystem outFS)Writes out a given ProperySet
try {
MutablePropertySet mSet = new MutablePropertySet(set);
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
mSet.write(bOut);
byte[] data = bOut.toByteArray();
ByteArrayInputStream bIn = new ByteArrayInputStream(data);
outFS.createDocument(bIn,name);
logger.log(POILogger.INFO, "Wrote property set " + name + " of size " + data.length);
} catch(org.apache.poi.hpsf.WritingNotSupportedException wnse) {
System.err.println("Couldn't write property set with name " + name + " as not supported by HPSF yet");
}
|