src/main/java/org/jboss/loom/utils/as7/AS7ModuleUtils.java
public static String identifyModuleContainingJar( AS7Config as7Config, File jar ) {
        
        String modAbsPath = as7Config.getModulesDir().getPath();
        String jarAbsPath = jar.getParentFile().getParentFile().getPath();
        
        String commonPrefix = StringUtils.getCommonPrefix( new String[]{ modAbsPath, jarAbsPath } );
        String diff = jarAbsPath.substring( commonPrefix.length() );
        
        String modName = StringUtils.removeStart( diff, "/" );
        return modName.replace('/', '.');
    }
/**
     *  Returns the name of the module which uses given .jar.
     *  For example, file at modules/system/layers/base/com/h2database/h2/main/h2-1.3.168.jar
     *  should return "com.h2database.h2".
     * 
     *  The current implementation is naive, assuming that the .jar file is in the module's root dir, where module.xml is.
     * 
     *  This method behavior is likely to change with various versions of EAP.
     */
Returns the name of the module which uses given .jar.

The current implementation is naive, assuming that the .jar file is in the module's root dir, where module.xml is.

This method behavior is likely to change with various versions of EAP.
Returns the name of the module which uses given . jar . The current implementation is naive assuming that the . jar file is in the module ' s root dir where module . xml is . This method behavior is likely to change with various versions of EAP .
public static String identifyModuleContainingJar( AS7Config as7Config, File jar ) {
        String modAbsPath = as7Config.getModulesDir().getPath();
        String jarAbsPath = jar.getParentFile().getParentFile().getPath();
        String commonPrefix = StringUtils.getCommonPrefix( new String[]{ modAbsPath, jarAbsPath } );
        String diff = jarAbsPath.substring( commonPrefix.length() );
        String modName = StringUtils.removeStart( diff, "/" );
        return modName.replace('/', '.');
    }
public static String identifyModuleContainingJar ( AS7Config as7Config , File jar ) { String modAbsPath = as7Config . getModulesDir ( ) . getPath ( ) ; String jarAbsPath = jar . getParentFile ( ) . getParentFile ( ) . getPath ( ) ; String commonPrefix = StringUtils . getCommonPrefix ( new String [ ] { modAbsPath , jarAbsPath } ) ; String diff = jarAbsPath . substring ( commonPrefix . length ( ) ) ; String modName = StringUtils . removeStart ( diff , "/" ) ; return modName . replace ( '/' , '.' ) ; }
Returns the name of the module which uses given .jar.
Returns the name of the module which uses given . jar .