mirror of https://github.com/apache/poi.git
remove deprecated POIXMLDocument.hasOOXMLHeader
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800254 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6b4d045b20
commit
9d425b8706
|
@ -134,26 +134,6 @@ public abstract class POIXMLDocument extends POIXMLDocumentPart implements Close
|
||||||
return parts;
|
return parts;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 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
|
* Get the document properties. This gives you access to the
|
||||||
* core ooxml properties, and the extended ooxml properties.
|
* core ooxml properties, and the extended ooxml properties.
|
||||||
|
|
|
@ -75,13 +75,12 @@ public class TestDetectAsOOXML extends TestCase
|
||||||
// detect header
|
// detect header
|
||||||
InputStream in = new PushbackInputStream(testInput, 10);
|
InputStream in = new PushbackInputStream(testInput, 10);
|
||||||
assertFalse(DocumentFactoryHelper.hasOOXMLHeader(in));
|
assertFalse(DocumentFactoryHelper.hasOOXMLHeader(in));
|
||||||
//noinspection deprecation
|
|
||||||
assertFalse(POIXMLDocument.hasOOXMLHeader(in));
|
|
||||||
|
|
||||||
// check if InputStream is still intact
|
// check if InputStream is still intact
|
||||||
byte[] test = new byte[3];
|
byte[] test = new byte[3];
|
||||||
assertEquals(3, in.read(test));
|
assertEquals(3, in.read(test));
|
||||||
assertTrue(Arrays.equals(testData, test));
|
assertTrue(Arrays.equals(testData, test));
|
||||||
assertEquals(-1, in.read());
|
assertEquals(-1, in.read());
|
||||||
|
in.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue