Skip to content

Commit 7b9671d

Browse files
committed
[refactor] Improve variable naming
1 parent a85b483 commit 7b9671d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

exist-core/src/main/java/org/exist/repo/ExistRepository.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
public class ExistRepository extends Observable implements BrokerPoolService {
6262

6363
private final static Logger LOG = LogManager.getLogger(ExistRepository.class);
64-
public final static String EXPATH_REPO_DIR = "expathrepo";
65-
public final static String EXPATH_REPO_DEFAULT = "webapp/WEB-INF/" + EXPATH_REPO_DIR;
64+
private static final String EXPATH_REPO_DIR_NAME = "expathrepo";
65+
private static final String LEGACY_DEFAULT_EXPATH_REPO_DIR = "webapp/WEB-INF/" + EXPATH_REPO_DIR_NAME;
6666

6767
/** The wrapped EXPath repository. */
6868
private Path expathDir;
@@ -72,7 +72,7 @@ public class ExistRepository extends Observable implements BrokerPoolService {
7272
public void configure(final Configuration configuration) throws BrokerPoolServiceException {
7373
final Path dataDir = Optional.ofNullable((Path) configuration.getProperty(BrokerPool.PROPERTY_DATA_DIR))
7474
.orElse(Paths.get(NativeBroker.DEFAULT_DATA_DIR));
75-
this.expathDir = dataDir.resolve(EXPATH_REPO_DIR);
75+
this.expathDir = dataDir.resolve(EXPATH_REPO_DIR_NAME);
7676
}
7777

7878
@Override
@@ -274,7 +274,7 @@ public List<URI> getJavaModules() {
274274
public static Path getRepositoryDir(final Configuration config) throws IOException {
275275
final Path dataDir = Optional.ofNullable((Path) config.getProperty(BrokerPool.PROPERTY_DATA_DIR))
276276
.orElse(Paths.get(NativeBroker.DEFAULT_DATA_DIR));
277-
final Path expathDir = dataDir.resolve(EXPATH_REPO_DIR);
277+
final Path expathDir = dataDir.resolve(EXPATH_REPO_DIR_NAME);
278278

279279
if(!Files.exists(expathDir)) {
280280
moveOldRepo(config.getExistHome(), expathDir);
@@ -286,11 +286,11 @@ public static Path getRepositoryDir(final Configuration config) throws IOExcepti
286286
private static void moveOldRepo(final Optional<Path> home, final Path newRepo) {
287287
final Path repo_dir = home.map(h -> {
288288
if(FileUtils.fileName(h).equals("WEB-INF")) {
289-
return h.resolve(EXPATH_REPO_DIR);
289+
return h.resolve(EXPATH_REPO_DIR_NAME);
290290
} else {
291-
return h.resolve( EXPATH_REPO_DEFAULT);
291+
return h.resolve(LEGACY_DEFAULT_EXPATH_REPO_DIR);
292292
}
293-
}).orElse(Paths.get(System.getProperty("java.io.tmpdir")).resolve(EXPATH_REPO_DIR));
293+
}).orElse(Paths.get(System.getProperty("java.io.tmpdir")).resolve(EXPATH_REPO_DIR_NAME));
294294

295295
if (Files.isReadable(repo_dir)) {
296296
LOG.info("Found old expathrepo directory. Moving to new default location: {}", newRepo.toAbsolutePath().toString());

0 commit comments

Comments
 (0)