Skip to content

Commit

Permalink
Handle finding the skyve json config file by convention in war or ear
Browse files Browse the repository at this point in the history
deployments.
  • Loading branch information
sandsm committed Nov 29, 2016
1 parent aab538c commit 1fbbb57
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions skyve-web/src/org/skyve/impl/web/SkyveContextListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,17 @@ public void contextInitialized(ServletContextEvent evt) {
}
if (propertiesFilePath == null) {
UtilImpl.LOGGER.info("SKYVE CONTEXT REAL PATH = " + UtilImpl.SKYVE_CONTEXT_REAL_PATH);
File ear = new File(UtilImpl.SKYVE_CONTEXT_REAL_PATH).getParentFile();
String earName = ear.getName();
earName = earName.substring(0, earName.length() - 4);
propertiesFilePath = ear.getParent() + '/' + earName + ".json";
File archive = new File(UtilImpl.SKYVE_CONTEXT_REAL_PATH);
String archiveName = null;
if (archive.getParentFile().getName().endsWith("ear")) {
archive = archive.getParentFile();
archiveName = archive.getName();
}
else {
archiveName = archive.getName();
}
archiveName = archiveName.substring(0, archiveName.length() - 4);
propertiesFilePath = archive.getParent() + '/' + archiveName + ".json";
}

Map<String, Object> properties = null;
Expand Down

0 comments on commit 1fbbb57

Please sign in to comment.