Browse Source

Remove some remnants of NFileSystem

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1854191 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_4_1_0
Dominik Stadler 5 years ago
parent
commit
98b620889b

+ 2
- 2
src/java/org/apache/poi/POIDocument.java View File

@@ -418,8 +418,8 @@ public abstract class POIDocument implements Closeable {
@Override
public void close() throws IOException {
if (directory != null) {
if (directory.getNFileSystem() != null) {
directory.getNFileSystem().close();
if (directory.getFileSystem() != null) {
directory.getFileSystem().close();
clearDirectory();
}
}

+ 0
- 11
src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java View File

@@ -119,17 +119,6 @@ public class DirectoryNode
return _nfilesystem;
}


/**
* 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 POIFSFileSystem getNFileSystem()
{
return _nfilesystem;
}

/**
* open a document in the directory's entry's list of entries
*

+ 1
- 1
src/java/org/apache/poi/poifs/filesystem/DocumentInputStream.java View File

@@ -87,7 +87,7 @@ public final class DocumentInputStream extends InputStream implements LittleEndi
DocumentProperty property = (DocumentProperty)doc.getProperty();
_document = new POIFSDocument(
property,
((DirectoryNode)doc.getParent()).getNFileSystem()
((DirectoryNode)doc.getParent()).getFileSystem()
);
_data = _document.getBlockIterator();
}

+ 1
- 1
src/java/org/apache/poi/poifs/filesystem/POIFSDocument.java View File

@@ -54,7 +54,7 @@ public final class POIFSDocument implements POIFSViewable, Iterable<ByteBuffer>
*/
public POIFSDocument(DocumentNode document) {
this((DocumentProperty)document.getProperty(),
((DirectoryNode)document.getParent()).getNFileSystem());
((DirectoryNode)document.getParent()).getFileSystem());
}
/**

+ 0
- 1
src/testcases/org/apache/poi/poifs/filesystem/TestDocumentInputStream.java View File

@@ -442,7 +442,6 @@ public final class TestDocumentInputStream {

try (POIFSFileSystem npoifs = new POIFSFileSystem(sample)) {
// Ensure we have what we expect on the root
assertEquals(npoifs, npoifs.getRoot().getNFileSystem());
assertEquals(npoifs, npoifs.getRoot().getFileSystem());

// Check inside

+ 2
- 2
src/testcases/org/apache/poi/poifs/filesystem/TestFileSystemBugs.java View File

@@ -140,9 +140,9 @@ public final class TestFileSystemBugs {
// Copy over
EntryUtils.copyNodes(root, dest);

// Re-load, always as NPOIFS
// Re-load
ByteArrayOutputStream baos = new ByteArrayOutputStream();
root.getNFileSystem().writeFilesystem(baos);
root.getFileSystem().writeFilesystem(baos);

POIFSFileSystem read = new POIFSFileSystem(
new ByteArrayInputStream(baos.toByteArray()));

Loading…
Cancel
Save