@Test public void testIdentifyModuleContainingJar() throws IOException { System.out.println( "identifyModuleContainingJar" ); Configuration conf = TestAppConfig.createTestConfig_EAP_520("production"); AS7Config as7conf = conf.getGlobal().getAS7Config(); File jar = Utils.createPath( as7conf.getModulesDir(), "com/h2database/h2/main/h2-1.3.168.jar" ); String expResult = "com.h2database.h2"; String result = AS7ModuleUtils.identifyModuleContainingJar( as7conf, jar ); assertEquals( expResult, result ); }
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('/', '.'); }
AS7ModuleUtils { 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('/', '.'); } }
AS7ModuleUtils { 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('/', '.'); }  }
AS7ModuleUtils { 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('/', '.'); }  static void createModuleXML_FreeMarker( ModuleXmlInfo moduleInfo, File modFile ); static Document createModuleXML(String moduleName, String jarFile, String[] deps); static File transformDocToFile(Document doc, File file); static String identifyModuleContainingJar( AS7Config as7Config, File jar ); }
AS7ModuleUtils { 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('/', '.'); }  static void createModuleXML_FreeMarker( ModuleXmlInfo moduleInfo, File modFile ); static Document createModuleXML(String moduleName, String jarFile, String[] deps); static File transformDocToFile(Document doc, File file); static String identifyModuleContainingJar( AS7Config as7Config, File jar );  }