Remote Systems
v6.4.1

com.ibm.etools.systems.core.java
Class ClassFileUtil

java.lang.Object
  extended bycom.ibm.etools.systems.core.java.ClassFileUtil

public class ClassFileUtil
extends Object

Singleton class for obtaining various information about class files.


Method Summary
static ClassFileUtil getInstance()
          Returns the singleton instance.
 String getQualifiedClassName(File classFile)
          Gets the qualified class name.
 String getQualifiedClassName(InputStream stream)
          Gets the qualified class name for the class represented by the given input stream.
 String getQualifiedClassName(String classFilePath)
          Gets the qualified class name for the file with the given path.
 boolean isRunnable(File classFile)
          Returns whether the class is runnable, i.e. whether it contains public static void main (String[]) method.
 boolean isRunnable(InputStream stream)
          Returns whether the class represented by the given input stream is runnable, i.e. whether it contains public static void main (String[]) method.
 boolean isRunnable(String classFilePath)
          Returns whether the class with the given path is runnable, i.e. whether it contains public static void main (String[]) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static final ClassFileUtil getInstance()
Returns the singleton instance.

Returns:
the singleton instance.

isRunnable

public boolean isRunnable(String classFilePath)
                   throws IOException
Returns whether the class with the given path is runnable, i.e. whether it contains public static void main (String[]) method.

Parameters:
classFilePath - the class file path.
Returns:
true if the class file is runnable, false otherwise.
Throws:
IOException - if an I/O error occurs.

isRunnable

public boolean isRunnable(File classFile)
                   throws IOException
Returns whether the class is runnable, i.e. whether it contains public static void main (String[]) method.

Parameters:
classFile - the class file.
Returns:
true if the class file is runnable, false otherwise.
Throws:
IOException - if an I/O error occurs.

isRunnable

public boolean isRunnable(InputStream stream)
                   throws IOException
Returns whether the class represented by the given input stream is runnable, i.e. whether it contains public static void main (String[]) method.

Parameters:
stream - the input stream.
Returns:
true if the class file is runnable, false otherwise.
Throws:
IOException - if an I/O error occurs.

getQualifiedClassName

public String getQualifiedClassName(String classFilePath)
                             throws IOException
Gets the qualified class name for the file with the given path.

Parameters:
classFilePath - the class file path.
Throws:
IOException - if an I/O error occurs.

getQualifiedClassName

public String getQualifiedClassName(File classFile)
                             throws IOException
Gets the qualified class name.

Parameters:
classFile - the class file.
Throws:
IOException - if an I/O error occurs.

getQualifiedClassName

public String getQualifiedClassName(InputStream stream)
                             throws IOException
Gets the qualified class name for the class represented by the given input stream.

Throws:
IOException - if an I/O error occurs.

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.