1 2 17 18 package org.apache.poi.hpsf; 19 20 import java.util.Date ; 21 import org.apache.poi.hpsf.wellknown.PropertyIDMap; 22 23 33 public class SummaryInformation extends SpecialPropertySet 34 { 35 36 40 public static final String DEFAULT_STREAM_NAME = "\005SummaryInformation"; 41 42 43 44 53 public SummaryInformation(final PropertySet ps) 54 throws UnexpectedPropertySetTypeException 55 { 56 super(ps); 57 if (!isSummaryInformation()) 58 throw new UnexpectedPropertySetTypeException 59 ("Not a " + getClass().getName()); 60 } 61 62 63 64 69 public String getTitle() 70 { 71 return (String ) getProperty(PropertyIDMap.PID_TITLE); 72 } 73 74 75 76 81 public String getSubject() 82 { 83 return (String ) getProperty(PropertyIDMap.PID_SUBJECT); 84 } 85 86 87 88 93 public String getAuthor() 94 { 95 return (String ) getProperty(PropertyIDMap.PID_AUTHOR); 96 } 97 98 99 100 105 public String getKeywords() 106 { 107 return (String ) getProperty(PropertyIDMap.PID_KEYWORDS); 108 } 109 110 111 112 117 public String getComments() 118 { 119 return (String ) getProperty(PropertyIDMap.PID_COMMENTS); 120 } 121 122 123 124 129 public String getTemplate() 130 { 131 return (String ) getProperty(PropertyIDMap.PID_TEMPLATE); 132 } 133 134 135 136 141 public String getLastAuthor() 142 { 143 return (String ) getProperty(PropertyIDMap.PID_LASTAUTHOR); 144 } 145 146 147 148 154 public String getRevNumber() 155 { 156 return (String ) getProperty(PropertyIDMap.PID_REVNUMBER); 157 } 158 159 160 161 168 public long getEditTime() 169 { 170 final Date d = (Date ) getProperty(PropertyIDMap.PID_EDITTIME); 171 if (d == null) 172 return 0; 173 else 174 return Util.dateToFileTime(d); 175 } 176 177 178 179 185 public Date getLastPrinted() 186 { 187 return (Date ) getProperty(PropertyIDMap.PID_LASTPRINTED); 188 } 189 190 191 192 198 public Date getCreateDateTime() 199 { 200 return (Date ) getProperty(PropertyIDMap.PID_CREATE_DTM); 201 } 202 203 204 205 211 public Date getLastSaveDateTime() 212 { 213 return (Date ) getProperty(PropertyIDMap.PID_LASTSAVE_DTM); 214 } 215 216 217 218 225 public int getPageCount() 226 { 227 return getPropertyIntValue(PropertyIDMap.PID_PAGECOUNT); 228 } 229 230 231 232 238 public int getWordCount() 239 { 240 return getPropertyIntValue(PropertyIDMap.PID_WORDCOUNT); 241 } 242 243 244 245 251 public int getCharCount() 252 { 253 return getPropertyIntValue(PropertyIDMap.PID_CHARCOUNT); 254 } 255 256 257 258 270 public byte[] getThumbnail() 271 { 272 return (byte[]) getProperty(PropertyIDMap.PID_THUMBNAIL); 273 } 274 275 276 277 283 public String getApplicationName() 284 { 285 return (String ) getProperty(PropertyIDMap.PID_APPNAME); 286 } 287 288 289 290 322 public int getSecurity() 323 { 324 return getPropertyIntValue(PropertyIDMap.PID_SECURITY); 325 } 326 327 } 328 | Popular Tags |