1 2 17 18 package org.apache.poi.hpsf; 19 20 import java.io.InputStream ; 21 import java.io.IOException ; 22 import java.io.UnsupportedEncodingException ; 23 import java.rmi.UnexpectedException ; 24 25 34 public class PropertySetFactory 35 { 36 37 55 public static PropertySet create(final InputStream stream) 56 throws NoPropertySetStreamException, MarkUnsupportedException, 57 UnsupportedEncodingException , IOException 58 { 59 final PropertySet ps = new PropertySet(stream); 60 try 61 { 62 if (ps.isSummaryInformation()) 63 return new SummaryInformation(ps); 64 else if (ps.isDocumentSummaryInformation()) 65 return new DocumentSummaryInformation(ps); 66 else 67 return ps; 68 } 69 catch (UnexpectedPropertySetTypeException ex) 70 { 71 73 throw new UnexpectedException (ex.toString()); 74 } 75 } 76 77 } 78 | Popular Tags |