super(fs);
}
+ /**
+ * Note - writing is not yet supported for this file format, sorry.
+ */
// @Override
// public void write() throws IOException {
// throw new IllegalStateException("Writing is not yet implemented for this Document Format");
// }
+ /**
+ * Note - writing is not yet supported for this file format, sorry.
+ */
// @Override
// public void write(File file) throws IOException {
// throw new IllegalStateException("Writing is not yet implemented for this Document Format");
// }
+ /**
+ * Note - writing is not yet supported for this file format, sorry.
+ */
@Override
public void write(OutputStream out) throws IOException {
throw new IllegalStateException("Writing is not yet implemented for this Document Format");
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-import java.io.OutputStream;
-import org.apache.poi.POIDocument;
+import org.apache.poi.POIReadOnlyDocument;
import org.apache.poi.hdgf.chunks.ChunkFactory;
import org.apache.poi.hdgf.pointers.Pointer;
import org.apache.poi.hdgf.pointers.PointerFactory;
* http://www.gnome.ru/projects/docs/slide1.png
* http://www.gnome.ru/projects/docs/slide2.png
*/
-public final class HDGFDiagram extends POIDocument {
+public final class HDGFDiagram extends POIReadOnlyDocument {
private static final String VISIO_HEADER = "Visio (TM) Drawing\r\n";
private byte[] _docstream;
}
}
- public void write(OutputStream out) {
- throw new IllegalStateException("Writing is not yet implemented, see http://poi.apache.org/hdgf/");
- }
-
/**
* For testing only
*/
NPOIFSFileSystem pfs = new NPOIFSFileSystem(new File(args[0]));
HDGFDiagram hdgf = new HDGFDiagram(pfs);
hdgf.debug();
+ hdgf.close();
pfs.close();
}
}
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.apache.poi.POIDocument;
+import org.apache.poi.POIReadOnlyDocument;
import org.apache.poi.hmef.attribute.MAPIRtfAttribute;
import org.apache.poi.hsmf.datatypes.AttachmentChunks;
import org.apache.poi.hsmf.datatypes.AttachmentChunks.AttachmentChunksSorter;
*
* [MS-OXCMSG]: Message and Attachment Object Protocol Specification
*/
-public class MAPIMessage extends POIDocument {
+public class MAPIMessage extends POIReadOnlyDocument {
/** For logging problems we spot with the file */
private POILogger logger = POILogFactory.getLogger(MAPIMessage.class);
}
- /**
- * Note - not yet supported, sorry.
- */
- public void write(OutputStream out) throws IOException {
- throw new UnsupportedOperationException("Writing isn't yet supported for HSMF, sorry");
- }
-
-
/**
* Will you get a null on a missing chunk, or a
* {@link ChunkNotFoundException} (default is the