org.jboss.drools.guvnor.importgenerator.utils
Class FileIO

java.lang.Object
  extended by org.jboss.drools.guvnor.importgenerator.utils.FileIO

public class FileIO
extends Object

File IO helper class for reading/writing files and converting to/from base64


Field Summary
static String FORMAT
           
 
Constructor Summary
FileIO()
           
 
Method Summary
static String fromBase64(byte[] b64)
           
static String getExtension(File file)
           
static byte[] readAll(File f)
           
static String readAll(InputStream is)
           
static String readAllAsBase64(File f)
           
static String toBase64(byte[] b)
           
static void write(String data, File destination)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORMAT

public static final String FORMAT
See Also:
Constant Field Values
Constructor Detail

FileIO

public FileIO()
Method Detail

write

public static void write(String data,
                         File destination)
                  throws IOException
Throws:
IOException

getExtension

public static String getExtension(File file)

readAllAsBase64

public static String readAllAsBase64(File f)
                              throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

toBase64

public static String toBase64(byte[] b)
                       throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

fromBase64

public static String fromBase64(byte[] b64)
                         throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

readAll

public static byte[] readAll(File f)

readAll

public static String readAll(InputStream is)


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.