org.ow2.jonas.eclipse.compiler
Class Util

java.lang.Object
  extended by org.ow2.jonas.eclipse.compiler.Util

public class Util
extends Object

Eclipse Compiler Utilities.

Author:
Guillaume Sauthier

Constructor Summary
Util()
           
 
Method Summary
static String getClassName(String source)
          Get the fully qualified Java class name from a source file (system path + .java).
static byte[] toByteArray(InputStream is)
          Convert a given InputStream in a byte array.
static char[] toCharArray(InputStream is, String charset)
          Transform a given InputStream into a char array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

toCharArray

public static char[] toCharArray(InputStream is,
                                 String charset)
Transform a given InputStream into a char array. May return null.

Parameters:
is - the InputStream to convert
charset - Encoding to use.
Returns:
the content of the InputStream as a char array

toByteArray

public static byte[] toByteArray(InputStream is)
                          throws IOException
Convert a given InputStream in a byte array.

Parameters:
is - Class file input
Returns:
the byte[] content of the given InputStream
Throws:
IOException - if InputStream manipulation fails.

getClassName

public static String getClassName(String source)
Get the fully qualified Java class name from a source file (system path + .java).

Parameters:
source - Java Source file name
Returns:
the fully qualified classname


Copyright © 2010 OW2 Consortium. All Rights Reserved.