Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.services.clientserver.java
Class ClassFileUtil


java.lang.Object
  extended by 
org.eclipse.rse.services.clientserver.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.

Parameters:
stream - the input stream representing a class.
Throws:
IOException - if an I/O error occurs.

RSE
Release 3.0

Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire