Class FileMnpltr


  • public class FileMnpltr
    extends java.lang.Object
    This aids with the manipulation of files and folders
    Since:
    1.0.0
    • Constructor Summary

      Constructors 
      Constructor Description
      FileMnpltr()  
    • Method Summary

      Modifier and Type Method Description
      static void copyFile​(java.lang.String copyfrom, java.lang.String copyto)
      Copies files from one location to another
      static void copyFolder​(java.io.File src, java.io.File dest)
      Copies a folder from one location to another
      static void deleteFile​(java.lang.String deleteFilePath)
      Deletes a file at the specified path
      static void findReplaceString​(java.lang.String filePath, java.lang.String replaceString, java.lang.String replaceWithString)
      Replace a string from a file with another string
      static boolean findStringInFile​(java.lang.String file, java.lang.String stringToFind)
      Searches for a string within a file and returns whether or not it was found
      static void moveFile​(java.lang.String movefrom, java.lang.String target)
      Move/rename a file from one location to another
      static void writeBootstrapFromJar​(java.util.jar.JarFile jarFile, java.lang.String bootstrapDirPath)
      When running the FAST Framework from a .jar file, the bootstrap files for the detailed reports folder needs to be copied out from the jar file.
      • Methods inherited from class java.lang.Object

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

      • FileMnpltr

        public FileMnpltr()
    • Method Detail

      • moveFile

        public static void moveFile​(java.lang.String movefrom,
                                    java.lang.String target)
        Move/rename a file from one location to another
        Parameters:
        movefrom - Source file
        target - Destination
        Since:
        1.0.0
      • copyFile

        public static void copyFile​(java.lang.String copyfrom,
                                    java.lang.String copyto)
                             throws FastException
        Copies files from one location to another
        Parameters:
        copyfrom - Source file
        copyto - Destination
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • copyFolder

        public static void copyFolder​(java.io.File src,
                                      java.io.File dest)
                               throws FastException
        Copies a folder from one location to another
        Parameters:
        src - Source folder
        dest - Destination
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • deleteFile

        public static void deleteFile​(java.lang.String deleteFilePath)
                               throws FastException
        Deletes a file at the specified path
        Parameters:
        deleteFilePath - the filepath to the file that needs to be deleted
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • findStringInFile

        public static boolean findStringInFile​(java.lang.String file,
                                               java.lang.String stringToFind)
                                        throws FastException
        Searches for a string within a file and returns whether or not it was found
        Parameters:
        file - The path to the file being read
        stringToFind - The string being searched for
        Returns:
        true if the stringToFind was found inside
        Throws:
        FastException - If an error occurs during execution
      • findReplaceString

        public static void findReplaceString​(java.lang.String filePath,
                                             java.lang.String replaceString,
                                             java.lang.String replaceWithString)
                                      throws FastException
        Replace a string from a file with another string
        Parameters:
        filePath - The path to the file
        replaceString - The string to be replaced
        replaceWithString - The new string
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0
      • writeBootstrapFromJar

        public static void writeBootstrapFromJar​(java.util.jar.JarFile jarFile,
                                                 java.lang.String bootstrapDirPath)
                                          throws FastException
        When running the FAST Framework from a .jar file, the bootstrap files for the detailed reports folder needs to be copied out from the jar file.
        Parameters:
        jarFile - a jar file
        bootstrapDirPath - file path of the location that the bootstrap files will be copied to
        Throws:
        FastException - If an error occurs during execution
        Since:
        1.0.0