poifs= new POIFSFileSystem();
dir = poifs.getRoot();
dsi=null;
try
{
DocumentEntry dsiEntry = (DocumentEntry)
dir.getEntry(DocumentSummaryInformation.DEFAULT_STREAM_NAME);
DocumentInputStream dis = new DocumentInputStream(dsiEntry);
PropertySet ps = new PropertySet(dis);
dis.close();
dsi = new DocumentSummaryInformation(ps);
}
catch (FileNotFoundException ex)
{
/* There is no document summary information yet. We have to create a
* new one. */
dsi = PropertySetFactory.newDocumentSummaryInformation();
assertNotNull(dsi);
} catch (IOException e) {
e.printStackTrace();
fail();
} catch (NoPropertySetStreamException e) {
e.printStackTrace();
fail();
} catch (MarkUnsupportedException e) {
e.printStackTrace();
fail();
} catch (UnexpectedPropertySetTypeException e) {
e.printStackTrace();
fail();
}
assertNotNull(dsi);
try
{
DocumentEntry dsiEntry = (DocumentEntry)
dir.getEntry(SummaryInformation.DEFAULT_STREAM_NAME);
DocumentInputStream dis = new DocumentInputStream(dsiEntry);
PropertySet ps = new PropertySet(dis);
dis.close();
si = new SummaryInformation(ps);