You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ni...@apache.org on 2016/07/20 22:18:26 UTC
svn commit: r1753618 - in /poi/trunk/src/scratchpad/src/org/apache/poi:
POIReadOnlyDocument.java hdgf/HDGFDiagram.java hsmf/MAPIMessage.java
Author: nick
Date: Wed Jul 20 22:18:25 2016
New Revision: 1753618
URL: http://svn.apache.org/viewvc?rev=1753618&view=rev
Log:
Mark some more scratchpad document types as currently being read-only
Modified:
poi/trunk/src/scratchpad/src/org/apache/poi/POIReadOnlyDocument.java
poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java
poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/POIReadOnlyDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/POIReadOnlyDocument.java?rev=1753618&r1=1753617&r2=1753618&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/POIReadOnlyDocument.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/POIReadOnlyDocument.java Wed Jul 20 22:18:25 2016
@@ -44,14 +44,23 @@ public abstract class POIReadOnlyDocumen
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");
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java?rev=1753618&r1=1753617&r2=1753618&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java Wed Jul 20 22:18:25 2016
@@ -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 P
}
}
- 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 P
NPOIFSFileSystem pfs = new NPOIFSFileSystem(new File(args[0]));
HDGFDiagram hdgf = new HDGFDiagram(pfs);
hdgf.debug();
+ hdgf.close();
pfs.close();
}
}
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java?rev=1753618&r1=1753617&r2=1753618&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java Wed Jul 20 22:18:25 2016
@@ -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);
@@ -603,14 +602,6 @@ public class MAPIMessage extends POIDocu
}
- /**
- * 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
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org