/**
* @return the filesystem that this belongs to
- * TODO Temporary workaround during #56791
*/
- public POIFSFileSystem getFileSystem()
+ public NPOIFSFileSystem getFileSystem()
{
- return (POIFSFileSystem)_ofilesystem;
+ return _nfilesystem;
}
/**
+ * If this is OPOIFS based, return the NPOIFSFileSystem
+ * that this belong to, otherwise Null if NPOIFS based
* @return the filesystem that this belongs to
*/
public OPOIFSFileSystem getOFileSystem()
}
/**
+ * If this is NPOIFS based, return the NPOIFSFileSystem
+ * that this belong to, otherwise Null if OPOIFS based
* @return the filesystem that this belongs to
*/
public NPOIFSFileSystem getNFileSystem()
*/
public class POIFSFileSystem
- extends OPOIFSFileSystem // TODO Temporary workaround during #56791
+ extends NPOIFSFileSystem // TODO Temporary workaround during #56791
implements POIFSViewable
{
/**
* @param inp An InputStream which supports either mark/reset, or is a PushbackInputStream
*/
public static boolean hasPOIFSHeader(InputStream inp) throws IOException {
- return OPOIFSFileSystem.hasPOIFSHeader(inp);
+ return NPOIFSFileSystem.hasPOIFSHeader(inp);
}
/**
* Checks if the supplied first 8 bytes of a stream / file
* has a POIFS (OLE2) header.
*/
public static boolean hasPOIFSHeader(byte[] header8Bytes) {
- return OPOIFSFileSystem.hasPOIFSHeader(header8Bytes);
+ return NPOIFSFileSystem.hasPOIFSHeader(header8Bytes);
}
/**
/**
* Class to test DocumentInputStream functionality
- *
- * @author Marc Johnson
*/
-
public final class TestDocumentInputStream extends TestCase {
private DocumentNode _workbook_n;
private DocumentNode _workbook_o;
* test constructor
*/
public void testConstructor() throws IOException {
- DocumentInputStream ostream = new DocumentInputStream(_workbook_o);
+ DocumentInputStream ostream = new ODocumentInputStream(_workbook_o);
DocumentInputStream nstream = new NDocumentInputStream(_workbook_n);
assertEquals(_workbook_size, _workbook_o.getSize());
assertEquals(_workbook_size, ostream.available());
assertEquals(_workbook_size, nstream.available());
+
+ ostream.close();
+ nstream.close();
}
/**
NPOIFSFileSystem npoifs = new NPOIFSFileSystem(sample);
try {
- POIFSFileSystem opoifs = new POIFSFileSystem(new FileInputStream(sample));
+ OPOIFSFileSystem opoifs = new OPOIFSFileSystem(new FileInputStream(sample));
// Ensure we have what we expect on the root
assertEquals(npoifs, npoifs.getRoot().getNFileSystem());
- assertEquals(null, npoifs.getRoot().getFileSystem());
- assertEquals(opoifs, opoifs.getRoot().getFileSystem());
+ assertEquals(npoifs, npoifs.getRoot().getFileSystem());
+ assertEquals(null, npoifs.getRoot().getOFileSystem());
+ assertEquals(null, opoifs.getRoot().getFileSystem());
+ assertEquals(opoifs, opoifs.getRoot().getOFileSystem());
assertEquals(null, opoifs.getRoot().getNFileSystem());
// Check inside