Top Description Fields Constructors Methods
org.apache.poi.hpsf

public final Class SummaryInformation

extends PropertySet
Class Inheritance
Static Imports
org.apache.poi.hpsf.ClassIDPredefined.SUMMARY_PROPERTIES

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

Field Summary

Modifier and TypeField and Description
public static final String
DEFAULT_STREAM_NAME

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

public static final ClassID
FORMAT_ID

The SummaryInformation's section's format ID.

Inherited from org.apache.poi.hpsf.PropertySet:
BYTE_ORDER_ASSERTIONFORMAT_ASSERTIONOFFSET_HEADEROS_MACINTOSHOS_WIN16OS_WIN32

Constructor Summary

AccessConstructor and Description
public
SummaryInformation()

Creates an empty SummaryInformation.

public
SummaryInformation(final PropertySet
A property set which should be created from a summary information stream.
ps
)

Creates a SummaryInformation from a given PropertySet.

public
SummaryInformation(final InputStream
Holds the data making out the property set stream.
stream
)

Creates a SummaryInformation instance from an InputStream in the Horrible Property Set Format.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The application name or null
getApplicationName
()

Returns the application name (or null).

public String

Returns:

The author or null
getAuthor
()

Returns the author (or null).

public int

Returns:

The character count or null
getCharCount
()

Returns the character count or 0 if the SummaryInformation does not contain a char count.

public String

Returns:

The comments or null
getComments
()

Returns the comments (or null).

public Date

Returns:

The creation time or null
getCreateDateTime
()

Returns the creation time (or null).

public long

Returns:

The total time spent in editing the document or 0 if the SummaryInformation does not contain this information.
getEditTime
()

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

public String

Returns:

The keywords or null
getKeywords
()

Returns the keywords (or null).

public String

Returns:

The last author or null
getLastAuthor
()

Returns the last author (or null).

public Date

Returns:

The last printed time or null
getLastPrinted
()

Returns the last printed time (or null).

public Date

Returns:

The last save time or null
getLastSaveDateTime
()

Returns the last save time (or null).

public int

Returns:

The page count or 0 if the SummaryInformation does not contain a page count.
getPageCount
()

Returns the page count or 0 if the SummaryInformation does not contain a page count.

public PropertyIDMap
getPropertySetIDMap()

Overrides org.apache.poi.hpsf.PropertySet.getPropertySetIDMap.

The id to name mapping of the properties in this set.

public String

Returns:

The revision number or null
getRevNumber
()

Returns the revision number (or null).

public int

Returns:

The security code or null
getSecurity
()

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

  • 0 if the SummaryInformation does not contain a security field or if there is no security on the document. Use 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
public String

Returns:

The subject or null
getSubject
()

Returns the subject (or null).

public String

Returns:

The template or null
getTemplate
()

Returns the template (or null).

public byte[]

Returns:

The thumbnail or null
getThumbnail
()

Returns the thumbnail (or null) when this method is implemented.

public Thumbnail

Returns:

The thumbnail or null
getThumbnailThumbnail
()

Returns the thumbnail (or null), processed as an object which is (largely) able to unpack the thumbnail image data.

public String

Returns:

The title or null
getTitle
()

public int

Returns:

The word count or null
getWordCount
()

Returns the word count or 0 if the SummaryInformation does not contain a word count.

public void
removeApplicationName()

Removes the application name.

public void
removeAuthor()

Removes the author.

public void
removeCharCount()

Removes the character count.

public void
removeComments()

Removes the comments.

public void
removeCreateDateTime()

Removes the creation time.

public void
removeEditTime()

Remove the total time spent in editing the document.

public void
removeKeywords()

Removes the keywords.

public void
removeLastAuthor()

Removes the last author.

public void
removeLastPrinted()

Removes the lastPrinted.

public void
removeLastSaveDateTime()

Remove the total time spent in editing the document.

public void
removePageCount()

Removes the page count.

public void
removeRevNumber()

Removes the revision number.

public void
removeSecurity()

Removes the security code.

public void
removeSubject()

Removes the subject.

public void
removeTemplate()

Removes the template.

public void
removeThumbnail()

Removes the thumbnail.

public void
removeTitle()

Removes the title.

public void
removeWordCount()

Removes the word count.

public void
setApplicationName(final String
The application name to set.
applicationName
)

Sets the application name.

public void
setAuthor(final String
The author to set.
author
)

Sets the author.

public void
setCharCount(final int
The character count to set.
charCount
)

Sets the character count.

public void
setComments(final String
The comments to set.
comments
)

Sets the comments.

public void
setCreateDateTime(final Date
The creation time to set.
createDateTime
)

Sets the creation time.

public void
setEditTime(final long
The time to set.
time
)

Sets the total time spent in editing the document.

public void
setKeywords(final String
The keywords to set.
keywords
)

Sets the keywords.

public void
setLastAuthor(final String
The last author to set.
lastAuthor
)

Sets the last author.

public void
setLastPrinted(final Date
The lastPrinted to set.
lastPrinted
)

Sets the lastPrinted.

public void
setLastSaveDateTime(final Date
The time to set.
time
)

Sets the total time spent in editing the document.

public void
setPageCount(final int
The page count to set.
pageCount
)

Sets the page count.

public void
setRevNumber(final String
The revision number to set.
revNumber
)

Sets the revision number.

public void
setSecurity(final int
The security code to set.
security
)

Sets the security code.

public void
setSubject(final String
The subject to set.
subject
)

Sets the subject.

public void
setTemplate(final String
The template to set.
template
)

Sets the template.

public void
setThumbnail(final byte[]
The thumbnail to set.
thumbnail
)

Sets the thumbnail.

public void
setTitle(final String
The title to set.
title
)

Sets the title.

public void
setWordCount(final int
The word count to set.
wordCount
)

Sets the word count.

Inherited from org.apache.poi.hpsf.PropertySet:
addSectionclearSectionsequalsgetByteOrdergetClassIDgetFirstSectiongetFormatgetOSVersiongetPropertiesgetPropertygetPropertyBooleanValuegetPropertyIntValuegetPropertyStringValuegetPropertyStringValuegetSectionCountgetSectionshashCodeisDocumentSummaryInformationisPropertySetStreamisPropertySetStreamisSummaryInformationmatchesSummaryremove1stPropertyset1stPropertyset1stPropertyset1stPropertyset1stPropertysetByteOrdersetClassIDsetFormatsetOSVersiontoInputStreamtoStringwasNullwritewrite

Field Detail

DEFAULT_STREAM_NAMEback to summary
public static final String DEFAULT_STREAM_NAME

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

FORMAT_IDback to summary
public static final ClassID FORMAT_ID

The SummaryInformation's section's format ID.

Constructor Detail

SummaryInformationback to summary
public SummaryInformation()

Creates an empty SummaryInformation.

SummaryInformationback to summary
public SummaryInformation(final PropertySet ps) throws UnexpectedPropertySetTypeException

Creates a SummaryInformation from a given PropertySet.

Parameters
ps:PropertySet

A property set which should be created from a summary information stream.

Exceptions
UnexpectedPropertySetTypeException:
if ps does not contain a summary information stream.
SummaryInformationback to summary
public SummaryInformation(final InputStream stream) throws NoPropertySetStreamException, IOException

Creates a SummaryInformation instance from an InputStream in the Horrible Property Set Format.

The constructor reads the first few bytes from the stream and determines whether it is really a property set stream. If it is, it parses the rest of the stream. If it is not, it resets the stream to its beginning in order to let other components mess around with the data and throws an exception.

Parameters
stream:InputStream

Holds the data making out the property set stream.

Exceptions
NoPropertySetStreamException:
if the input stream does not contain a property set.
IOException:
if the InputStream cannot be accessed as needed.
UnsupportedEncodingException:
if a character encoding is not supported.

Method Detail

getApplicationNameback to summary
public String getApplicationName()

Returns the application name (or null).

Returns:String

The application name or null

getAuthorback to summary
public String getAuthor()

Returns the author (or null).

Returns:String

The author or null

getCharCountback to summary
public int getCharCount()

Returns the character count or 0 if the SummaryInformation does not contain a char count.

Returns:int

The character count or null

getCommentsback to summary
public String getComments()

Returns the comments (or null).

Returns:String

The comments or null

getCreateDateTimeback to summary
public Date getCreateDateTime()

Returns the creation time (or null).

Returns:Date

The creation time or null

getEditTimeback to summary
public long getEditTime()

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

Returns:long

The total time spent in editing the document or 0 if the SummaryInformation does not contain this information.

getKeywordsback to summary
public String getKeywords()

Returns the keywords (or null).

Returns:String

The keywords or null

getLastAuthorback to summary
public String getLastAuthor()

Returns the last author (or null).

Returns:String

The last author or null

getLastPrintedback to summary
public Date getLastPrinted()

Returns the last printed time (or null).

Returns:Date

The last printed time or null

getLastSaveDateTimeback to summary
public Date getLastSaveDateTime()

Returns the last save time (or null).

Returns:Date

The last save time or null

getPageCountback to summary
public int getPageCount()

Returns the page count or 0 if the SummaryInformation does not contain a page count.

Returns:int

The page count or 0 if the SummaryInformation does not contain a page count.

getPropertySetIDMapback to summary
public PropertyIDMap getPropertySetIDMap()

Overrides org.apache.poi.hpsf.PropertySet.getPropertySetIDMap.

Doc from org.apache.poi.hpsf.PropertySet.getPropertySetIDMap.

The id to name mapping of the properties in this set.

Returns:PropertyIDMap

the id to name mapping of the properties in this set or null if not applicable

Annotations
@Override
getRevNumberback to summary
public String getRevNumber()

Returns the revision number (or null).

Returns:String

The revision number or null

