/** * Copies all the nodes from one POIFS Directory to another * * @param sourceRoot * is the source Directory to copy from * @param targetRoot * is the target Directory to copy to */ public static void copyNodes(DirectoryEntry sourceRoot, DirectoryEntry targetRoot) throws IOException { for (Entry entry : sourceRoot) { copyNodeRecursively( entry, targetRoot ); } }
/** * Copies an Entry into a target POIFS directory, recursively */ @Internal public static void copyNodeRecursively( Entry entry, DirectoryEntry target ) throws IOException { if ( entry.isDirectoryEntry() ) { DirectoryEntry dirEntry = (DirectoryEntry)entry; DirectoryEntry newTarget = target.createDirectory( entry.getName() ); newTarget.setStorageClsid( dirEntry.getStorageClsid() ); Iterator<Entry> entries = dirEntry.getEntries(); while ( entries.hasNext() ) { copyNodeRecursively( entries.next(), newTarget ); } } else { DocumentEntry dentry = (DocumentEntry) entry; DocumentInputStream dstream = new DocumentInputStream( dentry ); target.createDocument( dentry.getName(), dstream ); dstream.close(); } }
/** * Copies all the nodes from one POIFS Directory to another * * @param sourceRoot * is the source Directory to copy from * @param targetRoot * is the target Directory to copy to */ public static void copyNodes(DirectoryEntry sourceRoot, DirectoryEntry targetRoot) throws IOException { for (Entry entry : sourceRoot) { copyNodeRecursively( entry, targetRoot ); } }
/** * Copies all the nodes from one POIFS Directory to another * * @param sourceRoot * is the source Directory to copy from * @param targetRoot * is the target Directory to copy to */ public static void copyNodes(DirectoryEntry sourceRoot, DirectoryEntry targetRoot) throws IOException { for (Entry entry : sourceRoot) { copyNodeRecursively( entry, targetRoot ); } }
/** * Copies all the nodes from one POIFS Directory to another * * @param sourceRoot * is the source Directory to copy from * @param targetRoot * is the target Directory to copy to */ public static void copyNodes(DirectoryEntry sourceRoot, DirectoryEntry targetRoot) throws IOException { for (Entry entry : sourceRoot) { copyNodeRecursively( entry, targetRoot ); } }
@Internal public void writeTo( DirectoryEntry directoryEntry ) throws IOException { if ( _objectPool != null ) EntryUtils.copyNodeRecursively( _objectPool, directoryEntry ); } }
/** * Copies an Entry into a target POIFS directory, recursively */ @Internal @Deprecated protected void copyNodeRecursively( Entry entry, DirectoryEntry target ) throws IOException { EntryUtils.copyNodeRecursively( entry, target ); } }
/** * Copies an Entry into a target POIFS directory, recursively */ @Internal @Deprecated protected void copyNodeRecursively( Entry entry, DirectoryEntry target ) throws IOException { EntryUtils.copyNodeRecursively( entry, target ); } }
@Internal public void writeTo( DirectoryEntry directoryEntry ) throws IOException { if ( _objectPool != null ) EntryUtils.copyNodeRecursively( _objectPool, directoryEntry ); } }
/** * Copies nodes from one Directory to the other minus the excepts * * @param sourceRoot * is the source Directory to copy from * @param targetRoot * is the target Directory to copy to * @param excepts * is a list of Strings specifying what nodes NOT to copy * @deprecated use {@link FilteringDirectoryNode} instead */ public static void copyNodes( DirectoryEntry sourceRoot, DirectoryEntry targetRoot, List<String> excepts ) throws IOException { Iterator<Entry> entries = sourceRoot.getEntries(); while ( entries.hasNext() ) { Entry entry = entries.next(); if ( !excepts.contains( entry.getName() ) ) { copyNodeRecursively( entry, targetRoot ); } } }
/** * Copies nodes from one Directory to the other minus the excepts * * @param sourceRoot * is the source Directory to copy from * @param targetRoot * is the target Directory to copy to * @param excepts * is a list of Strings specifying what nodes NOT to copy * @deprecated use {@link FilteringDirectoryNode} instead */ public static void copyNodes( DirectoryEntry sourceRoot, DirectoryEntry targetRoot, List<String> excepts ) throws IOException { Iterator<Entry> entries = sourceRoot.getEntries(); while ( entries.hasNext() ) { Entry entry = entries.next(); if ( !excepts.contains( entry.getName() ) ) { copyNodeRecursively( entry, targetRoot ); } } }
/** * Copies an Entry into a target POIFS directory, recursively */ @Internal public static void copyNodeRecursively( Entry entry, DirectoryEntry target ) throws IOException { // logger.log( POILogger.ERROR, "copyNodeRecursively called with "+entry.getName()+ // ","+target.getName()); DirectoryEntry newTarget = null; if ( entry.isDirectoryEntry() ) { newTarget = target.createDirectory( entry.getName() ); Iterator<Entry> entries = ( (DirectoryEntry) entry ).getEntries(); while ( entries.hasNext() ) { copyNodeRecursively( entries.next(), newTarget ); } } else { DocumentEntry dentry = (DocumentEntry) entry; DocumentInputStream dstream = new DocumentInputStream( dentry ); target.createDocument( dentry.getName(), dstream ); dstream.close(); } }
/** * Copies an Entry into a target POIFS directory, recursively */ @Internal public static void copyNodeRecursively( Entry entry, DirectoryEntry target ) throws IOException { // System.err.println("copyNodeRecursively called with "+entry.getName()+ // ","+target.getName()); DirectoryEntry newTarget = null; if ( entry.isDirectoryEntry() ) { newTarget = target.createDirectory( entry.getName() ); Iterator<Entry> entries = ( (DirectoryEntry) entry ).getEntries(); while ( entries.hasNext() ) { copyNodeRecursively( entries.next(), newTarget ); } } else { DocumentEntry dentry = (DocumentEntry) entry; DocumentInputStream dstream = new DocumentInputStream( dentry ); target.createDocument( dentry.getName(), dstream ); dstream.close(); } }
/** * Copies an Entry into a target POIFS directory, recursively */ @Internal public static void copyNodeRecursively( Entry entry, DirectoryEntry target ) throws IOException { if ( entry.isDirectoryEntry() ) { DirectoryEntry dirEntry = (DirectoryEntry)entry; DirectoryEntry newTarget = target.createDirectory( entry.getName() ); newTarget.setStorageClsid( dirEntry.getStorageClsid() ); Iterator<Entry> entries = dirEntry.getEntries(); while ( entries.hasNext() ) { copyNodeRecursively( entries.next(), newTarget ); } } else { DocumentEntry dentry = (DocumentEntry) entry; DocumentInputStream dstream = new DocumentInputStream( dentry ); target.createDocument( dentry.getName(), dstream ); dstream.close(); } }
DocumentSummaryInformation.DEFAULT_STREAM_NAME.equals(entryName) ) ) { EntryUtils.copyNodeRecursively( entry, newRoot );
EntryUtils.copyNodeRecursively( entry, pfs.getRoot() );