/** * Closes the underlying {@link POIFSFileSystem} from which * the document was read, if any. Has no effect on documents * opened from an InputStream, or newly created ones.<p> * * Once {@code close()} has been called, no further operations * should be called on the document. */ @Override public void close() throws IOException { if (directory != null) { if (directory.getNFileSystem() != null) { directory.getNFileSystem().close(); clearDirectory(); } } }
/** * Constructor for an existing Document */ public POIFSDocument(DocumentNode document) { this((DocumentProperty)document.getProperty(), ((DirectoryNode)document.getParent()).getNFileSystem()); }
/** * Create an InputStream from the specified DocumentEntry * * @param document the DocumentEntry to be read * * @exception IOException if the DocumentEntry cannot be opened (like, maybe it has * been deleted?) */ public DocumentInputStream(DocumentEntry document) throws IOException { if (!(document instanceof DocumentNode)) { throw new IOException("Cannot open internal document storage, " + document + " not a Document Node"); } _current_offset = 0; _current_block_count = 0; _marked_offset = 0; _marked_offset_count = 0; _document_size = document.getSize(); _closed = false; // can't be asserted ... see bug 61300 // assert (_document_size >= 0) : "Document size can't be < 0"; DocumentNode doc = (DocumentNode)document; DocumentProperty property = (DocumentProperty)doc.getProperty(); _document = new POIFSDocument( property, ((DirectoryNode)doc.getParent()).getNFileSystem() ); _data = _document.getBlockIterator(); }
/** * Closes the underlying {@link POIFSFileSystem} from which * the document was read, if any. Has no effect on documents * opened from an InputStream, or newly created ones.<p> * * Once {@code close()} has been called, no further operations * should be called on the document. */ @Override public void close() throws IOException { if (directory != null) { if (directory.getNFileSystem() != null) { directory.getNFileSystem().close(); clearDirectory(); } } }
/** * Constructor for an existing Document */ public POIFSDocument(DocumentNode document) { this((DocumentProperty)document.getProperty(), ((DirectoryNode)document.getParent()).getNFileSystem()); }
extractMacros(root.getNFileSystem(), xhtml, EmbeddedDocumentUtil.getEmbeddedDocumentExtractor(context));
/** * Create an InputStream from the specified DocumentEntry * * @param document the DocumentEntry to be read * * @exception IOException if the DocumentEntry cannot be opened (like, maybe it has * been deleted?) */ public DocumentInputStream(DocumentEntry document) throws IOException { if (!(document instanceof DocumentNode)) { throw new IOException("Cannot open internal document storage"); } DocumentNode documentNode = (DocumentNode)document; DirectoryNode parentNode = (DirectoryNode)document.getParent(); if(documentNode.getDocument() != null) { delegate = new ODocumentInputStream(document); } else if(parentNode.getFileSystem() != null) { delegate = new ODocumentInputStream(document); } else if(parentNode.getNFileSystem() != null) { delegate = new NDocumentInputStream(document); } else { throw new IOException("No FileSystem bound on the parent, can't read contents"); } }
/** * Create an InputStream from the specified DocumentEntry * * @param document the DocumentEntry to be read * * @exception IOException if the DocumentEntry cannot be opened (like, maybe it has * been deleted?) */ public DocumentInputStream(DocumentEntry document) throws IOException { if (!(document instanceof DocumentNode)) { throw new IOException("Cannot open internal document storage"); } DocumentNode documentNode = (DocumentNode)document; DirectoryNode parentNode = (DirectoryNode)document.getParent(); if(documentNode.getDocument() != null) { delegate = new ODocumentInputStream(document); } else if(parentNode.getFileSystem() != null) { delegate = new ODocumentInputStream(document); } else if(parentNode.getNFileSystem() != null) { delegate = new NDocumentInputStream(document); } else { throw new IOException("No FileSystem bound on the parent, can't read contents"); } }
/** * Create an InputStream from the specified DocumentEntry * * @param document the DocumentEntry to be read * * @exception IOException if the DocumentEntry cannot be opened (like, maybe it has * been deleted?) */ public NDocumentInputStream(DocumentEntry document) throws IOException { if (!(document instanceof DocumentNode)) { throw new IOException("Cannot open internal document storage, " + document + " not a Document Node"); } _current_offset = 0; _current_block_count = 0; _marked_offset = 0; _marked_offset_count = 0; _document_size = document.getSize(); _closed = false; DocumentNode doc = (DocumentNode)document; DocumentProperty property = (DocumentProperty)doc.getProperty(); _document = new NPOIFSDocument( property, ((DirectoryNode)doc.getParent()).getNFileSystem() ); _data = _document.getBlockIterator(); }
/** * Create an InputStream from the specified DocumentEntry * * @param document the DocumentEntry to be read * * @exception IOException if the DocumentEntry cannot be opened (like, maybe it has * been deleted?) */ public NDocumentInputStream(DocumentEntry document) throws IOException { if (!(document instanceof DocumentNode)) { throw new IOException("Cannot open internal document storage, " + document + " not a Document Node"); } _current_offset = 0; _current_block_count = 0; _marked_offset = 0; _marked_offset_count = 0; _document_size = document.getSize(); _closed = false; DocumentNode doc = (DocumentNode)document; DocumentProperty property = (DocumentProperty)doc.getProperty(); _document = new NPOIFSDocument( property, ((DirectoryNode)doc.getParent()).getNFileSystem() ); _data = _document.getBlockIterator(); }
/** * Create an InputStream from the specified DocumentEntry * * @param document the DocumentEntry to be read * * @exception IOException if the DocumentEntry cannot be opened (like, maybe it has * been deleted?) */ public DocumentInputStream(DocumentEntry document) throws IOException { if (!(document instanceof DocumentNode)) { throw new IOException("Cannot open internal document storage, " + document + " not a Document Node"); } _current_offset = 0; _current_block_count = 0; _marked_offset = 0; _marked_offset_count = 0; _document_size = document.getSize(); _closed = false; // can't be asserted ... see bug 61300 // assert (_document_size >= 0) : "Document size can't be < 0"; DocumentNode doc = (DocumentNode)document; DocumentProperty property = (DocumentProperty)doc.getProperty(); _document = new POIFSDocument( property, ((DirectoryNode)doc.getParent()).getNFileSystem() ); _data = _document.getBlockIterator(); }
extractMacros(root.getNFileSystem(), xhtml, EmbeddedDocumentUtil.getEmbeddedDocumentExtractor(context)); } finally {
extractMacros(root.getNFileSystem(), xhtml, EmbeddedDocumentUtil.getEmbeddedDocumentExtractor(context));