Class EntryUtils

    • Method Detail

      • copyNodes

        public static void copyNodes​(DirectoryEntry sourceRoot,
                                     DirectoryEntry targetRoot)
                              throws IOException
        Copies all the nodes from one POIFS Directory to another
        Parameters:
        sourceRoot - is the source Directory to copy from
        targetRoot - is the target Directory to copy to
        Throws:
        IOException
      • copyNodes

        public static void copyNodes​(POIFSFileSystem source,
                                     POIFSFileSystem target)
                              throws IOException
        Copies all nodes from one POIFS to the other
        Parameters:
        source - is the source POIFS to copy from
        target - is the target POIFS to copy to
        Throws:
        IOException
      • copyNodes

        public static void copyNodes​(POIFSFileSystem source,
                                     POIFSFileSystem target,
                                     List<String> excepts)
                              throws IOException
        Copies nodes from one POIFS to the other, minus the excepts. This delegates the filtering work to FilteringDirectoryNode, so excepts can be of the form "NodeToExclude" or "FilteringDirectory/ExcludedChildNode"
        Parameters:
        source - is the source POIFS to copy from
        target - is the target POIFS to copy to
        excepts - is a list of Entry Names to be excluded from the copy
        Throws:
        IOException
      • areDirectoriesIdentical

        public static boolean areDirectoriesIdentical​(DirectoryEntry dirA,
                                                      DirectoryEntry dirB)
        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
        • the size+contents of each entry must match
        • the storage classid of the directories must match
        To exclude certain parts of the Directory from being checked, use a FilteringDirectoryNode
      • areDocumentsIdentical

        public static boolean areDocumentsIdentical​(DocumentEntry docA,
                                                    DocumentEntry docB)
                                             throws IOException
        Compares two DocumentEntry instances of a POI file system. Documents that are not property set streams must be bitwise identical. Property set streams must be logically equal.

        (Their parent directories are not checked)

        Throws:
        IOException