getSecurityback to summary
public int getSecurity()

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

  • 0 if the SummaryInformation does not contain a security field or if there is no security on the document. Use 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
Returns:int

The security code or null

getSubjectback to summary
public String getSubject()

Returns the subject (or null).

Returns:String

The subject or null

getTemplateback to summary
public String getTemplate()

Returns the template (or null).

Returns:String

The template or null

getThumbnailback to summary
public byte[] getThumbnail()

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

To process this data, you may wish to make use of the Thumbnail class. The raw data is generally an image in WMF or Clipboard (BMP?) format

Returns:byte[]

The thumbnail or null

getThumbnailThumbnailback to summary
public Thumbnail getThumbnailThumbnail()

Returns the thumbnail (or null), processed as an object which is (largely) able to unpack the thumbnail image data.

Returns:Thumbnail

The thumbnail or null

getTitleback to summary
public String getTitle()
Returns:String

The title or null

getWordCountback to summary
public int getWordCount()

Returns the word count or 0 if the SummaryInformation does not contain a word count.

Returns:int

The word count or null

removeApplicationNameback to summary
public void removeApplicationName()

Removes the application name.

removeAuthorback to summary
public void removeAuthor()

Removes the author.

removeCharCountback to summary
public void removeCharCount()

Removes the character count.

removeCommentsback to summary
public void removeComments()

Removes the comments.

removeCreateDateTimeback to summary
public void removeCreateDateTime()

Removes the creation time.

removeEditTimeback to summary
public void removeEditTime()

Remove the total time spent in editing the document.

removeKeywordsback to summary
public void removeKeywords()

Removes the keywords.

removeLastAuthorback to summary
public void removeLastAuthor()

Removes the last author.

removeLastPrintedback to summary
public void removeLastPrinted()

Removes the lastPrinted.

removeLastSaveDateTimeback to summary
public void removeLastSaveDateTime()

Remove the total time spent in editing the document.

removePageCountback to summary
public void removePageCount()

Removes the page count.

removeRevNumberback to summary
public void removeRevNumber()

Removes the revision number.

removeSecurityback to summary
public void removeSecurity()

Removes the security code.

removeSubjectback to summary
public void removeSubject()

Removes the subject.

removeTemplateback to summary
public void removeTemplate()

Removes the template.

removeThumbnailback to summary
public void removeThumbnail()

Removes the thumbnail.

removeTitleback to summary
public void removeTitle()

Removes the title.

removeWordCountback to summary
public void removeWordCount()

Removes the word count.

setApplicationNameback to summary
public void setApplicationName(final String applicationName)

Sets the application name.

Parameters
applicationName:String

The application name to set.

setAuthorback to summary
public void setAuthor(final String author)

Sets the author.

Parameters
author:String

The author to set.

setCharCountback to summary
public void setCharCount(final int charCount)

Sets the character count.

Parameters
charCount:int

The character count to set.

setCommentsback to summary
public void setComments(final String comments)

Sets the comments.

Parameters
comments:String

The comments to set.

setCreateDateTimeback to summary
public void setCreateDateTime(final Date createDateTime)

Sets the creation time.

Parameters
createDateTime:Date

The creation time to set.

setEditTimeback to summary
public void setEditTime(final long time)

Sets the total time spent in editing the document.

Parameters
time:long

The time to set.

setKeywordsback to summary
public void setKeywords(final String keywords)

Sets the keywords.

Parameters
keywords:String

The keywords to set.

setLastAuthorback to summary
public void setLastAuthor(final String lastAuthor)

Sets the last author.

Parameters
lastAuthor:String

The last author to set.

setLastPrintedback to summary
public void setLastPrinted(final Date lastPrinted)

Sets the lastPrinted.

Parameters
lastPrinted:Date

The lastPrinted to set.

setLastSaveDateTimeback to summary
public void setLastSaveDateTime(final Date time)

Sets the total time spent in editing the document.

Parameters
time:Date

The time to set.

setPageCountback to summary
public void setPageCount(final int pageCount)

Sets the page count.

Parameters
pageCount:int

The page count to set.

setRevNumberback to summary
public void setRevNumber(final String revNumber)

Sets the revision number.

Parameters
revNumber:String

The revision number to set.

setSecurityback to summary
public void setSecurity(final int security)

Sets the security code.

Parameters
security:int

The security code to set.

setSubjectback to summary
public void setSubject(final String subject)

Sets the subject.

Parameters
subject:String

The subject to set.

setTemplateback to summary
public void setTemplate(final String template)

Sets the template.

Parameters
template:String

The template to set.

setThumbnailback to summary
public void setThumbnail(final byte[] thumbnail)

Sets the thumbnail.

Parameters
thumbnail:byte[]

The thumbnail to set.

setTitleback to summary
public void setTitle(final String title)

Sets the title.

Parameters
title:String

The title to set.

setWordCountback to summary
public void setWordCount(final int wordCount)

Sets the word count.

Parameters
wordCount:int

The word count to set.