FileDocCategorySizeDatePackage
SummaryInformation.javaAPI DocApache Poi 3.0.118157Sun Mar 11 12:59:10 GMT 2007org.apache.poi.hpsf

SummaryInformation

public class SummaryInformation extends SpecialPropertySet

Convenience class representing a Summary Information stream in a Microsoft Office document.

author
Rainer Klute <klute@rainer-klute.de>
see
DocumentSummaryInformation
version
$Id: SummaryInformation.java 496419 2007-01-15 17:56:52Z klute $
since
2002-02-09

Fields Summary
public static final String
DEFAULT_STREAM_NAME

The document name a summary information stream usually has in a POIFS filesystem.

Constructors Summary
public SummaryInformation(PropertySet ps)

Creates a {@link SummaryInformation} from a given {@link PropertySet}.

param
ps A property set which should be created from a summary information stream.
throws
UnexpectedPropertySetTypeException if ps does not contain a summary information stream.




                                                           
       
             
    
        super(ps);
        if (!isSummaryInformation())
            throw new UnexpectedPropertySetTypeException("Not a "
                    + getClass().getName());
    
Methods Summary
public java.lang.StringgetApplicationName()

Returns the application name (or null).

return
The application name or null

        return (String) getProperty(PropertyIDMap.PID_APPNAME);
    
public java.lang.StringgetAuthor()

Returns the author (or null).

return
The author or null

        return (String) getProperty(PropertyIDMap.PID_AUTHOR);
    
public intgetCharCount()

Returns the character count or 0 if the {@link SummaryInformation} does not contain a char count.

return
The character count or null

        return getPropertyIntValue(PropertyIDMap.PID_CHARCOUNT);
    
public java.lang.StringgetComments()

Returns the comments (or null).

return
The comments or null

        return (String) getProperty(PropertyIDMap.PID_COMMENTS);
    
public java.util.DategetCreateDateTime()

Returns the creation time (or null).

return
The creation time or null

        return (Date) getProperty(PropertyIDMap.PID_CREATE_DTM);
    
public longgetEditTime()

Returns the total time spent in editing the document (or 0).

return
The total time spent in editing the document or 0 if the {@link SummaryInformation} does not contain this information.

        final Date d = (Date) getProperty(PropertyIDMap.PID_EDITTIME);
        if (d == null)
            return 0;
        else
            return Util.dateToFileTime(d);
    
public java.lang.StringgetKeywords()

Returns the keywords (or null).

return
The keywords or null

        return (String) getProperty(PropertyIDMap.PID_KEYWORDS);
    
public java.lang.StringgetLastAuthor()

Returns the last author (or null).

return
The last author or null

        return (String) getProperty(PropertyIDMap.PID_LASTAUTHOR);
    
public java.util.DategetLastPrinted()

Returns the last printed time (or null).

return
The last printed time or null

        return (Date) getProperty(PropertyIDMap.PID_LASTPRINTED);
    
public java.util.DategetLastSaveDateTime()

Returns the last save time (or null).

return
The last save time or null

        return (Date) getProperty(PropertyIDMap.PID_LASTSAVE_DTM);
    
public intgetPageCount()

Returns the page count or 0 if the {@link SummaryInformation} does not contain a page count.

return
The page count or 0 if the {@link SummaryInformation} does not contain a page count.

        return getPropertyIntValue(PropertyIDMap.PID_PAGECOUNT);
    
public java.lang.StringgetRevNumber()

Returns the revision number (or null).

return
The revision number or null

        return (String) getProperty(PropertyIDMap.PID_REVNUMBER);
    
public intgetSecurity()

Returns a security code which is one of the following values:

  • 0 if the {@link SummaryInformation} does not contain a security field or if there is no security on the document. Use {@link PropertySet#wasNull()} to distinguish between the two cases!

  • 1 if the document is password protected

  • 2 if the document is read-only recommended

  • 4 if the document is read-only enforced

  • 8 if the document is locked for annotations

return
The security code or null

        return getPropertyIntValue(PropertyIDMap.PID_SECURITY);
    
public java.lang.StringgetSubject()

Returns the subject (or null).

return
The subject or null

        return (String) getProperty(PropertyIDMap.PID_SUBJECT);
    
public java.lang.StringgetTemplate()

Returns the template (or null).

return
The template or null

        return (String) getProperty(PropertyIDMap.PID_TEMPLATE);
    
public byte[]getThumbnail()

Returns the thumbnail (or null) when this method is implemented. Please note that the return type is likely to change!

Hint to developers: Drew Varner <Drew.Varner -at- sc.edu> said that this is an image in WMF or Clipboard (BMP?) format. However, we won't do any conversion into any image type but instead just return a byte array.

return
The thumbnail or null

        return (byte[]) getProperty(PropertyIDMap.PID_THUMBNAIL);
    
public java.lang.StringgetTitle()

Returns the title (or null).

return
The title or null

        return (String) getProperty(PropertyIDMap.PID_TITLE);
    
public intgetWordCount()

Returns the word count or 0 if the {@link SummaryInformation} does not contain a word count.

return
The word count or null

        return getPropertyIntValue(PropertyIDMap.PID_WORDCOUNT);
    
public voidremoveApplicationName()

Removes the application name.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_APPNAME);
    
public voidremoveAuthor()

Removes the author.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_AUTHOR);
    
public voidremoveCharCount()

Removes the character count.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_CHARCOUNT);
    
public voidremoveComments()

Removes the comments.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_COMMENTS);
    
public voidremoveCreateDateTime()

Removes the creation time.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_CREATE_DTM);
    
public voidremoveEditTime()

Remove the total time spent in editing the document.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_EDITTIME);
    
public voidremoveKeywords()

Removes the keywords.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_KEYWORDS);
    
public voidremoveLastAuthor()

Removes the last author.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_LASTAUTHOR);
    
public voidremoveLastPrinted()

Removes the lastPrinted.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_LASTPRINTED);
    
public voidremoveLastSaveDateTime()

Remove the total time spent in editing the document.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_LASTSAVE_DTM);
    
public voidremovePageCount()

Removes the page count.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_PAGECOUNT);
    
public voidremoveRevNumber()

Removes the revision number.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_REVNUMBER);
    
public voidremoveSecurity()

Removes the security code.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_SECURITY);
    
public voidremoveSubject()

Removes the subject.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_SUBJECT);
    
public voidremoveTemplate()

Removes the template.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_TEMPLATE);
    
public voidremoveThumbnail()

Removes the thumbnail.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_THUMBNAIL);
    
public voidremoveTitle()

Removes the title.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_TITLE);
    
public voidremoveWordCount()

Removes the word count.

        final MutableSection s = (MutableSection) getFirstSection();
        s.removeProperty(PropertyIDMap.PID_WORDCOUNT);
    
public voidsetApplicationName(java.lang.String applicationName)

Sets the application name.

param
applicationName The application name to set.

        final MutableSection s = (MutableSection) getFirstSection();
        s.setProperty(PropertyIDMap.PID_APPNAME, applicationName);
    
public voidsetAuthor(java.lang.String author)

Sets the author.

param
author The author to set.

        final MutableSection s = (MutableSection) getFirstSection();
        s.setProperty(PropertyIDMap.PID_AUTHOR, author);
    
public voidsetCharCount(int charCount)

Sets the character count.

param
charCount The character count to set.

        final MutableSection s = (MutableSection) getFirstSection();
        s.setProperty(PropertyIDMap.PID_CHARCOUNT, charCount);
    
public voidsetComments(java.lang.String comments)

Sets the comments.

param
comments The comments to set.

        final MutableSection s = (MutableSection) getFirstSection();
        s.setProperty(PropertyIDMap.PID_COMMENTS, comments);
    
