Skip to content

Commit

Permalink
Clean up and limit scope of Directories.getInstallationRoot()
Browse files Browse the repository at this point in the history
  • Loading branch information
ljacomet committed May 30, 2017
1 parent 6dc36d0 commit eb90a36
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions common/src/main/java/com/tc/config/Directories.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,15 @@ public class Directories {
/**
* Get installation root directory.
*
* @return Installation root directory or null if TC_INSTALL_ROOT_IGNORE_CHECKS_PROPERTY_NAME is set and
* @return Installation root directory or {@code user.dir} if TC_INSTALL_ROOT_IGNORE_CHECKS_PROPERTY_NAME is set and
* TC_INSTALL_ROOT_PROPERTY_NAME is not.
* @throws FileNotFoundException If {@link #TC_INSTALL_ROOT_PROPERTY_NAME} has not been set. If
* {@link #TC_INSTALL_ROOT_IGNORE_CHECKS_PROPERTY_NAME} has not been set, this exception may be thrown if the
* installation root directory has not been set, is not a directory
* @throws FileNotFoundException If {@link #TC_INSTALL_ROOT_IGNORE_CHECKS_PROPERTY_NAME} has not been set,
* this exception may be thrown if the installation root directory is not a directory
*/
public static File getInstallationRoot() throws FileNotFoundException {
static File getInstallationRoot() throws FileNotFoundException {
boolean ignoreCheck = Boolean.getBoolean(TC_INSTALL_ROOT_IGNORE_CHECKS_PROPERTY_NAME);
if (ignoreCheck) {
// XXX hack to have enterprise system tests to find license key under <ee-branch>/code/base
String baseDir = System.getProperty("tc.base-dir");
return new File(baseDir != null ? baseDir : ".", "../../../code/base");
return new File(System.getProperty("user.dir"));
} else {
String path = System.getProperty(TC_INSTALL_ROOT_PROPERTY_NAME);
if (StringUtils.isBlank(path)) {
Expand Down

0 comments on commit eb90a36

Please sign in to comment.