/**
* Writes out the updated standard Document Information Properties (HPSF)
- * into the currently open NPOIFSFileSystem
+ * into the currently open POIFSFileSystem
*
* @throws IOException if an error when writing to the open
* {@link POIFSFileSystem} occurs
}
/**
* Writes out the standard Document Information Properties (HPSF)
- * @param outFS the NPOIFSFileSystem to write the properties into
+ * @param outFS the {@link POIFSFileSystem} to write the properties into
* @param writtenEntries a list of POIFS entries to add the property names too
*
* @throws IOException if an error when writing to the
*
* @param name the (POIFS Level) name of the property to write
* @param set the PropertySet to write out
- * @param outFS the NPOIFSFileSystem to write the property into
+ * @param outFS the {@link POIFSFileSystem} to write the property into
*
* @throws IOException if an error when writing to the
* {@link POIFSFileSystem} occurs
* @see #HSSFWorkbook(POIFSFileSystem)
* @exception IOException if the stream cannot be read
*/
- @SuppressWarnings("resource") // NPOIFSFileSystem always closes the stream
+ @SuppressWarnings("resource") // POIFSFileSystem always closes the stream
public HSSFWorkbook(InputStream s, boolean preserveNodes)
throws IOException
{
}
/**
- * Creates a HSSFWorkbook from the given NPOIFSFileSystem<p>
+ * Creates a HSSFWorkbook from the given {@link POIFSFileSystem}<p>
* Note that in order to properly release resources the
* Workbook should be closed after use.
*/
}
/**
- * Read from a NPOIFSFileSystem and process the documents we get
+ * Read from a {@link POIFSFileSystem} and process the documents we get
*
- * @param poifs the NPOIFSFileSystem from which to read the data
+ * @param poifs the POIFSFileSystem from which to read the data
*
* @exception IOException on errors reading, or on invalid data
*/
// Our list of entries, kept sorted to preserve order
private final ArrayList<Entry> _entries = new ArrayList<>();
- // the NPOIFSFileSytem we belong to
- private final POIFSFileSystem _nfilesystem;
+ // the POIFSFileSystem we belong to
+ private final POIFSFileSystem _filesystem;
// the path described by this document
private final POIFSDocumentPath _path;
* is intended strictly for the internal use of this package
*
* @param property the DirectoryProperty for this DirectoryEntry
- * @param nfilesystem the NPOIFSFileSystem we belong to
+ * @param filesystem the {@link POIFSFileSystem} we belong to
* @param parent the parent of this entry
*/
DirectoryNode(final DirectoryProperty property,
- final POIFSFileSystem nfilesystem,
+ final POIFSFileSystem filesystem,
final DirectoryNode parent)
{
super(property, parent);
- this._nfilesystem = nfilesystem;
+ this._filesystem = filesystem;
if (parent == null)
{
if (child.isDirectory())
{
DirectoryProperty childDir = (DirectoryProperty) child;
- childNode = new DirectoryNode(childDir, _nfilesystem, this);
+ childNode = new DirectoryNode(childDir, _filesystem, this);
}
else
{
*/
public POIFSFileSystem getFileSystem()
{
- return _nfilesystem;
+ return _filesystem;
}
/**
DocumentNode rval = new DocumentNode(property, this);
(( DirectoryProperty ) getProperty()).addChild(property);
- _nfilesystem.addDocument(document);
+ _filesystem.addDocument(document);
_entries.add(rval);
_byname.put(property.getName(), rval);
_byname.remove(entry.getName());
try {
- _nfilesystem.remove(entry);
+ _filesystem.remove(entry);
} catch (IOException e) {
// TODO Work out how to report this, given we can't change the method signature...
throw new RuntimeException(e);
final InputStream stream)
throws IOException
{
- return createDocument(new POIFSDocument(name, _nfilesystem, stream));
+ return createDocument(new POIFSDocument(name, _filesystem, stream));
}
/**
final POIFSWriterListener writer)
throws IOException
{
- return createDocument(new POIFSDocument(name, size, _nfilesystem, writer));
+ return createDocument(new POIFSDocument(name, size, _filesystem, writer));
}
/**
{
DirectoryProperty property = new DirectoryProperty(name);
- DirectoryNode rval = new DirectoryNode(property, _nfilesystem, this);
- _nfilesystem.addDirectory(property);
+ DirectoryNode rval = new DirectoryNode(property, _filesystem, this);
+ _filesystem.addDirectory(property);
(( DirectoryProperty ) getProperty()).addChild(property);
_entries.add(rval);
}
/**
- * Wrap the OLE2 data in the NPOIFSFileSystem into a decrypted stream by using
+ * Wrap the OLE2 data in the {@link POIFSFileSystem} into a decrypted stream by using
* the given password.
*
* @param fs The OLE2 stream for the document
*/
public static InputStream getDecryptedStream(final POIFSFileSystem fs, String password)
throws IOException {
- // wrap the stream in a FilterInputStream to close the NPOIFSFileSystem
+ // wrap the stream in a FilterInputStream to close the POIFSFileSystem
// as well when the resulting OPCPackage is closed
return new FilterInputStream(getDecryptedStream(fs.getRoot(), password)) {
@Override
while ((zipEntry = zis.getNextEntry()) != null) {
if (endsWithIgnoreCase(zipEntry.getName(), VBA_PROJECT_OOXML)) {
try {
- // Make a NPOIFS from the contents, and close the stream
+ // Make a POIFSFileSystem from the contents, and close the stream
this.fs = new POIFSFileSystem(zis);
return;
} catch (IOException e) {
public class SlideShowFactory {
/**
- * Creates a SlideShow from the given NPOIFSFileSystem.
+ * Creates a SlideShow from the given POIFSFileSystem.
*
* @param fs The {@link POIFSFileSystem} to read the document from
*
}
/**
- * Creates a SlideShow from the given NPOIFSFileSystem, which may
+ * Creates a SlideShow from the given POIFSFileSystem, which may
* be password protected
*
* @param fs The {@link POIFSFileSystem} to read the document from
}
/**
- * Creates a SlideShow from the given NPOIFSFileSystem.
+ * Creates a SlideShow from the given DirectoryNode.
*
* @param root The {@link DirectoryNode} to start reading the document from
*
/**
- * Creates a SlideShow from the given NPOIFSFileSystem, which may
+ * Creates a SlideShow from the given DirectoryNode, which may
* be password protected
*
* @param root The {@link DirectoryNode} to start reading the document from
}
/**
- * Creates a HSSFWorkbook from the given NPOIFSFileSystem<p>
+ * Creates a HSSFWorkbook from the given POIFSFileSystem<p>
*
* Note that in order to properly release resources the
* Workbook should be closed after use.
}
/**
- * Creates a Workbook from the given NPOIFSFileSystem, which may
+ * Creates a Workbook from the given POIFSFileSystem, which may
* be password protected
*
* @param fs The {@link POIFSFileSystem} to read the document from
/**
- * Creates a Workbook from the given NPOIFSFileSystem.
+ * Creates a Workbook from the given DirectoryNode.
*
* @param root The {@link DirectoryNode} to start reading the document from
*
/**
- * Creates a Workbook from the given NPOIFSFileSystem, which may
+ * Creates a Workbook from the given DirectoryNode, which may
* be password protected
*
* @param root The {@link DirectoryNode} to start reading the document from
} finally {
IOUtils.closeQuietly(is);
- // also close the NPOIFSFileSystem here as we read all the data
+ // also close the POIFSFileSystem here as we read all the data
// while decrypting
fs.close();
}
@Test
public void bug55692_stream() throws IOException {
- // Directly on a Stream, will go via NPOIFS and spot it's
+ // Directly on a Stream, will go via POIFS and spot it's
// actually a .xlsx file encrypted with the default password, and open
Workbook wb = WorkbookFactory.create(
POIDataSamples.getPOIFSInstance().openResourceAsStream("protect.xlsx"));
}
@Test
- public void bug55692_npoifs() throws IOException {
- // Via a NPOIFSFileSystem, will spot it's actually a .xlsx file
+ public void bug55692_poifs2() throws IOException {
+ // Via a POIFSFileSystem, will spot it's actually a .xlsx file
// encrypted with the default password, and open
POIFSFileSystem fsNP = new POIFSFileSystem(
POIDataSamples.getPOIFSInstance().openResourceAsStream("protect.xlsx"));
/**
* Creates a PowerPointExtractor, from a specific place
- * inside an open NPOIFSFileSystem
+ * inside an open {@link POIFSFileSystem}
*
* @param dir the POIFS Directory containing the PowerPoint document
*/
* Constructs a Powerpoint document from an POIFSFileSystem.
*/
@SuppressWarnings("resource")
- public HSLFSlideShow(POIFSFileSystem npoifs) throws IOException {
- this(new HSLFSlideShowImpl(npoifs));
+ public HSLFSlideShow(POIFSFileSystem poifs) throws IOException {
+ this(new HSLFSlideShowImpl(poifs));
}
/**
@Internal
public class HSLFSlideShowFactory extends SlideShowFactory {
/**
- * Creates a HSLFSlideShow from the given NPOIFSFileSystem<p>
+ * Creates a HSLFSlideShow from the given {@link POIFSFileSystem}<p>
* Note that in order to properly release resources the
* SlideShow should be closed after use.
*/
// And with NPOIFS
sample = _samples.openResourceAsStream("Sample.pub");
POIFSFileSystem fs = new POIFSFileSystem(sample);
- HPBFDocument docNPOIFS = new HPBFDocument(fs);
- ext = new PublisherTextExtractor(docNPOIFS);
+ HPBFDocument docPOIFS = new HPBFDocument(fs);
+ ext = new PublisherTextExtractor(docPOIFS);
assertEquals(SAMPLE_TEXT, ext.getText());
ext.close();
- docNPOIFS.close();
+ docPOIFS.close();
fs.close();
sample.close();
public void testDifferentPOIFS() throws IOException {
// Open the two filesystems
File pptFile = slTests.getFile("basic_test_ppt_file.ppt");
- try (final POIFSFileSystem npoifs = new POIFSFileSystem(pptFile, true)) {
+ try (final POIFSFileSystem poifs = new POIFSFileSystem(pptFile, true)) {
// Open directly
- try (SlideShow<?,?> ppt = SlideShowFactory.create(npoifs.getRoot());
+ try (SlideShow<?,?> ppt = SlideShowFactory.create(poifs.getRoot());
SlideShowExtractor<?,?> extractor = new SlideShowExtractor<>(ppt)) {
assertEquals(EXPECTED_PAGE1+EXPECTED_PAGE2, extractor.getText());
}
//It isn't pretty, but it works...
private Map<String, String> getMacrosFromHSLF(String fileName) throws IOException {
InputStream is = null;
- POIFSFileSystem npoifs = null;
+ POIFSFileSystem poifs = null;
try {
is = new FileInputStream(POIDataSamples.getSlideShowInstance().getFile(fileName));
- npoifs = new POIFSFileSystem(is);
- //TODO: should we run the VBAMacroReader on this npoifs?
+ poifs = new POIFSFileSystem(is);
+ //TODO: should we run the VBAMacroReader on this poifs?
//TBD: We know that ppt typically don't store macros in the regular place,
//but _can_ they?
- HSLFSlideShow ppt = new HSLFSlideShow(npoifs);
+ HSLFSlideShow ppt = new HSLFSlideShow(poifs);
//get macro persist id
DocInfoListContainer list = (DocInfoListContainer)ppt.getDocumentRecord().findFirstOfType(RecordTypes.List.typeID);
ppt.close();
} finally {
- IOUtils.closeQuietly(npoifs);
+ IOUtils.closeQuietly(poifs);
IOUtils.closeQuietly(is);
}
return null;
public void testDifferentPOIFS() throws Exception {
// Open the two filesystems
File file = docTests.getFile("test2.doc");
- try (POIFSFileSystem npoifs = new POIFSFileSystem(file, true)) {
+ try (POIFSFileSystem poifs = new POIFSFileSystem(file, true)) {
- DirectoryNode dir = npoifs.getRoot();
+ DirectoryNode dir = poifs.getRoot();
// Open directly
@SuppressWarnings("resource")
}
/**
- * [RESOLVED FIXED] Bug 51671 - HWPFDocument.write based on NPOIFSFileSystem
+ * [RESOLVED FIXED] Bug 51671 - HWPFDocument.write based on POIFSFileSystem
* throws a NullPointerException
*/
@Test
{
InputStream is = POIDataSamples.getDocumentInstance()
.openResourceAsStream("empty.doc");
- try (POIFSFileSystem npoifsFileSystem = new POIFSFileSystem(is)) {
+ try (POIFSFileSystem poifsFileSystem = new POIFSFileSystem(is)) {
HWPFDocument hwpfDocument = new HWPFDocument(
- npoifsFileSystem.getRoot());
+ poifsFileSystem.getRoot());
hwpfDocument.write(new ByteArrayOutputStream());
hwpfDocument.close();
}
}
@Test(expected=IllegalStateException.class)
- public void testInvalidInPlaceWriteNPOIFS() throws Exception {
+ public void testInvalidInPlaceWritePOIFS() throws Exception {
// Can't work for Read-Only files
POIFSFileSystem fs = new POIFSFileSystem(SAMPLES.getFile("SampleDoc.doc"), true);
HWPFDocument doc = new HWPFDocument(fs.getRoot());
}
/**
- * Tests that when using NPOIFS, we can do an in-place write
+ * Tests that when using POIFS, we can do an in-place write
* without needing to stream in + out the whole kitchen sink
*/
@Test
- public void inPlaceNPOIFSWrite() throws Exception {
+ public void inPlacePOIFSWrite() throws Exception {
// We need to work on a File for in-place changes, so create a temp one
final File copy = TempFile.createTempFile("Test-HPSF", "ole2");
copy.deleteOnExit();
@Test
public void test61300Extractor() throws IOException {
- try (POIFSFileSystem npoifs = new POIFSFileSystem(
+ try (POIFSFileSystem poifs = new POIFSFileSystem(
POIDataSamples.getPOIFSInstance().getFile("61300.bin"))) {
- HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(npoifs);
+ HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(poifs);
assertContains(ext.getText(), "PID_CODEPAGE = 1252");
}
}
}
@Test
- public void testNPOIFSFileSystem() throws IOException {
+ public void testPOIFSFileSystem() throws IOException {
File file = HSSFTestDataSamples.getSampleFile("FormulaRefs.xls");
try (POIFSFileSystem fs = new POIFSFileSystem(file)) {
OldExcelExtractor extractor = new OldExcelExtractor(fs);
* File with exactly 256 data blocks (+header block)
* shouldn't break on POIFS loading
*/
- @SuppressWarnings("resource")
@Test
public void bug51461() throws Exception {
byte[] data = HSSFITestDataProvider.instance.getTestDataFileContent("51461.xls");
HSSFWorkbook wbPOIFS = new HSSFWorkbook(new POIFSFileSystem(
new ByteArrayInputStream(data)).getRoot(), false);
- HSSFWorkbook wbNPOIFS = new HSSFWorkbook(new POIFSFileSystem(
+ HSSFWorkbook wbPOIFS2 = new HSSFWorkbook(new POIFSFileSystem(
new ByteArrayInputStream(data)).getRoot(), false);
assertEquals(2, wbPOIFS.getNumberOfSheets());
- assertEquals(2, wbNPOIFS.getNumberOfSheets());
+ assertEquals(2, wbPOIFS2.getNumberOfSheets());
}
- /**
- * Large row numbers and NPOIFS vs POIFS
- */
- @SuppressWarnings("resource")
@Test
public void bug51535() throws Exception {
byte[] data = HSSFITestDataProvider.instance.getTestDataFileContent("51535.xls");
HSSFWorkbook wbPOIFS = new HSSFWorkbook(new POIFSFileSystem(
new ByteArrayInputStream(data)).getRoot(), false);
- HSSFWorkbook wbNPOIFS = new HSSFWorkbook(new POIFSFileSystem(
+ HSSFWorkbook wbPOIFS2 = new HSSFWorkbook(new POIFSFileSystem(
new ByteArrayInputStream(data)).getRoot(), false);
- for (HSSFWorkbook wb : new HSSFWorkbook[]{wbPOIFS, wbNPOIFS}) {
+ for (HSSFWorkbook wb : new HSSFWorkbook[]{wbPOIFS, wbPOIFS2}) {
assertEquals(3, wb.getNumberOfSheets());
// Check directly
@Test(expected = RuntimeException.class)
public void test61300() throws Exception {
- POIFSFileSystem npoifs = new POIFSFileSystem(HSSFTestDataSamples.openSampleFileStream("61300.xls"));
+ POIFSFileSystem poifs = new POIFSFileSystem(HSSFTestDataSamples.openSampleFileStream("61300.xls"));
DocumentEntry entry =
- (DocumentEntry) npoifs.getRoot().getEntry(SummaryInformation.DEFAULT_STREAM_NAME);
+ (DocumentEntry) poifs.getRoot().getEntry(SummaryInformation.DEFAULT_STREAM_NAME);
// this will throw an Exception "RuntimeException: Can't read negative number of bytes"
new PropertySet(new DocumentInputStream(entry));
DirectoryNode[] files = new DirectoryNode[2];
try (POIFSFileSystem poifsFileSystem = new POIFSFileSystem(HSSFTestDataSamples.openSampleFileStream("Simple.xls"))) {
files[0] = poifsFileSystem.getRoot();
- try (POIFSFileSystem npoifsFileSystem = new POIFSFileSystem(HSSFTestDataSamples.getSampleFile("Simple.xls"))) {
- files[1] = npoifsFileSystem.getRoot();
+ try (POIFSFileSystem poifsFileSystem2 = new POIFSFileSystem(HSSFTestDataSamples.getSampleFile("Simple.xls"))) {
+ files[1] = poifsFileSystem2.getRoot();
// Open without preserving nodes
for (DirectoryNode dir : files) {
DirectoryNode[] files = new DirectoryNode[2];
try (POIFSFileSystem poifsFileSystem = new POIFSFileSystem(HSSFTestDataSamples.openSampleFileStream("WithEmbeddedObjects.xls"))) {
files[0] = poifsFileSystem.getRoot();
- try (POIFSFileSystem npoifsFileSystem = new POIFSFileSystem(HSSFTestDataSamples.getSampleFile("WithEmbeddedObjects.xls"))) {
- files[1] = npoifsFileSystem.getRoot();
+ try (POIFSFileSystem poifsFileSystem2 = new POIFSFileSystem(HSSFTestDataSamples.getSampleFile("WithEmbeddedObjects.xls"))) {
+ files[1] = poifsFileSystem2.getRoot();
// Check the embedded parts
for (DirectoryNode root : files) {
}
/**
- * Checks that we can open a workbook with NPOIFS, and write it out
+ * Checks that we can open a workbook with POIFS, and write it out
* again (via POIFS) and have it be valid
*/
@Test
- public void writeWorkbookFromNPOIFS() throws IOException {
+ public void writeWorkbookFromPOIFS() throws IOException {
try (InputStream is = HSSFTestDataSamples.openSampleFileStream("WithEmbeddedObjects.xls");
- POIFSFileSystem fs = new POIFSFileSystem(is)) {
- // Start as NPOIFS
+ POIFSFileSystem fs = new POIFSFileSystem(is)) {
+
HSSFWorkbook wb = new HSSFWorkbook(fs.getRoot(), true);
assertEquals(3, wb.getNumberOfSheets());
assertEquals("Root xls", wb.getSheetAt(0).getRow(0).getCell(0).getStringCellValue());
- // Will switch to POIFS
HSSFWorkbook wbBack = HSSFTestDataSamples.writeOutAndReadBack(wb);
assertEquals(3, wbBack.getNumberOfSheets());
assertEquals("Root xls", wbBack.getSheetAt(0).getRow(0).getCell(0).getStringCellValue());
final File file = POIDataSamples.getSpreadSheetInstance().getFile(filename);
Workbook wb;
- // File via POIFileStream (java.io)
- wb = new HSSFWorkbook(new POIFSFileSystem(file));
- assertCloseDoesNotModifyFile(filename, wb);
-
- // File via NPOIFileStream (java.nio)
+ // File via POIFileStream (java.nio)
wb = new HSSFWorkbook(new POIFSFileSystem(file));
assertCloseDoesNotModifyFile(filename, wb);
* Integration test -- really about all we can do
*/
@Test
- public void testNPOIFSDocument() throws IOException {
+ public void testPOIFSDocument() throws IOException {
try (POIFSFileSystem poifs = new POIFSFileSystem()) {
_workbook_data[j] = (byte) (j * j);
}
- // Now create the NPOIFS Version
+ // Now create the POIFS Version
byte[] _workbook_data_only = new byte[_workbook_size];
System.arraycopy(_workbook_data, 0, _workbook_data_only, 0, _workbook_size);
- POIFSFileSystem npoifs = new POIFSFileSystem();
+ POIFSFileSystem poifs = new POIFSFileSystem();
// Make it easy when debugging to see what isn't the doc
byte[] minus1 = new byte[512];
Arrays.fill(minus1, (byte) -1);
- npoifs.getBlockAt(-1).put(minus1);
- npoifs.getBlockAt(0).put(minus1);
- npoifs.getBlockAt(1).put(minus1);
+ poifs.getBlockAt(-1).put(minus1);
+ poifs.getBlockAt(0).put(minus1);
+ poifs.getBlockAt(1).put(minus1);
- // Create the NPOIFS document
- _workbook_n = (DocumentNode) npoifs.createDocument(
+ // Create the POIFS document
+ _workbook_n = (DocumentNode) poifs.createDocument(
new ByteArrayInputStream(_workbook_data_only),
"Workbook"
);
DocumentInputStream stream;
- try (POIFSFileSystem npoifs = new POIFSFileSystem(sample)) {
+ try (POIFSFileSystem poifs = new POIFSFileSystem(sample)) {
// Ensure we have what we expect on the root
- assertEquals(npoifs, npoifs.getRoot().getFileSystem());
+ assertEquals(poifs, poifs.getRoot().getFileSystem());
// Check inside
- DirectoryNode root = npoifs.getRoot();
+ DirectoryNode root = poifs.getRoot();
// Top Level
Entry top = root.getEntry("Contents");
assertTrue(top.isDocumentEntry());
assertTrue(EntryUtils.areDocumentsIdentical(entryA1, entryB1));
- // Can work with NPOIFS + POIFS
+ // Can work with POIFS
ByteArrayOutputStream tmpO = new ByteArrayOutputStream();
fs.writeFilesystem(tmpO);
import org.junit.Test;
/**
- * Tests bugs across both POIFSFileSystem and NPOIFSFileSystem
+ * Tests bugs for POIFSFileSystem
*/
public final class TestFileSystemBugs {
private static POIDataSamples _samples = POIDataSamples.getPOIFSInstance();
* Ensure that a file with a corrupted property in the
* properties table can still be loaded, and the remaining
* properties used
- * Note - only works for NPOIFSFileSystem, POIFSFileSystem
+ * Note - only works for POIFSFileSystem
* can't cope with this level of corruption
*/
@Test
}
/**
- * Test that we can read a file with NPOIFS, create a new NPOIFS instance,
+ * Test that we can read a file with POIFS, create a new POIFS instance,
* write it out, read it with POIFS, and see the original data
*/
@Test
- public void NPOIFSReadCopyWritePOIFSRead() throws IOException {
+ public void POIFSReadCopyWritePOIFSRead() throws IOException {
File testFile = POIDataSamples.getSpreadSheetInstance().getFile("Simple.xls");
POIFSFileSystem src = new POIFSFileSystem(testFile);
byte[] wbDataExp = IOUtils.toByteArray(src.createDocumentInputStream("Workbook"));
fromFile(POIDataSamples.getDiagramInstance(), "SimpleMacro.vsdm");
}
- //////////////////////////////// From NPOIFS /////////////////////////////
+ //////////////////////////////// From POIFS /////////////////////////////
@Test
- public void HSSFFromNPOIFS() throws Exception {
- fromNPOIFS(POIDataSamples.getSpreadSheetInstance(), "SimpleMacro.xls");
+ public void HSSFFromPOIFS() throws Exception {
+ fromPOIFS(POIDataSamples.getSpreadSheetInstance(), "SimpleMacro.xls");
}
@Ignore("bug 59302: Found 0 macros")
@Test
- public void HSLFFromNPOIFS() throws Exception {
- fromNPOIFS(POIDataSamples.getSlideShowInstance(), "SimpleMacro.ppt");
+ public void HSLFFromPOIFS() throws Exception {
+ fromPOIFS(POIDataSamples.getSlideShowInstance(), "SimpleMacro.ppt");
}
@Test
- public void HWPFFromNPOIFS() throws Exception {
- fromNPOIFS(POIDataSamples.getDocumentInstance(), "SimpleMacro.doc");
+ public void HWPFFromPOIFS() throws Exception {
+ fromPOIFS(POIDataSamples.getDocumentInstance(), "SimpleMacro.doc");
}
@Ignore("Found 0 macros")
@Test
- public void HDGFFromNPOIFS() throws Exception {
- fromNPOIFS(POIDataSamples.getDiagramInstance(), "SimpleMacro.vsd");
+ public void HDGFFromPOIFS() throws Exception {
+ fromPOIFS(POIDataSamples.getDiagramInstance(), "SimpleMacro.vsd");
}
private void fromFile(POIDataSamples dataSamples, String filename) throws IOException {
}
}
- private void fromNPOIFS(POIDataSamples dataSamples, String filename) throws IOException {
+ private void fromPOIFS(POIDataSamples dataSamples, String filename) throws IOException {
File f = dataSamples.getFile(filename);
try (POIFSFileSystem fs = new POIFSFileSystem(f)) {
try (VBAMacroReader r = new VBAMacroReader(fs)) {
@SuppressWarnings("resource")
protected static void testFactoryFromNative(String file) throws Exception {
SlideShow<?,?> ss;
- // from NPOIFS
+ // from POIFS
if (file.endsWith(".ppt")) {
- POIFSFileSystem npoifs = new POIFSFileSystem(fromFile(file));
- ss = SlideShowFactory.create(npoifs);
+ POIFSFileSystem poifs = new POIFSFileSystem(fromFile(file));
+ ss = SlideShowFactory.create(poifs);
assertNotNull(ss);
- npoifs.close();
+ poifs.close();
assertCloseDoesNotModifyFile(file, ss);
}
// from OPCPackage
@SuppressWarnings("resource")
protected static void testFactoryFromProtectedNative(String protectedFile, String password) throws Exception {
SlideShow<?,?> ss;
- // Encryption layer is a BIFF8 binary format that can be read by NPOIFSFileSystem,
+ // Encryption layer is a BIFF8 binary format that can be read by POIFSFileSystem,
// used for both HSLF and XSLF
- // from protected NPOIFS
+ // from protected POIFS
if (protectedFile.endsWith(".ppt") || protectedFile.endsWith(".pptx")) {
- POIFSFileSystem npoifs = new POIFSFileSystem(fromFile(protectedFile));
- ss = SlideShowFactory.create(npoifs, password);
+ POIFSFileSystem poifs = new POIFSFileSystem(fromFile(protectedFile));
+ ss = SlideShowFactory.create(poifs, password);
assertNotNull(ss);
- npoifs.close();
+ poifs.close();
assertCloseDoesNotModifyFile(protectedFile, ss);
}
else {