You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2017/06/29 08:45:01 UTC

svn commit: r1800254 - in /poi/trunk/src/ooxml: java/org/apache/poi/POIXMLDocument.java testcases/org/apache/poi/TestDetectAsOOXML.java

Author: fanningpj
Date: Thu Jun 29 08:45:00 2017
New Revision: 1800254

URL: http://svn.apache.org/viewvc?rev=1800254&view=rev
Log:
remove deprecated POIXMLDocument.hasOOXMLHeader

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/POIXMLDocument.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/TestDetectAsOOXML.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/POIXMLDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/POIXMLDocument.java?rev=1800254&r1=1800253&r2=1800254&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/POIXMLDocument.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/POIXMLDocument.java Thu Jun 29 08:45:00 2017
@@ -135,26 +135,6 @@ public abstract class POIXMLDocument ext
     }
 
     /**
-     * Checks that the supplied InputStream (which MUST
-     *  support mark and reset, or be a PushbackInputStream)
-     *  has a OOXML (zip) header at the start of it.
-     * If your InputStream does not support mark / reset,
-     *  then wrap it in a PushBackInputStream, then be
-     *  sure to always use that, and not the original!
-     *  
-     * @param inp An InputStream which supports either mark/reset, or is a PushbackInputStream
-     * @return true, if the InputStream is an ooxml document
-     * 
-     * @throws IOException if the InputStream can't be read
-     *
-     * @deprecated use the method from DocumentFactoryHelper, deprecated as of 3.15-beta1, therefore eligible for removal in 3.17
-     */
-    @Deprecated
-    public static boolean hasOOXMLHeader(InputStream inp) throws IOException {
-        return DocumentFactoryHelper.hasOOXMLHeader(inp);
-    }
-
-    /**
      * Get the document properties. This gives you access to the
      *  core ooxml properties, and the extended ooxml properties.
      *  

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/TestDetectAsOOXML.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/TestDetectAsOOXML.java?rev=1800254&r1=1800253&r2=1800254&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/TestDetectAsOOXML.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/TestDetectAsOOXML.java Thu Jun 29 08:45:00 2017
@@ -75,13 +75,12 @@ public class TestDetectAsOOXML extends T
         // detect header
         InputStream in = new PushbackInputStream(testInput, 10);
         assertFalse(DocumentFactoryHelper.hasOOXMLHeader(in));
-		//noinspection deprecation
-		assertFalse(POIXMLDocument.hasOOXMLHeader(in));
         
         // check if InputStream is still intact
         byte[] test = new byte[3];
         assertEquals(3, in.read(test));
         assertTrue(Arrays.equals(testData, test));
         assertEquals(-1, in.read());
+        in.close();
 	}
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org