Class EntryUtils
java.lang.Object
org.docx4j.org.apache.poi.poifs.filesystem.EntryUtils
@Internal public class EntryUtils extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description EntryUtils() -
Method Summary
Modifier and Type Method Description static booleanareDirectoriesIdentical(DirectoryEntry dirA, DirectoryEntry dirB)Checks to see if the two Directories hold the same contents.static booleanareDocumentsIdentical(DocumentEntry docA, DocumentEntry docB)Checks to see if two Documents have the same name and the same contents.static voidcopyNodeRecursively(Entry entry, DirectoryEntry target)Copies an Entry into a target POIFS directory, recursivelystatic voidcopyNodes(DirectoryEntry sourceRoot, DirectoryEntry targetRoot)Copies all the nodes from one POIFS Directory to anotherstatic voidcopyNodes(DirectoryEntry sourceRoot, DirectoryEntry targetRoot, java.util.List<java.lang.String> excepts)Deprecated.useFilteringDirectoryNodeinsteadstatic voidcopyNodes(FilteringDirectoryNode filteredSource, FilteringDirectoryNode filteredTarget)Copies nodes from one Directory to the other minus the exceptsstatic voidcopyNodes(NPOIFSFileSystem source, NPOIFSFileSystem target)Copies all nodes from one POIFS to the otherstatic voidcopyNodes(NPOIFSFileSystem source, NPOIFSFileSystem target, java.util.List<java.lang.String> excepts)Copies nodes from one POIFS to the other, minus the excepts.static voidcopyNodes(OPOIFSFileSystem source, OPOIFSFileSystem target)Copies all nodes from one POIFS to the otherstatic voidcopyNodes(OPOIFSFileSystem source, OPOIFSFileSystem target, java.util.List<java.lang.String> excepts)Copies nodes from one POIFS to the other, minus the excepts.
-
Constructor Details
-
EntryUtils
public EntryUtils()
-
-
Method Details
-
copyNodeRecursively
@Internal public static void copyNodeRecursively(Entry entry, DirectoryEntry target) throws java.io.IOExceptionCopies an Entry into a target POIFS directory, recursively- Throws:
java.io.IOException
-
copyNodes
public static void copyNodes(DirectoryEntry sourceRoot, DirectoryEntry targetRoot) throws java.io.IOExceptionCopies all the nodes from one POIFS Directory to another- Parameters:
sourceRoot- is the source Directory to copy fromtargetRoot- is the target Directory to copy to- Throws:
java.io.IOException
-
copyNodes
public static void copyNodes(FilteringDirectoryNode filteredSource, FilteringDirectoryNode filteredTarget) throws java.io.IOExceptionCopies nodes from one Directory to the other minus the excepts- Parameters:
filteredSource- The filtering source Directory to copy fromfilteredTarget- The filtering target Directory to copy to- Throws:
java.io.IOException
-
copyNodes
public static void copyNodes(DirectoryEntry sourceRoot, DirectoryEntry targetRoot, java.util.List<java.lang.String> excepts) throws java.io.IOExceptionDeprecated.useFilteringDirectoryNodeinsteadCopies nodes from one Directory to the other minus the excepts- Parameters:
sourceRoot- is the source Directory to copy fromtargetRoot- is the target Directory to copy toexcepts- is a list of Strings specifying what nodes NOT to copy- Throws:
java.io.IOException
-
copyNodes
public static void copyNodes(OPOIFSFileSystem source, OPOIFSFileSystem target) throws java.io.IOExceptionCopies all nodes from one POIFS to the other- Parameters:
source- is the source POIFS to copy fromtarget- is the target POIFS to copy to- Throws:
java.io.IOException
-
copyNodes
public static void copyNodes(NPOIFSFileSystem source, NPOIFSFileSystem target) throws java.io.IOExceptionCopies all nodes from one POIFS to the other- Parameters:
source- is the source POIFS to copy fromtarget- is the target POIFS to copy to- Throws:
java.io.IOException
-
copyNodes
public static void copyNodes(OPOIFSFileSystem source, OPOIFSFileSystem target, java.util.List<java.lang.String> excepts) throws java.io.IOExceptionCopies nodes from one POIFS to the other, minus the excepts. This delegates the filtering work toFilteringDirectoryNode, so excepts can be of the form "NodeToExclude" or "FilteringDirectory/ExcludedChildNode"- Parameters:
source- is the source POIFS to copy fromtarget- is the target POIFS to copy toexcepts- is a list of Entry Names to be excluded from the copy- Throws:
java.io.IOException
-
copyNodes
public static void copyNodes(NPOIFSFileSystem source, NPOIFSFileSystem target, java.util.List<java.lang.String> excepts) throws java.io.IOExceptionCopies nodes from one POIFS to the other, minus the excepts. This delegates the filtering work toFilteringDirectoryNode, so excepts can be of the form "NodeToExclude" or "FilteringDirectory/ExcludedChildNode"- Parameters:
source- is the source POIFS to copy fromtarget- is the target POIFS to copy toexcepts- is a list of Entry Names to be excluded from the copy- Throws:
java.io.IOException
-
areDirectoriesIdentical
Checks to see if the two Directories hold the same contents. For this to be true, they must have entries with the same names, no entries in one but not the other, and the size+contents of each entry must match, and they must share names. To exclude certain parts of the Directory from being checked, use aFilteringDirectoryNode -
areDocumentsIdentical
public static boolean areDocumentsIdentical(DocumentEntry docA, DocumentEntry docB) throws java.io.IOExceptionChecks to see if two Documents have the same name and the same contents. (Their parent directories are not checked)- Throws:
java.io.IOException
-