org.jboss.jca.codegenerator
Class Utils

java.lang.Object
  extended by org.jboss.jca.codegenerator.Utils

public class Utils
extends Object

A Utils.

Version:
$Revision: $

Constructor Summary
Utils()
           
 
Method Summary
static void copyFolder(String sourcePath, String targetPath, String filterName)
          copy folders
static FileWriter createFile(String name, String outDir)
          Create file
static FileWriter createSrcFile(String name, String packageName, String outDir)
          Create source file
static FileWriter createTestFile(String name, String packageName, String outDir)
          Create test file
static String readFileIntoString(URL input)
          Reads the contents of a file into a string variable.
static void recursiveDelete(File f)
          Recursive delete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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


Copyright © 2012 JBoss, by Red Hat (http://www.jboss.org/ironjacamar)