final PropertySet si)
throws WritingNotSupportedException, IOException
{
/* Get the directory entry for the target stream. */
final DirectoryEntry de = getPath(poiFs, path);
/* Create a mutable property set as a copy of the original read-only
* property set. */
final MutablePropertySet mps = new MutablePropertySet(si);
/* Retrieve the section containing the properties to modify. A
* summary information property set contains exactly one section. */
final MutableSection s =
(MutableSection) mps.getSections().get(0);
/* Set the properties. */
s.setProperty(PropertyIDMap.PID_AUTHOR, Variant.VT_LPSTR,
"Rainer Klute");
s.setProperty(PropertyIDMap.PID_TITLE, Variant.VT_LPWSTR,
"Test");
/* Create an input stream containing the bytes the property set
* stream consists of. */
final InputStream pss = mps.toInputStream();
/* Write the property set stream to the POIFS. */
de.createDocument(name, pss);
}