Class CaseUtility


  • public class CaseUtility
    extends java.lang.Object
    Class which provides some additional functionality regarding Nuix cases, mainly finding cases present in directories and their sub directories.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static CaseUtility instance  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected CaseUtility()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void archiveCase​(java.io.File nuixCaseDirectory, java.io.File archiveFile, boolean deleteCaseOnCompletion, int compressionLevel)
      Archives a Nuix case into a Zip file, optionally deleting the case once completed.
      void archiveCase​(java.lang.String nuixCaseDirectory, java.lang.String archiveFile, boolean deleteCaseOnCompletion, int compressionLevel)
      Archives a Nuix case into a Zip file, optionally deleting the case once completed.
      java.util.Collection<java.io.File> findCaseDirectories​(java.io.File rootSearchDirectory)
      Searches for case directories in a given directory and sub-directories.
      java.util.Collection<java.io.File> findCaseDirectories​(java.lang.String rootSearchPath)
      Searches for case directories in a given directory and sub-directories.
      java.util.Collection<java.lang.String> findCaseDirectoryPaths​(java.io.File rootSearchDirectory)
      Searches for case directories in a given directory and sub-directories.
      java.util.Collection<java.lang.String> findCaseDirectoryPaths​(java.lang.String rootSearchPath)
      Searches for case directories in a given directory and sub-directories.
      java.util.List<CaseInfo> findCaseInformation​(java.io.File rootSearchDirectory)
      Scans specified root directory and sub-directories for cases, returning CaseInfo objects for each case located.
      java.util.List<CaseInfo> findCaseInformation​(java.lang.String rootSearchPath)
      Scans specified root directory and sub-directories for cases, returning CaseInfo objects for each case located.
      static CaseUtility getInstance()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CaseUtility

        protected CaseUtility()
    • Method Detail

      • getInstance

        public static CaseUtility getInstance()
      • findCaseDirectories

        public java.util.Collection<java.io.File> findCaseDirectories​(java.io.File rootSearchDirectory)
        Searches for case directories in a given directory and sub-directories.
        Parameters:
        rootSearchDirectory - The root directory to search.
        Returns:
        A collection of File objects for case directories located.
      • findCaseDirectories

        public java.util.Collection<java.io.File> findCaseDirectories​(java.lang.String rootSearchPath)
        Searches for case directories in a given directory and sub-directories.
        Parameters:
        rootSearchPath - The path to the root directory to search.
        Returns:
        A collection of File objects for case directories located.
      • findCaseDirectoryPaths

        public java.util.Collection<java.lang.String> findCaseDirectoryPaths​(java.io.File rootSearchDirectory)
        Searches for case directories in a given directory and sub-directories.
        Parameters:
        rootSearchDirectory - The root directory to search.
        Returns:
        A collection of String representing case directories located.
      • findCaseDirectoryPaths

        public java.util.Collection<java.lang.String> findCaseDirectoryPaths​(java.lang.String rootSearchPath)
        Searches for case directories in a given directory and sub-directories.
        Parameters:
        rootSearchPath - The root directory to search.
        Returns:
        A collection of String representing case directories located.
      • findCaseInformation

        public java.util.List<CaseInfo> findCaseInformation​(java.io.File rootSearchDirectory)
        Scans specified root directory and sub-directories for cases, returning CaseInfo objects for each case located.
        Parameters:
        rootSearchDirectory - The root directory to search in
        Returns:
        Case info objects for each case found
      • findCaseInformation

        public java.util.List<CaseInfo> findCaseInformation​(java.lang.String rootSearchPath)
        Scans specified root directory and sub-directories for cases, returning CaseInfo objects for each case located.
        Parameters:
        rootSearchPath - The root directory to search in
        Returns:
        Case info objects for each case found
      • archiveCase

        public void archiveCase​(java.lang.String nuixCaseDirectory,
                                java.lang.String archiveFile,
                                boolean deleteCaseOnCompletion,
                                int compressionLevel)
                         throws java.io.IOException
        Archives a Nuix case into a Zip file, optionally deleting the case once completed. Based on: https://stackoverflow.com/questions/23318383/compress-directory-into-a-zipfile-with-commons-io
        Parameters:
        nuixCaseDirectory - Directory of the Nuix case
        archiveFile - The Zip file to archive the case into
        deleteCaseOnCompletion - Whether to delete the case upon completion
        compressionLevel - The compression level (0-9) with 0 being no compression and 9 being full compression, values outside range will be clamped into range.
        Throws:
        java.io.IOException - Thrown if there are issues creating the archive or deleting the directory.
      • archiveCase

        public void archiveCase​(java.io.File nuixCaseDirectory,
                                java.io.File archiveFile,
                                boolean deleteCaseOnCompletion,
                                int compressionLevel)
                         throws java.io.IOException
        Archives a Nuix case into a Zip file, optionally deleting the case once completed. Based on: https://stackoverflow.com/questions/23318383/compress-directory-into-a-zipfile-with-commons-io
        Parameters:
        nuixCaseDirectory - Directory of the Nuix case
        archiveFile - The Zip file to archive the case into
        deleteCaseOnCompletion - Whether to delete the case upon completion
        compressionLevel - The compression level (0-9) with 0 being no compression and 9 being full compression, values outside range will be clamped into range.
        Throws:
        java.io.IOException - Thrown if there are issues creating the archive or deleting the directory.