| 1 |
|
package org.codehaus.mojo.exec; |
| 2 |
|
|
| 3 |
|
import java.util.Timer; |
| 4 |
|
import java.util.TimerTask; |
| 5 |
|
|
| 6 |
|
|
| 7 |
|
@author |
| 8 |
|
|
|
|
|
| 0% |
Uncovered Elements: 16 (16) |
Complexity: 5 |
Complexity Density: 0.5 |
|
| 9 |
|
public class FindClassInClasspath |
| 10 |
|
{ |
| 11 |
|
public static final String FOUND_ALL = "OK"; |
| 12 |
|
|
| 13 |
|
|
| 14 |
|
@param |
| 15 |
|
|
| 16 |
|
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
| 17 |
0
|
public static void main( String[] args )... |
| 18 |
|
{ |
| 19 |
0
|
for (int i = 0; i < args.length; i++) |
| 20 |
|
{ |
| 21 |
0
|
if ( ! isClassInClasspath( args[i] )) |
| 22 |
|
{ |
| 23 |
0
|
System.out.println( "ERROR: class + " + args[i] + " not found in classpath" ); |
| 24 |
0
|
System.exit( 1 ); |
| 25 |
|
} |
| 26 |
|
} |
| 27 |
0
|
System.out.println( FOUND_ALL ); |
| 28 |
|
} |
| 29 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 30 |
0
|
private static boolean isClassInClasspath( String className )... |
| 31 |
|
{ |
| 32 |
0
|
try |
| 33 |
|
{ |
| 34 |
0
|
Class.forName( className ); |
| 35 |
0
|
return true; |
| 36 |
|
} catch ( Exception e ) |
| 37 |
|
{ |
| 38 |
0
|
System.out.println( "ERROR: " + e.getMessage() ); |
| 39 |
0
|
return false; |
| 40 |
|
} |
| 41 |
|
} |
| 42 |
|
} |