aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2016-07-20 22:18:25 +0000
committerNick Burch <nick@apache.org>2016-07-20 22:18:25 +0000
commit667cfcb196f7cbad1771d1f7b5295a4529f54569 (patch)
treee3b5cb423831b62c01d95357ef1e9ae3d4a132a2
parent6bbdfeb61d489a534e4844a874d7f1c9d406ea06 (diff)
downloadpoi-667cfcb196f7cbad1771d1f7b5295a4529f54569.tar.gz
poi-667cfcb196f7cbad1771d1f7b5295a4529f54569.zip
Mark some more scratchpad document types as currently being read-only
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1753618 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/scratchpad/src/org/apache/poi/POIReadOnlyDocument.java9
-rw-r--r--src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java10
-rw-r--r--src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java13
3 files changed, 14 insertions, 18 deletions
diff --git a/src/scratchpad/src/org/apache/poi/POIReadOnlyDocument.java b/src/scratchpad/src/org/apache/poi/POIReadOnlyDocument.java
index 27ba446a22..7a5d1fd491 100644
--- a/src/scratchpad/src/org/apache/poi/POIReadOnlyDocument.java
+++ b/src/scratchpad/src/org/apache/poi/POIReadOnlyDocument.java
@@ -44,14 +44,23 @@ public abstract class POIReadOnlyDocument extends POIDocument {
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");
diff --git a/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java b/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java
index ea351081e8..c85278882e 100644
--- a/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java
+++ b/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java
@@ -20,9 +20,8 @@ package org.apache.poi.hdgf;
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;
@@ -44,7 +43,7 @@ import org.apache.poi.util.LocaleUtil;
* 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;
@@ -156,10 +155,6 @@ public final class HDGFDiagram extends POIDocument {
}
}
- public void write(OutputStream out) {
- throw new IllegalStateException("Writing is not yet implemented, see http://poi.apache.org/hdgf/");
- }
-
/**
* For testing only
*/
@@ -167,6 +162,7 @@ public final class HDGFDiagram extends POIDocument {
NPOIFSFileSystem pfs = new NPOIFSFileSystem(new File(args[0]));
HDGFDiagram hdgf = new HDGFDiagram(pfs);
hdgf.debug();
+ hdgf.close();
pfs.close();
}
}
diff --git a/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java b/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java
index 33a8f675f9..a1bf16264a 100644
--- a/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java
+++ b/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java
@@ -20,7 +20,6 @@ package org.apache.poi.hsmf;
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;
@@ -29,7 +28,7 @@ import java.util.List;
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;
@@ -63,7 +62,7 @@ import org.apache.poi.util.POILogger;
*
* [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);
@@ -604,14 +603,6 @@ public class MAPIMessage extends POIDocument {
/**
- * 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
* exception).