/** * Sets the total time spent in editing the document. * * @param time The time to set. */ public void setEditTime(final long time) { final Date d = Filetime.filetimeToDate(time); getFirstSection().setProperty(PropertyIDMap.PID_EDITTIME, Variant.VT_FILETIME, d); }
/** * Creates section 2 if it is not already present. */ private void ensureSection2() { if (getSectionCount() < 2) { Section s2 = new Section(); s2.setFormatID(USER_DEFINED_PROPERTIES); addSection(s2); } }
/** * Sets the total time spent in editing the document. * * @param time The time to set. */ public void setLastSaveDateTime(final Date time) { final Section s = getFirstSection(); s .setProperty(PropertyIDMap.PID_LASTSAVE_DTM, Variant.VT_FILETIME, time); }
/** * @see Object#hashCode() */ @Override public int hashCode() { long hashCode = 0; hashCode += getFormatID().hashCode(); final Property[] pa = getProperties(); for (Property aPa : pa) { hashCode += aPa.hashCode(); } return (int) (hashCode & 0x0ffffffffL); }
/** * Removes all properties from the section including 0 (dictionary) and 1 (codepage). */ public void clear() { for (Property p : getProperties()) { removeProperty(p.getID()); } }
private String getVariantName() { if (getID() == 0) { return "dictionary"; } return Variant.getVariantName(getType()); }
/** * Convenience method returning the value of the property with the specified ID. * If the property is not available, {@code null} is returned and a subsequent * call to {@link #wasNull} will return {@code true}. * * @param id The property ID * @return The property value * @throws NoSingleSectionException if the {@link PropertySet} has * more or less than one {@link Section}. */ protected Object getProperty(final int id) throws NoSingleSectionException { return getFirstSection().getProperty(id); }
/** * Sets the presentation format. * * @param presentationFormat The presentation format to set. */ public void setPresentationFormat(final String presentationFormat) { getFirstSection().setProperty(PropertyIDMap.PID_PRESFORMAT, presentationFormat); }
/** * Creates an empty {@link DocumentSummaryInformation}. */ public DocumentSummaryInformation() { getFirstSection().setFormatID(DOC_SUMMARY_INFORMATION); }
/** * Creates an empty {@link SummaryInformation}. */ public SummaryInformation() { getFirstSection().setFormatID(FORMAT_ID); }
@SuppressWarnings("SameParameterValue") void set1stProperty(long id, byte[] value) { getFirstSection().setProperty((int)id, value); }
/** * Returns the line count or 0 if the {@link * DocumentSummaryInformation} does not contain a line count. * * @return The line count value */ public int getLineCount() { return getPropertyIntValue(PropertyIDMap.PID_LINECOUNT); }
/** * Sets the doc parts. * * @param docparts The doc parts to set. */ public void setDocparts(final byte[] docparts) { notYetImplemented("Writing byte arrays"); }
/** * Sets the content type of the file * * @param type the content type of the file */ public void setContentType(String type) { set1stProperty(PropertyIDMap.PID_CONTENTTYPE, type); }
/** * Removes the document language */ public void removeLanguage() { remove1stProperty(PropertyIDMap.PID_LANGUAGE); }
/** * Sets the creation time. * * @param createDateTime The creation time to set. */ public void setCreateDateTime(final Date createDateTime) { getFirstSection().setProperty(PropertyIDMap.PID_CREATE_DTM, Variant.VT_FILETIME, createDateTime); }
/** * Sets the category. * * @param category The category to set. */ public void setCategory(final String category) { getFirstSection().setProperty(PropertyIDMap.PID_CATEGORY, category); }
/** * Sets the lastPrinted. * * @param lastPrinted The lastPrinted to set. */ public void setLastPrinted(final Date lastPrinted) { getFirstSection().setProperty(PropertyIDMap.PID_LASTPRINTED, Variant.VT_FILETIME, lastPrinted); }
/** * Sets the thumbnail. * * @param thumbnail The thumbnail to set. */ public void setThumbnail(final byte[] thumbnail) { getFirstSection().setProperty(PropertyIDMap.PID_THUMBNAIL, /* FIXME: */ Variant.VT_LPSTR, thumbnail); }