private void checkOpenEjbHome(final File openejbHome) throws Exception { try { final String homePath = openejbHome.getAbsolutePath(); if (!openejbHome.exists()) { handleError(BAD_HOME + homePath, NOT_THERE, INSTRUCTIONS); } if (!openejbHome.isDirectory()) { handleError(BAD_HOME + homePath, NOT_DIRECTORY, INSTRUCTIONS); } final File openejbHomeLibs = new File(openejbHome, "lib"); if (!openejbHomeLibs.exists()) { handleError(BAD_HOME + homePath, NO_DIST, INSTRUCTIONS); } final String[] libs = openejbHomeLibs.list(); boolean found = false; for (int i = 0; i < libs.length && !found; i++) { found = (libs[i].startsWith("openejb-") && libs[i].endsWith(".jar")); } if (!found) { handleError(BAD_HOME + homePath, NO_LIBS, INSTRUCTIONS); } } catch (final Exception e) { e.printStackTrace(); } }
private void checkOpenEjbHome(File openejbHome) throws Exception { try { String homePath = openejbHome.getAbsolutePath(); if (!openejbHome.exists()) handleError(BAD_HOME + homePath, NOT_THERE, INSTRUCTIONS); if (!openejbHome.isDirectory()) handleError(BAD_HOME + homePath, NOT_DIRECTORY, INSTRUCTIONS); File openejbHomeLibs = new File(openejbHome, "lib"); if (!openejbHomeLibs.exists()) handleError(BAD_HOME + homePath, NO_DIST, INSTRUCTIONS); String[] libs = openejbHomeLibs.list(); boolean found = false; for (int i = 0; i < libs.length && !found; i++) { found = (libs[i].startsWith("openejb-") && libs[i].endsWith(".jar")); } if (!found) handleError(BAD_HOME + homePath, NO_LIBS, INSTRUCTIONS); } catch (Exception e) { e.printStackTrace(); } }
private void checkOpenEjbHome(final File openejbHome) throws Exception { try { final String homePath = openejbHome.getAbsolutePath(); if (!openejbHome.exists()) { handleError(BAD_HOME + homePath, NOT_THERE, INSTRUCTIONS); } if (!openejbHome.isDirectory()) { handleError(BAD_HOME + homePath, NOT_DIRECTORY, INSTRUCTIONS); } final File openejbHomeLibs = new File(openejbHome, "lib"); if (!openejbHomeLibs.exists()) { handleError(BAD_HOME + homePath, NO_DIST, INSTRUCTIONS); } final String[] libs = openejbHomeLibs.list(); boolean found = false; for (int i = 0; i < libs.length && !found; i++) { found = (libs[i].startsWith("openejb-") && libs[i].endsWith(".jar")); } if (!found) { handleError(BAD_HOME + homePath, NO_LIBS, INSTRUCTIONS); } } catch (final Exception e) { e.printStackTrace(); } }