public abstract class MainClassFinder extends Object
public static main
method by performing a breadth first
search.Modifier and Type | Class and Description |
---|---|
static interface |
MainClassFinder.ClassNameCallback<T>
Callback interface used to receive class names.
|
Constructor and Description |
---|
MainClassFinder() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
doWithMainClasses(File rootFolder,
MainClassFinder.ClassNameCallback<T> callback)
Perform the given callback operation on all main classes from the given root
folder.
|
static <T> T |
doWithMainClasses(JarFile jarFile,
String classesLocation,
MainClassFinder.ClassNameCallback<T> callback)
Perform the given callback operation on all main classes from the given jar.
|
static String |
findMainClass(File rootFolder)
Find the main class from a given folder.
|
static String |
findMainClass(JarFile jarFile,
String classesLocation)
Find the main class in a given jar file.
|
public static String findMainClass(File rootFolder) throws IOException
rootFolder
- the root folder to searchnull
IOException
public static <T> T doWithMainClasses(File rootFolder, MainClassFinder.ClassNameCallback<T> callback) throws IOException
rootFolder
- the root foldercallback
- the callbacknull
IOException
public static String findMainClass(JarFile jarFile, String classesLocation) throws IOException
jarFile
- the jar file to searchclassesLocation
- the location within the jar containing classesnull
IOException
public static <T> T doWithMainClasses(JarFile jarFile, String classesLocation, MainClassFinder.ClassNameCallback<T> callback) throws IOException
jarFile
- the jar file to searchclassesLocation
- the location within the jar containing classesnull
IOException
Copyright © 2014. All rights reserved.