@Test public void testWrongInputDir() { dependencyGraph = DependencyGraphFactory.createGraph(); Map<String, String> parameters = Maps.newHashMap(); parameters.put("baseDir", "not-existing"); new JavaScopeReader(dependencyGraph, true).read(parameters); assertThat(dependencyGraph.getAllNodes(), hasSize(0)); }
public void read(Map parameters) { String baseDirName = (String) parameters.get(BASE_DIR_KEY); if (StringUtils.isEmpty(baseDirName)) { LOGGER.warn("{} missing - no files will be read!", BASE_DIR_KEY); } else { File baseDir = new File(baseDirName); if (!baseDir.exists()) { LOGGER.warn("baseDir {} missing - no files will be read!", baseDir.getAbsolutePath()); } else if (baseDir.isDirectory()) { readDirectory(baseDir, parameters); } else { readJarFile(baseDir, parameters); } } }
JavaScopeReader { public void read(Map parameters) { String baseDirName = (String) parameters.get(BASE_DIR_KEY); if (StringUtils.isEmpty(baseDirName)) { LOGGER.warn("{} missing - no files will be read!", BASE_DIR_KEY); } else { File baseDir = new File(baseDirName); if (!baseDir.exists()) { LOGGER.warn("baseDir {} missing - no files will be read!", baseDir.getAbsolutePath()); } else if (baseDir.isDirectory()) { readDirectory(baseDir, parameters); } else { readJarFile(baseDir, parameters); } } } }
JavaScopeReader { public void read(Map parameters) { String baseDirName = (String) parameters.get(BASE_DIR_KEY); if (StringUtils.isEmpty(baseDirName)) { LOGGER.warn("{} missing - no files will be read!", BASE_DIR_KEY); } else { File baseDir = new File(baseDirName); if (!baseDir.exists()) { LOGGER.warn("baseDir {} missing - no files will be read!", baseDir.getAbsolutePath()); } else if (baseDir.isDirectory()) { readDirectory(baseDir, parameters); } else { readJarFile(baseDir, parameters); } } } JavaScopeReader(DependencyGraph dependencyGraph, boolean collapseInnerClasses); }
JavaScopeReader { public void read(Map parameters) { String baseDirName = (String) parameters.get(BASE_DIR_KEY); if (StringUtils.isEmpty(baseDirName)) { LOGGER.warn("{} missing - no files will be read!", BASE_DIR_KEY); } else { File baseDir = new File(baseDirName); if (!baseDir.exists()) { LOGGER.warn("baseDir {} missing - no files will be read!", baseDir.getAbsolutePath()); } else if (baseDir.isDirectory()) { readDirectory(baseDir, parameters); } else { readJarFile(baseDir, parameters); } } } JavaScopeReader(DependencyGraph dependencyGraph, boolean collapseInnerClasses); void read(Map parameters); }
JavaScopeReader { public void read(Map parameters) { String baseDirName = (String) parameters.get(BASE_DIR_KEY); if (StringUtils.isEmpty(baseDirName)) { LOGGER.warn("{} missing - no files will be read!", BASE_DIR_KEY); } else { File baseDir = new File(baseDirName); if (!baseDir.exists()) { LOGGER.warn("baseDir {} missing - no files will be read!", baseDir.getAbsolutePath()); } else if (baseDir.isDirectory()) { readDirectory(baseDir, parameters); } else { readJarFile(baseDir, parameters); } } } JavaScopeReader(DependencyGraph dependencyGraph, boolean collapseInnerClasses); void read(Map parameters); static final String BASE_DIR_KEY; }