Class Utils


  • public class Utils
    extends Object
    A Utils.
    Version:
    $Revision: $
    • Constructor Detail

      • Utils

        public Utils()
    • Method Detail

      • readFileIntoString

        public static String readFileIntoString​(URL input)
                                         throws IOException
        Reads the contents of a file into a string variable.
        Parameters:
        input - url
        Returns:
        string of return
        Throws:
        IOException - ioException
      • createSrcFile

        public static FileWriter createSrcFile​(String name,
                                               String packageName,
                                               String outDir)
                                        throws IOException
        Create source file
        Parameters:
        name - The name of the class
        packageName - The package name
        outDir - output directory
        Returns:
        The file
        Throws:
        IOException - Thrown if an error occurs
      • createTestFile

        public static FileWriter createTestFile​(String name,
                                                String packageName,
                                                String outDir)
                                         throws IOException
        Create test file
        Parameters:
        name - The name of the class
        packageName - The package name
        outDir - output directory
        Returns:
        The file
        Throws:
        IOException - Thrown if an error occurs
      • createFile

        public static FileWriter createFile​(String name,
                                            String outDir)
                                     throws IOException
        Create file
        Parameters:
        name - The name of the class
        outDir - output directory
        Returns:
        The file
        Throws:
        IOException - Thrown if an error occurs
      • recursiveDelete

        public static void recursiveDelete​(File f)
                                    throws IOException
        Recursive delete
        Parameters:
        f - The file handler
        Throws:
        IOException - Thrown if a file could not be deleted
      • copyFolder

        public static void copyFolder​(String sourcePath,
                                      String targetPath,
                                      String filterName)
                               throws IOException
        copy folders
        Parameters:
        sourcePath - source folder
        targetPath - target folder
        filterName - filter name
        Throws:
        IOException - Thrown if an error occurs