diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Config.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Config.java
index 72a02c2e110..1af85edaa97 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/Config.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Config.java
@@ -204,9 +204,7 @@ public class Config
__instance=this;
_homebase = new HomeBase();
setProperty("jetty.home",_homebase.getHome());
- if(_homebase.hasBase()) {
- setProperty("jetty.base",_homebase.getBase());
- }
+ setProperty("jetty.base",_homebase.getBase());
}
public HomeBase getHomeBase()
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/FS.java b/jetty-start/src/main/java/org/eclipse/jetty/start/FS.java
index abcaad75a32..1a5999103d6 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/FS.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/FS.java
@@ -22,6 +22,7 @@ import java.io.Closeable;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
+import java.util.Locale;
import java.util.regex.Pattern;
public class FS
@@ -122,7 +123,7 @@ public class FS
public static boolean isXml(String filename)
{
- return Pattern.compile(".xml$",Pattern.CASE_INSENSITIVE).matcher(filename).matches();
+ return filename.toLowerCase(Locale.ENGLISH).endsWith(".xml");
}
public static String separators(String path)
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/HomeBase.java b/jetty-start/src/main/java/org/eclipse/jetty/start/HomeBase.java
index 8b4153515da..b225f2832b4 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/HomeBase.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/HomeBase.java
@@ -28,7 +28,13 @@ import java.util.List;
import java.util.Objects;
/**
- * File access for ${jetty.home}
, and optional ${jetty.base}
, directories.
+ * File access for ${jetty.home}
, ${jetty.base}
, directories.
+ *
+ * By default, both ${jetty.home}
and ${jetty.base}
are the same directory, but they can point at different directories.
+ *
+ * The ${jetty.home}
directory is where the main Jetty binaries and default configuration is housed.
+ *
+ * The ${jetty.base}
directory is where the execution specific configuration and webapps are obtained from.
*/
public class HomeBase
{
@@ -39,11 +45,7 @@ public class HomeBase
{
String userDir = System.getProperty("user.dir");
this.homeDir = new File(System.getProperty("jetty.home",userDir));
- String base = System.getProperty("jetty.base");
- if (base != null)
- {
- this.baseDir = new File(base);
- }
+ this.baseDir = new File(System.getProperty("jetty.base",homeDir.getAbsolutePath()));
}
public HomeBase(File homeDir, File baseDir)
@@ -51,12 +53,12 @@ public class HomeBase
this.homeDir = homeDir;
this.baseDir = baseDir;
}
-
- public boolean hasBase()
+
+ public boolean isBaseDifferent()
{
- return this.baseDir != null;
+ return homeDir.compareTo(baseDir) != 0;
}
-
+
public void setBaseDir(File dir)
{
this.baseDir = dir;
@@ -95,7 +97,7 @@ public class HomeBase
String rpath = FS.separators(path);
// Relative to Base Directory First
- if (baseDir != null)
+ if (isBaseDifferent())
{
File file = new File(baseDir,rpath);
if (file.exists())
@@ -114,7 +116,7 @@ public class HomeBase
// Finally, as an absolute path
return new File(rpath);
}
-
+
public void setHomeDir(File dir)
{
this.homeDir = dir;
@@ -165,7 +167,7 @@ public class HomeBase
List${jetty.base}
and ${jetty.home}
, with
- * , even if the same file shows up in both places.
+ * Collect the list of files in both ${jetty.base}
and ${jetty.home}
, with , even if the same file shows up in both places.
*/
public List