org.apache.maven.jdeveloper
Class JavaSourceTool
java.lang.Object
org.apache.maven.jdeveloper.JavaSourceTool
- public class JavaSourceTool
- extends Object
- Author:
- Ben Walding
Method Summary |
static String |
getPackagePath(String absoluteFileName)
Extracts the package name from the java source file and returns it as
a directory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JavaSourceTool
public JavaSourceTool()
getPackagePath
public static final String getPackagePath(String absoluteFileName)
throws IOException
- Extracts the package name from the java source file and returns it as
a directory. For example if the file name is :
"e:\tmp\src\main\org\apache\maven\Code.java", and
Code.java
is in the org.apache.maven
package, this method will
return "org\apache\maven\Code.java" (or "org/apache/maven/Code.java" on
unix).
- Parameters:
absoluteFileName
- the absolute file name to transform
- Returns:
- the shortened file name matching the class package name.
- Throws:
IOException
- upon failure to read the java file
Copyright © 2002-2006 Apache Software Foundation. All Rights Reserved.