Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimone Bordet2016-02-09 11:50:26 -0500
committerSimone Bordet2016-02-09 11:50:26 -0500
commit145e4bee7139125408acc7388bf58531e96ae3d7 (patch)
tree161d14637db1ccd94ad025c0825d1b8a93ccf52a /jetty-quickstart
parente853632c2210eaf5225dd48618b482004dab38ef (diff)
downloadorg.eclipse.jetty.project-145e4bee7139125408acc7388bf58531e96ae3d7.tar.gz
org.eclipse.jetty.project-145e4bee7139125408acc7388bf58531e96ae3d7.tar.xz
org.eclipse.jetty.project-145e4bee7139125408acc7388bf58531e96ae3d7.zip
487511 - Jetty HTTP won't work on turkish systems.jetty-9.2.x
Fixed usages of toLowerCase() and toUpperCase() to use Locale.ENGLISH.
Diffstat (limited to 'jetty-quickstart')
-rw-r--r--jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/PreconfigureQuickStartWar.java18
-rw-r--r--jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/QuickStartWebApp.java51
2 files changed, 36 insertions, 33 deletions
diff --git a/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/PreconfigureQuickStartWar.java b/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/PreconfigureQuickStartWar.java
index b5df0f0784..d69032eab3 100644
--- a/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/PreconfigureQuickStartWar.java
+++ b/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/PreconfigureQuickStartWar.java
@@ -18,6 +18,8 @@
package org.eclipse.jetty.quickstart;
+import java.util.Locale;
+
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@@ -29,7 +31,7 @@ public class PreconfigureQuickStartWar
{
private static final Logger LOG = Log.getLogger(PreconfigureQuickStartWar.class);
static final boolean ORIGIN=LOG.isDebugEnabled();
-
+
public static void main(String... args) throws Exception
{
@@ -72,7 +74,7 @@ public class PreconfigureQuickStartWar
break;
}
-
+
preconfigure(war,dir,xml);
}
@@ -82,7 +84,7 @@ public class PreconfigureQuickStartWar
* @param xml A context XML to apply (or null if none)
* @throws Exception
*/
- public static void preconfigure(Resource war, Resource dir, Resource xml) throws Exception
+ public static void preconfigure(Resource war, Resource dir, Resource xml) throws Exception
{
// Do we need to unpack a war?
if (war != null)
@@ -94,14 +96,14 @@ public class PreconfigureQuickStartWar
dir.getFile().mkdirs();
JarResource.newJarResource(war).copyTo(dir.getFile());
}
-
+
final Server server = new Server();
QuickStartWebApp webapp = new QuickStartWebApp();
if (xml != null)
{
- if (xml.isDirectory() || !xml.toString().toLowerCase().endsWith(".xml"))
+ if (xml.isDirectory() || !xml.toString().toLowerCase(Locale.ENGLISH).endsWith(".xml"))
error("Bad context.xml: "+xml);
XmlConfiguration xmlConfiguration = new XmlConfiguration(xml.getURL());
xmlConfiguration.configure(webapp);
@@ -112,9 +114,9 @@ public class PreconfigureQuickStartWar
server.start();
server.stop();
}
-
-
-
+
+
+
private static void error(String message)
{
diff --git a/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/QuickStartWebApp.java b/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/QuickStartWebApp.java
index 91c1d09b1d..b6f396a40b 100644
--- a/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/QuickStartWebApp.java
+++ b/jetty-quickstart/src/main/java/org/eclipse/jetty/quickstart/QuickStartWebApp.java
@@ -19,6 +19,7 @@
package org.eclipse.jetty.quickstart;
import java.io.FileOutputStream;
+import java.util.Locale;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@@ -33,35 +34,35 @@ import org.eclipse.jetty.webapp.WebAppContext;
public class QuickStartWebApp extends WebAppContext
{
private static final Logger LOG = Log.getLogger(QuickStartWebApp.class);
-
-
-
- public static final String[] __configurationClasses = new String[]
+
+
+
+ public static final String[] __configurationClasses = new String[]
{
org.eclipse.jetty.quickstart.QuickStartConfiguration.class.getCanonicalName(),
org.eclipse.jetty.plus.webapp.EnvConfiguration.class.getCanonicalName(),
org.eclipse.jetty.plus.webapp.PlusConfiguration.class.getCanonicalName(),
org.eclipse.jetty.webapp.JettyWebXmlConfiguration.class.getCanonicalName()
};
-
-
+
+
private boolean _preconfigure=false;
private boolean _autoPreconfigure=false;
private boolean _startWebapp=false;
private PreconfigureDescriptorProcessor _preconfigProcessor;
-
+
public static final String[] __preconfigurationClasses = new String[]
- {
- org.eclipse.jetty.webapp.WebInfConfiguration.class.getCanonicalName(),
+ {
+ org.eclipse.jetty.webapp.WebInfConfiguration.class.getCanonicalName(),
org.eclipse.jetty.webapp.WebXmlConfiguration.class.getCanonicalName(),
- org.eclipse.jetty.webapp.MetaInfConfiguration.class.getCanonicalName(),
+ org.eclipse.jetty.webapp.MetaInfConfiguration.class.getCanonicalName(),
org.eclipse.jetty.webapp.FragmentConfiguration.class.getCanonicalName(),
- org.eclipse.jetty.plus.webapp.EnvConfiguration.class.getCanonicalName(),
+ org.eclipse.jetty.plus.webapp.EnvConfiguration.class.getCanonicalName(),
org.eclipse.jetty.plus.webapp.PlusConfiguration.class.getCanonicalName(),
org.eclipse.jetty.annotations.AnnotationConfiguration.class.getCanonicalName(),
};
-
+
public QuickStartWebApp()
{
super();
@@ -76,7 +77,7 @@ public class QuickStartWebApp extends WebAppContext
/* ------------------------------------------------------------ */
/** Preconfigure webapp
- * @param preconfigure If true, then starting the webapp will generate
+ * @param preconfigure If true, then starting the webapp will generate
* the WEB-INF/quickstart-web.xml rather than start the webapp.
*/
public void setPreconfigure(boolean preconfigure)
@@ -88,22 +89,22 @@ public class QuickStartWebApp extends WebAppContext
{
return _autoPreconfigure;
}
-
+
public void setAutoPreconfigure(boolean autoPrecompile)
{
_autoPreconfigure = autoPrecompile;
}
-
+
@Override
protected void startWebapp() throws Exception
{
if (isPreconfigure())
generateQuickstartWebXml(_preconfigProcessor.getXML());
-
+
if (_startWebapp)
super.startWebapp();
}
-
+
@Override
protected void doStart() throws Exception
{
@@ -117,14 +118,14 @@ public class QuickStartWebApp extends WebAppContext
if (base.isDirectory())
dir=base;
- else if (base.toString().toLowerCase().endsWith(".war"))
+ else if (base.toString().toLowerCase(Locale.ENGLISH).endsWith(".war"))
{
war=base;
String w=war.toString();
dir=Resource.newResource(w.substring(0,w.length()-4));
if (!dir.exists())
- {
+ {
LOG.info("Quickstart Extract " + war + " to " + dir);
dir.getFile().mkdirs();
JarResource.newJarResource(war).copyTo(dir.getFile());
@@ -133,12 +134,12 @@ public class QuickStartWebApp extends WebAppContext
setWar(null);
setBaseResource(dir);
}
- else
+ else
throw new IllegalArgumentException();
Resource qswebxml=dir.addPath("/WEB-INF/quickstart-web.xml");
-
+
if (isPreconfigure())
{
_preconfigProcessor = new PreconfigureDescriptorProcessor();
@@ -151,17 +152,17 @@ public class QuickStartWebApp extends WebAppContext
_startWebapp=true;
}
else if (_autoPreconfigure)
- {
+ {
LOG.info("Quickstart preconfigure: {}(war={},dir={})",this,war,dir);
- _preconfigProcessor = new PreconfigureDescriptorProcessor();
+ _preconfigProcessor = new PreconfigureDescriptorProcessor();
getMetaData().addDescriptorProcessor(_preconfigProcessor);
setPreconfigure(true);
_startWebapp=true;
}
else
_startWebapp=true;
-
+
super.doStart();
}
@@ -178,5 +179,5 @@ public class QuickStartWebApp extends WebAppContext
}
}
-
+
}

Back to the top