61
61
public class ExistRepository extends Observable implements BrokerPoolService {
62
62
63
63
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 ;
66
66
67
67
/** The wrapped EXPath repository. */
68
68
private Path expathDir ;
@@ -72,7 +72,7 @@ public class ExistRepository extends Observable implements BrokerPoolService {
72
72
public void configure (final Configuration configuration ) throws BrokerPoolServiceException {
73
73
final Path dataDir = Optional .ofNullable ((Path ) configuration .getProperty (BrokerPool .PROPERTY_DATA_DIR ))
74
74
.orElse (Paths .get (NativeBroker .DEFAULT_DATA_DIR ));
75
- this .expathDir = dataDir .resolve (EXPATH_REPO_DIR );
75
+ this .expathDir = dataDir .resolve (EXPATH_REPO_DIR_NAME );
76
76
}
77
77
78
78
@ Override
@@ -274,7 +274,7 @@ public List<URI> getJavaModules() {
274
274
public static Path getRepositoryDir (final Configuration config ) throws IOException {
275
275
final Path dataDir = Optional .ofNullable ((Path ) config .getProperty (BrokerPool .PROPERTY_DATA_DIR ))
276
276
.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 );
278
278
279
279
if (!Files .exists (expathDir )) {
280
280
moveOldRepo (config .getExistHome (), expathDir );
@@ -286,11 +286,11 @@ public static Path getRepositoryDir(final Configuration config) throws IOExcepti
286
286
private static void moveOldRepo (final Optional <Path > home , final Path newRepo ) {
287
287
final Path repo_dir = home .map (h -> {
288
288
if (FileUtils .fileName (h ).equals ("WEB-INF" )) {
289
- return h .resolve (EXPATH_REPO_DIR );
289
+ return h .resolve (EXPATH_REPO_DIR_NAME );
290
290
} else {
291
- return h .resolve ( EXPATH_REPO_DEFAULT );
291
+ return h .resolve (LEGACY_DEFAULT_EXPATH_REPO_DIR );
292
292
}
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 ));
294
294
295
295
if (Files .isReadable (repo_dir )) {
296
296
LOG .info ("Found old expathrepo directory. Moving to new default location: {}" , newRepo .toAbsolutePath ().toString ());
0 commit comments