public voidsetCreateDateTime(java.util.Date createDateTime)

Sets the creation time.

param
createDateTime The creation time to set.

        final MutableSection s = (MutableSection) getFirstSection();
        s.setProperty(PropertyIDMap.PID_CREATE_DTM, Variant.VT_FILETIME,
                createDateTime);
    
public voidsetEditTime(long time)

Sets the total time spent in editing the document.

param
time The time to set.

        final Date d = Util.filetimeToDate(time);
        final MutableSection s = (MutableSection) getFirstSection();
        s.setProperty(PropertyIDMap.PID_EDITTIME, Variant.VT_FILETIME, d);
    
public voidsetKeywords(java.lang.String keywords)

Sets the keywords.

param
keywords The keywords to set.

        final MutableSection s = (MutableSection) getFirstSection();
        s.setProperty(PropertyIDMap.PID_KEYWORDS, keywords);
    
public voidsetLastAuthor(java.lang.String lastAuthor)

Sets the last author.

param
lastAuthor The last author to set.

        final MutableSection s = (MutableSection) getFirstSection();
        s.setProperty(PropertyIDMap.PID_LASTAUTHOR, lastAuthor);
    
public voidsetLastPrinted(java.util.Date lastPrinted)

Sets the lastPrinted.

param
lastPrinted The lastPrinted to set.

        final MutableSection s = (MutableSection) getFirstSection();
        s.setProperty(PropertyIDMap.PID_LASTPRINTED, Variant.VT_FILETIME,
                lastPrinted);
    
public voidsetLastSaveDateTime(java.util.Date time)

Sets the total time spent in editing the document.

param
time The time to set.

        final MutableSection s = (MutableSection) getFirstSection();
        s
                .setProperty(PropertyIDMap.PID_LASTSAVE_DTM,
                        Variant.VT_FILETIME, time);
    
public voidsetPageCount(int pageCount)

Sets the page count.

param
pageCount The page count to set.

        final MutableSection s = (MutableSection) getFirstSection();
        s.setProperty(PropertyIDMap.PID_PAGECOUNT, pageCount);
    
public voidsetRevNumber(java.lang.String revNumber)

Sets the revision number.

param
revNumber The revision number to set.

        final MutableSection s = (MutableSection) getFirstSection();
        s.setProperty(PropertyIDMap.PID_REVNUMBER, revNumber);
    
public voidsetSecurity(int security)

Sets the security code.

param
security The security code to set.

        final MutableSection s = (MutableSection) getFirstSection();
        s.setProperty(PropertyIDMap.PID_SECURITY, security);
    
public voidsetSubject(java.lang.String subject)

Sets the subject.

param
subject The subject to set.

        final MutableSection s = (MutableSection) getFirstSection();
        s.setProperty(PropertyIDMap.PID_SUBJECT, subject);
    
public voidsetTemplate(java.lang.String template)

Sets the template.

param
template The template to set.

        final MutableSection s = (MutableSection) getFirstSection();
        s.setProperty(PropertyIDMap.PID_TEMPLATE, template);
    
public voidsetThumbnail(byte[] thumbnail)

Sets the thumbnail.

param
thumbnail The thumbnail to set.

        final MutableSection s = (MutableSection) getFirstSection();
        s.setProperty(PropertyIDMap.PID_THUMBNAIL, /* FIXME: */
                Variant.VT_LPSTR, thumbnail);
    
public voidsetTitle(java.lang.String title)

Sets the title.

param
title The title to set.

        final MutableSection s = (MutableSection) getFirstSection();
        s.setProperty(PropertyIDMap.PID_TITLE, title);
    
public voidsetWordCount(int wordCount)

Sets the word count.

param
wordCount The word count to set.

        final MutableSection s = (MutableSection) getFirstSection();
        s.setProperty(PropertyIDMap.PID_WORDCOUNT, wordCount);