private void checkOpenEjbHome(File openejbHome) throws Exception { try { String homePath = openejbHome.getAbsolutePath(); // The openejb.home must exist if (!openejbHome.exists()) handleError(BAD_HOME + homePath, NOT_THERE, INSTRUCTIONS); // The openejb.home must be a directory if (!openejbHome.isDirectory()) handleError(BAD_HOME + homePath, NOT_DIRECTORY, INSTRUCTIONS); // The openejb.home must contain a 'lib' directory File openejbHomeLibs = new File(openejbHome, "lib"); if (!openejbHomeLibs.exists()) handleError(BAD_HOME + homePath, NO_LIBS, INSTRUCTIONS); // The openejb.home there must be openejb*.jar files in the 'dist' // directory 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(); // The openejb.home must exist if (!openejbHome.exists()) { handleError(BAD_HOME + homePath, NOT_THERE, INSTRUCTIONS); } // The openejb.home must be a directory if (!openejbHome.isDirectory()) { handleError(BAD_HOME + homePath, NOT_DIRECTORY, INSTRUCTIONS); } // The openejb.home must contain a 'lib' directory final File openejbHomeLibs = new File(openejbHome, "lib"); if (!openejbHomeLibs.exists()) { handleError(BAD_HOME + homePath, NO_LIBS, INSTRUCTIONS); } // The openejb.home there must be openejb*.jar files in the 'dist' // directory 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(final File openejbHome) throws Exception { try { final String homePath = openejbHome.getAbsolutePath(); // The openejb.home must exist if (!openejbHome.exists()) { handleError(BAD_HOME + homePath, NOT_THERE, INSTRUCTIONS); } // The openejb.home must be a directory if (!openejbHome.isDirectory()) { handleError(BAD_HOME + homePath, NOT_DIRECTORY, INSTRUCTIONS); } // The openejb.home must contain a 'lib' directory final File openejbHomeLibs = new File(openejbHome, "lib"); if (!openejbHomeLibs.exists()) { handleError(BAD_HOME + homePath, NO_LIBS, INSTRUCTIONS); } // The openejb.home there must be openejb*.jar files in the 'dist' // directory 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(); } }