public String toString() { StringBuffer buffer = new StringBuffer(40 * (path.length() + 1)); for (int j = 0; j < path.length(); j++) { buffer.append(path.getComponent(j)).append("/"); } buffer.append(name); return buffer.toString(); } } // end public class DocumentDescriptor
/** * <p>Returns a string representation of the path. Components are * separated by the platform-specific file separator {@link File#separatorChar}</p> * * @return string representation * * @since 2002-01-24 */ public String toString() { final StringBuffer b = new StringBuffer(); final int l = length(); b.append(File.separatorChar); for (int i = 0; i < l; i++) { b.append(getComponent(i)); if (i < l - 1) { b.append(File.separatorChar); } } return b.toString(); } } // end public class POIFSDocumentPath
private static void readEntry(POIFSReaderEvent event) { POIFSDocumentPath path = event.getPath(); StringBuilder sb = new StringBuilder(); try (DocumentInputStream istream = event.getStream()) { sb.setLength(0); int pathLength = path.length(); for (int k = 0; k < pathLength; k++) { sb.append("/").append(path.getComponent(k)); } byte[] data = IOUtils.toByteArray(istream); sb.append("/").append(event.getName()).append(": ").append(data.length).append(" bytes read"); System.out.println(sb); } catch (IOException ignored) { } }
public POIFSDocument(String name, final int size, POIFSFileSystem filesystem, POIFSWriterListener writer) throws IOException { this._filesystem = filesystem; if (size < POIFSConstants.BIG_BLOCK_MINIMUM_DOCUMENT_SIZE) { _stream = new POIFSStream(filesystem.getMiniStore()); _block_size = _filesystem.getMiniStore().getBlockStoreBlockSize(); } else { _stream = new POIFSStream(filesystem); _block_size = _filesystem.getBlockStoreBlockSize(); } this._property = new DocumentProperty(name, size); _property.setStartBlock(_stream.getStartBlock()); _property.setDocument(this); try (DocumentOutputStream os = new DocumentOutputStream(this, size)) { POIFSDocumentPath path = new POIFSDocumentPath(name.split("\\\\")); String docName = path.getComponent(path.length() - 1); POIFSWriterEvent event = new POIFSWriterEvent(os, path, docName, size); writer.processPOIFSWriterEvent(event); } }
public String toString() { StringBuffer buffer = new StringBuffer(40 * (path.length() + 1)); for (int j = 0; j < path.length(); j++) { buffer.append(path.getComponent(j)).append("/"); } buffer.append(name); return buffer.toString(); } } // end public class DocumentDescriptor
public String toString() { StringBuffer buffer = new StringBuffer(40 * (path.length() + 1)); for (int j = 0; j < path.length(); j++) { buffer.append(path.getComponent(j)).append("/"); } buffer.append(name); return buffer.toString(); } } // end public class DocumentDescriptor
public String toString() { StringBuffer buffer = new StringBuffer(40 * (path.length() + 1)); for (int j = 0; j < path.length(); j++) { buffer.append(path.getComponent(j)).append("/"); } buffer.append(name); return buffer.toString(); } } // end public class DocumentDescriptor
/** * <p>Returns a string representation of the path. Components are * separated by the platform-specific file separator.</p> * * @return string representation * * @since 2002-01-24 */ public String toString() { final StringBuffer b = new StringBuffer(); final int l = length(); b.append(File.separatorChar); for (int i = 0; i < l; i++) { b.append(getComponent(i)); if (i < l - 1) { b.append(File.separatorChar); } } return b.toString(); } } // end public class POIFSDocumentPath
/** * <p>Returns a string representation of the path. Components are * separated by the platform-specific file separator.</p> * * @return string representation * * @since 2002-01-24 */ public String toString() { final StringBuffer b = new StringBuffer(); final int l = length(); b.append(File.separatorChar); for (int i = 0; i < l; i++) { b.append(getComponent(i)); if (i < l - 1) { b.append(File.separatorChar); } } return b.toString(); } } // end public class POIFSDocumentPath
/** * <p>Returns a string representation of the path. Components are * separated by the platform-specific file separator {@link File#separatorChar}</p> * * @return string representation * * @since 2002-01-24 */ public String toString() { final StringBuffer b = new StringBuffer(); final int l = length(); b.append(File.separatorChar); for (int i = 0; i < l; i++) { b.append(getComponent(i)); if (i < l - 1) { b.append(File.separatorChar); } } return b.toString(); } } // end public class POIFSDocumentPath
private static void readEntry(POIFSReaderEvent event) { POIFSDocumentPath path = event.getPath(); StringBuilder sb = new StringBuilder(); try (DocumentInputStream istream = event.getStream()) { sb.setLength(0); int pathLength = path.length(); for (int k = 0; k < pathLength; k++) { sb.append("/").append(path.getComponent(k)); } byte[] data = IOUtils.toByteArray(istream); sb.append("/").append(event.getName()).append(": ").append(data.length).append(" bytes read"); System.out.println(sb); } catch (IOException ignored) { } }
final String name = path.getComponent(path.length() - 1); final POIFSDocumentPath parentPath = path.getParent(); final MutableTreeNode parentNode =
final String name = path.getComponent(path.length() - 1); final POIFSDocumentPath parentPath = path.getParent(); final MutableTreeNode parentNode =
final String name = path.getComponent(path.length() - 1); final POIFSDocumentPath parentPath = path.getParent(); final MutableTreeNode parentNode =
/** * Method processPOIFSReaderEvent * * @param event */ public void processPOIFSReaderEvent(final POIFSReaderEvent event) { DocumentInputStream istream = event.getStream(); POIFSDocumentPath path = event.getPath(); String name = event.getName(); try { byte[] data = new byte[ istream.available() ]; istream.read(data); int pathLength = path.length(); for (int k = 0; k < pathLength; k++) { System.out.print("/" + path.getComponent(k)); } System.out.println("/" + name + ": " + data.length + " bytes read"); } catch (IOException ignored) { } } } // end private class SampleListener
/** * Method processPOIFSReaderEvent * * @param event */ public void processPOIFSReaderEvent(final POIFSReaderEvent event) { DocumentInputStream istream = event.getStream(); POIFSDocumentPath path = event.getPath(); String name = event.getName(); try { byte[] data = new byte[ istream.available() ]; istream.read(data); int pathLength = path.length(); for (int k = 0; k < pathLength; k++) { System.out.print("/" + path.getComponent(k)); } System.out.println("/" + name + ": " + data.length + " bytes read"); } catch (IOException ignored) { } } } // end private class SampleListener
de = de.createDirectory(path.getComponent (path.length() - 1));
de = de.createDirectory(path.getComponent (path.length() - 1));
public POIFSDocument(String name, final int size, POIFSFileSystem filesystem, POIFSWriterListener writer) throws IOException { this._filesystem = filesystem; if (size < POIFSConstants.BIG_BLOCK_MINIMUM_DOCUMENT_SIZE) { _stream = new POIFSStream(filesystem.getMiniStore()); _block_size = _filesystem.getMiniStore().getBlockStoreBlockSize(); } else { _stream = new POIFSStream(filesystem); _block_size = _filesystem.getBlockStoreBlockSize(); } this._property = new DocumentProperty(name, size); _property.setStartBlock(_stream.getStartBlock()); _property.setDocument(this); try (DocumentOutputStream os = new DocumentOutputStream(this, size)) { POIFSDocumentPath path = new POIFSDocumentPath(name.split("\\\\")); String docName = path.getComponent(path.length() - 1); POIFSWriterEvent event = new POIFSWriterEvent(os, path, docName, size); writer.processPOIFSWriterEvent(event); } }