chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1362826 - in /chemistry/opencmis/trunk: chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/ chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/...
Date Wed, 18 Jul 2012 09:20:21 GMT
Author: fmui
Date: Wed Jul 18 09:20:20 2012
New Revision: 1362826

URL: http://svn.apache.org/viewvc?rev=1362826&view=rev
Log:
fixed potential charset and locale issues

Added:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/QueryStringHttpServletRequestWrapper.java
  (with props)
Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/ContentTypeCacheLevelImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/util/FileUtils.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/MimeHelper.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/MimeTypes.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ControlParser.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultipartParser.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/POSTHttpServletRequestWrapper.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/BasicAuthCallContextHandler.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/CmisTckAntTask.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/SecurityTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/NameCharsetTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ObjectPanel.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/InfoPanel.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/ContentTypeCacheLevelImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/ContentTypeCacheLevelImpl.java?rev=1362826&r1=1362825&r2=1362826&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/ContentTypeCacheLevelImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/ContentTypeCacheLevelImpl.java
Wed Jul 18 09:20:20 2012
@@ -24,9 +24,6 @@ import java.util.TreeMap;
 
 /**
  * Content type cache.
- *
- * @author <a href="mailto:fmueller@opentext.com">Florian M&uuml;ller</a>
- *
  */
 public class ContentTypeCacheLevelImpl extends MapCacheLevelImpl {
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/util/FileUtils.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/util/FileUtils.java?rev=1362826&r1=1362825&r2=1362826&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/util/FileUtils.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/util/FileUtils.java
Wed Jul 18 09:20:20 2012
@@ -28,6 +28,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
 import java.math.BigInteger;
 import java.util.HashMap;
 import java.util.Map;
@@ -178,9 +179,18 @@ public class FileUtils {
         properties.put(PropertyIds.OBJECT_TYPE_ID, type);
         properties.put(PropertyIds.NAME, name);
 
-        ByteArrayInputStream bais = new ByteArrayInputStream(content == null ? new byte[0]
: content.getBytes());
-        ContentStream contentStream = new ContentStreamImpl(name, BigInteger.valueOf(content
== null ? 0 : content
-                .getBytes().length), "text/plain", bais);
+        byte[] contentBytes = new byte[0];
+        if (content != null) {
+            try {
+                contentBytes = content.getBytes("UTF-8");
+            } catch (UnsupportedEncodingException e) {
+                contentBytes = content.getBytes();
+            }
+        }
+
+        ByteArrayInputStream bais = new ByteArrayInputStream(contentBytes);
+        ContentStream contentStream = new ContentStreamImpl(name, BigInteger.valueOf(contentBytes.length),
+                "text/plain", bais);
 
         return parentFolder.createDocument(properties, contentStream, versioningState);
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/MimeHelper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/MimeHelper.java?rev=1362826&r1=1362825&r2=1362826&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/MimeHelper.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/MimeHelper.java
Wed Jul 18 09:20:20 2012
@@ -25,6 +25,7 @@ package org.apache.chemistry.opencmis.co
 import java.io.ByteArrayOutputStream;
 import java.io.UnsupportedEncodingException;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 
 /**
@@ -566,7 +567,7 @@ public class MimeHelper {
 
                 // get the parameter name as a lower case version for better
                 // mapping.
-                String name = token.getValue().toLowerCase();
+                String name = token.getValue().toLowerCase(Locale.ENGLISH);
 
                 token = tokenizer.next();
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/MimeTypes.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/MimeTypes.java?rev=1362826&r1=1362825&r2=1362826&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/MimeTypes.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/MimeTypes.java
Wed Jul 18 09:20:20 2012
@@ -21,13 +21,14 @@ package org.apache.chemistry.opencmis.co
 import java.io.File;
 import java.net.URLConnection;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 
 public class MimeTypes {
 
     private static final Map<String, String> EXT2MIME = new HashMap<String, String>();
     private static final Map<String, String> MIME2EXT = new HashMap<String, String>();
-    
+
     private MimeTypes() {
     }
 
@@ -389,7 +390,7 @@ public class MimeTypes {
         if (x > -1) {
             mimeType = mimeType.substring(0, x);
         }
-        mimeType = mimeType.trim().toLowerCase();
+        mimeType = mimeType.trim().toLowerCase(Locale.ENGLISH);
 
         String extension = MIME2EXT.get(mimeType);
         return ((extension == null || extension.length() == 0) ? "" : "." + extension);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java?rev=1362826&r1=1362825&r2=1362826&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java
Wed Jul 18 09:20:20 2012
@@ -25,6 +25,7 @@ import java.io.InputStream;
 import java.math.BigInteger;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 import javax.xml.bind.JAXBElement;
@@ -280,7 +281,7 @@ public class AtomEntryParser {
             if (ATTR_TYPE.equals(attrName.getLocalPart())) {
                 atomContentStream.setMimeType(parser.getAttributeValue(i));
                 if (parser.getAttributeValue(i) != null) {
-                    type = parser.getAttributeValue(i).trim().toLowerCase();
+                    type = parser.getAttributeValue(i).trim().toLowerCase(Locale.ENGLISH);
                 }
             } else if (ATTR_SRC.equals(attrName.getLocalPart())) {
                 if (ignoreAtomContentSrc) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java?rev=1362826&r1=1362825&r2=1362826&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
Wed Jul 18 09:20:20 2012
@@ -76,6 +76,7 @@ import org.apache.chemistry.opencmis.ser
 import org.apache.chemistry.opencmis.server.shared.Dispatcher;
 import org.apache.chemistry.opencmis.server.shared.ExceptionHelper;
 import org.apache.chemistry.opencmis.server.shared.HttpUtils;
+import org.apache.chemistry.opencmis.server.shared.QueryStringHttpServletRequestWrapper;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -168,6 +169,8 @@ public class CmisAtomPubServlet extends 
     @Override
     protected void service(HttpServletRequest request, HttpServletResponse response) throws
ServletException,
             IOException {
+        QueryStringHttpServletRequestWrapper qsRequest = new QueryStringHttpServletRequestWrapper(request);
+
         // set default headers
         response.addHeader("Cache-Control", "private, max-age=0");
         response.addHeader("Server", ServerVersion.OPENCMIS_SERVER);
@@ -175,9 +178,9 @@ public class CmisAtomPubServlet extends 
         // create a context object, dispatch and handle exceptions
         CallContext context = null;
         try {
-            context = HttpUtils.createContext(request, response, getServletContext(), CallContext.BINDING_ATOMPUB,
+            context = HttpUtils.createContext(qsRequest, response, getServletContext(), CallContext.BINDING_ATOMPUB,
                     callContextHandler, tempDir, memoryThreshold, maxContentSize);
-            dispatch(context, request, response);
+            dispatch(context, qsRequest, response);
         } catch (Exception e) {
             if (e instanceof CmisPermissionDeniedException) {
                 if ((context == null) || (context.getUsername() == null)) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java?rev=1362826&r1=1362825&r2=1362826&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/CmisBrowserBindingServlet.java
Wed Jul 18 09:20:20 2012
@@ -113,6 +113,7 @@ import org.apache.chemistry.opencmis.ser
 import org.apache.chemistry.opencmis.server.shared.Dispatcher;
 import org.apache.chemistry.opencmis.server.shared.ExceptionHelper;
 import org.apache.chemistry.opencmis.server.shared.HttpUtils;
+import org.apache.chemistry.opencmis.server.shared.QueryStringHttpServletRequestWrapper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -309,11 +310,13 @@ public class CmisBrowserBindingServlet e
             boolean methodFound = false;
 
             if (METHOD_GET.equals(method)) {
-                String selector = getStringParameter(request, Constants.PARAM_SELECTOR);
-                String objectId = getStringParameter(request, PARAM_OBJECT_ID);
+                QueryStringHttpServletRequestWrapper getRequest = new QueryStringHttpServletRequestWrapper(request);
+
+                String selector = getStringParameter(getRequest, Constants.PARAM_SELECTOR);
+                String objectId = getStringParameter(getRequest, PARAM_OBJECT_ID);
 
                 // add object id and object base type id to context
-                prepareContext(context, callUrl, service, repositoryId, objectId, null, request);
+                prepareContext(context, callUrl, service, repositoryId, objectId, null, getRequest);
 
                 // dispatch
                 if (callUrl == CallUrl.REPOSITORY) {
@@ -322,7 +325,7 @@ public class CmisBrowserBindingServlet e
                     }
 
                     methodFound = repositoryDispatcher.dispatch(selector, method, context,
service, repositoryId,
-                            request, response);
+                            getRequest, response);
                 } else if (callUrl == CallUrl.ROOT) {
                     // set default method if necessary
                     if (selector == null) {
@@ -344,7 +347,7 @@ public class CmisBrowserBindingServlet e
                         }
                     }
 
-                    methodFound = rootDispatcher.dispatch(selector, method, context, service,
repositoryId, request,
+                    methodFound = rootDispatcher.dispatch(selector, method, context, service,
repositoryId, getRequest,
                             response);
                 }
             } else if (METHOD_POST.equals(method)) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ControlParser.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ControlParser.java?rev=1362826&r1=1362825&r2=1362826&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ControlParser.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ControlParser.java
Wed Jul 18 09:20:20 2012
@@ -21,6 +21,7 @@ package org.apache.chemistry.opencmis.se
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
@@ -48,7 +49,7 @@ public class ControlParser {
         // gather all controls
         Map<String, String[]> controls = request.getParameterMap();
         for (Map.Entry<String, String[]> control : controls.entrySet()) {
-            String controlName = control.getKey().trim().toLowerCase();
+            String controlName = control.getKey().trim().toLowerCase(Locale.ENGLISH);
 
             int firstIndex = getFirstIndex(controlName);
 
@@ -153,7 +154,7 @@ public class ControlParser {
             throw new IllegalArgumentException("controlName must not be null!");
         }
 
-        return zeroDim.get(controlName.toLowerCase());
+        return zeroDim.get(controlName.toLowerCase(Locale.ENGLISH));
     }
 
     public List<String> getValues(String controlName) {
@@ -161,7 +162,7 @@ public class ControlParser {
             throw new IllegalArgumentException("controlName must not be null!");
         }
 
-        return convertToList(controlName, oneDim.get(controlName.toLowerCase()));
+        return convertToList(controlName, oneDim.get(controlName.toLowerCase(Locale.ENGLISH)));
     }
 
     public List<String> getValues(String controlName, int index) {
@@ -169,7 +170,7 @@ public class ControlParser {
             throw new IllegalArgumentException("controlName must not be null!");
         }
 
-        Map<Integer, Map<Integer, String>> map = twoDim.get(controlName.toLowerCase());
+        Map<Integer, Map<Integer, String>> map = twoDim.get(controlName.toLowerCase(Locale.ENGLISH));
         if (map == null) {
             return null;
         }
@@ -182,7 +183,7 @@ public class ControlParser {
             throw new IllegalArgumentException("controlName must not be null!");
         }
 
-        return oneDim.get(controlName.toLowerCase());
+        return oneDim.get(controlName.toLowerCase(Locale.ENGLISH));
     }
 
     public Map<Integer, Map<Integer, String>> getTwoDimMap(String controlName)
{
@@ -190,6 +191,6 @@ public class ControlParser {
             throw new IllegalArgumentException("controlName must not be null!");
         }
 
-        return twoDim.get(controlName.toLowerCase());
+        return twoDim.get(controlName.toLowerCase(Locale.ENGLISH));
     }
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultipartParser.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultipartParser.java?rev=1362826&r1=1362825&r2=1362826&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultipartParser.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultipartParser.java
Wed Jul 18 09:20:20 2012
@@ -26,6 +26,7 @@ import java.io.UnsupportedEncodingExcept
 import java.math.BigInteger;
 import java.util.Arrays;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
@@ -284,7 +285,7 @@ public class MultipartParser {
         while ((line = readLine()).length() > 0) {
             int x = line.indexOf(':');
             if (x > 0) {
-                headers.put(line.substring(0, x).toLowerCase().trim(), line.substring(x +
1).trim());
+                headers.put(line.substring(0, x).toLowerCase(Locale.ENGLISH).trim(), line.substring(x
+ 1).trim());
             }
         }
     }
@@ -502,7 +503,7 @@ public class MultipartParser {
     public static final boolean isMultipartContent(HttpServletRequest request) {
         String contentType = request.getContentType();
 
-        if (contentType != null && contentType.toLowerCase().startsWith(MULTIPART))
{
+        if (contentType != null && contentType.toLowerCase(Locale.ENGLISH).startsWith(MULTIPART))
{
             return true;
         }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/POSTHttpServletRequestWrapper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/POSTHttpServletRequestWrapper.java?rev=1362826&r1=1362825&r2=1362826&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/POSTHttpServletRequestWrapper.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/POSTHttpServletRequestWrapper.java
Wed Jul 18 09:20:20 2012
@@ -22,21 +22,15 @@ import java.io.File;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.math.BigInteger;
-import java.net.URLDecoder;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
 
 import org.apache.chemistry.opencmis.commons.impl.Constants;
 import org.apache.chemistry.opencmis.server.shared.HttpUtils;
+import org.apache.chemistry.opencmis.server.shared.QueryStringHttpServletRequestWrapper;
 
-public class POSTHttpServletRequestWrapper extends HttpServletRequestWrapper {
+public class POSTHttpServletRequestWrapper extends QueryStringHttpServletRequestWrapper {
     private final boolean isMultipart;
-    private Map<String, String[]> parameters;
     private String filename;
     private String contentType;
     private BigInteger size;
@@ -46,11 +40,6 @@ public class POSTHttpServletRequestWrapp
             long maxContentSize) throws Exception {
         super(request);
 
-        parameters = new HashMap<String, String[]>();
-
-        // parse query string
-        parseFormData(request.getQueryString());
-
         // check multipart
         isMultipart = MultipartParser.isMultipartContent(request);
 
@@ -92,61 +81,6 @@ public class POSTHttpServletRequestWrapp
         }
     }
 
-    private void parseFormData(String data) throws Exception {
-        if (data == null || data.length() < 3) {
-            return;
-        }
-
-        String[] nameValuePairs = data.split("&");
-        for (String nameValuePair : nameValuePairs) {
-            int x = nameValuePair.indexOf('=');
-            if (x > 0) {
-                String name = URLDecoder.decode(nameValuePair.substring(0, x), "UTF-8");
-                String value = (x == nameValuePair.length() - 1 ? "" : URLDecoder.decode(
-                        nameValuePair.substring(x + 1), "UTF-8"));
-                addParameter(name, value);
-            }
-        }
-    }
-
-    private void addParameter(String name, String value) {
-        String[] values = parameters.get(name);
-
-        if (values == null) {
-            parameters.put(name, new String[] { value });
-        } else {
-            String[] newValues = new String[values.length + 1];
-            System.arraycopy(values, 0, newValues, 0, values.length);
-            newValues[newValues.length - 1] = value;
-            parameters.put(name, newValues);
-        }
-    }
-
-    @Override
-    public String getParameter(String name) {
-        String[] values = parameters.get(name);
-        if ((values == null) || (values.length == 0)) {
-            return null;
-        }
-
-        return values[0];
-    }
-
-    @Override
-    public Map<String, String[]> getParameterMap() {
-        return parameters;
-    }
-
-    @Override
-    public Enumeration<String> getParameterNames() {
-        return Collections.enumeration(parameters.keySet());
-    }
-
-    @Override
-    public String[] getParameterValues(String name) {
-        return parameters.get(name);
-    }
-
     public String getFilename() {
         return filename;
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/BasicAuthCallContextHandler.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/BasicAuthCallContextHandler.java?rev=1362826&r1=1362825&r2=1362826&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/BasicAuthCallContextHandler.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/BasicAuthCallContextHandler.java
Wed Jul 18 09:20:20 2012
@@ -20,6 +20,7 @@ package org.apache.chemistry.opencmis.se
 
 import java.io.Serializable;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
@@ -44,7 +45,7 @@ public class BasicAuthCallContextHandler
         Map<String, String> result = null;
 
         String authHeader = request.getHeader("Authorization");
-        if ((authHeader != null) && (authHeader.trim().toLowerCase().startsWith("basic
"))) {
+        if ((authHeader != null) && (authHeader.trim().toLowerCase(Locale.ENGLISH).startsWith("basic
"))) {
             int x = authHeader.lastIndexOf(' ');
             if (x == -1) {
                 return result;

Added: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/QueryStringHttpServletRequestWrapper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/QueryStringHttpServletRequestWrapper.java?rev=1362826&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/QueryStringHttpServletRequestWrapper.java
(added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/QueryStringHttpServletRequestWrapper.java
Wed Jul 18 09:20:20 2012
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.server.shared;
+
+import java.io.IOException;
+import java.net.URLDecoder;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+
+/**
+ * HttpServletRequest wrapper that reads the query string in container
+ * independent way and decodes the parameter values with UTF-8.
+ */
+public class QueryStringHttpServletRequestWrapper extends HttpServletRequestWrapper {
+
+    private Map<String, String[]> parameters;
+
+    public QueryStringHttpServletRequestWrapper(HttpServletRequest request) throws IOException
{
+        super(request);
+
+        parameters = new HashMap<String, String[]>();
+
+        // parse query string
+        parseFormData(request.getQueryString());
+    }
+
+    /**
+     * Parses the query string.
+     */
+    protected void parseFormData(String queryString) throws IOException {
+        if (queryString == null || queryString.length() < 3) {
+            return;
+        }
+
+        String[] nameValuePairs = queryString.split("&");
+        for (String nameValuePair : nameValuePairs) {
+            int x = nameValuePair.indexOf('=');
+            if (x > 0) {
+                String name = URLDecoder.decode(nameValuePair.substring(0, x), "UTF-8");
+                String value = (x == nameValuePair.length() - 1 ? "" : URLDecoder.decode(
+                        nameValuePair.substring(x + 1), "UTF-8"));
+                addParameter(name, value);
+            } else {
+                String name = URLDecoder.decode(nameValuePair, "UTF-8");
+                addParameter(name, null);
+            }
+        }
+    }
+
+    /**
+     * Adds a value to a parameter.
+     */
+    protected void addParameter(String name, String value) {
+        String[] values = parameters.get(name);
+
+        if (values == null) {
+            parameters.put(name, new String[] { value });
+        } else {
+            String[] newValues = new String[values.length + 1];
+            System.arraycopy(values, 0, newValues, 0, values.length);
+            newValues[newValues.length - 1] = value;
+            parameters.put(name, newValues);
+        }
+    }
+
+    @Override
+    public String getParameter(String name) {
+        String[] values = parameters.get(name);
+        if ((values == null) || (values.length == 0)) {
+            return null;
+        }
+
+        return values[0];
+    }
+
+    @Override
+    public Map<String, String[]> getParameterMap() {
+        return parameters;
+    }
+
+    @Override
+    public Enumeration<String> getParameterNames() {
+        return Collections.enumeration(parameters.keySet());
+    }
+
+    @Override
+    public String[] getParameterValues(String name) {
+        return parameters.get(name);
+    }
+}

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/QueryStringHttpServletRequestWrapper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/CmisTckAntTask.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/CmisTckAntTask.java?rev=1362826&r1=1362825&r2=1362826&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/CmisTckAntTask.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/CmisTckAntTask.java
Wed Jul 18 09:20:20 2012
@@ -19,6 +19,7 @@
 package org.apache.chemistry.opencmis.tck.runner;
 
 import java.io.File;
+import java.util.Locale;
 
 import org.apache.chemistry.opencmis.tck.CmisTest;
 import org.apache.chemistry.opencmis.tck.CmisTestGroup;
@@ -96,7 +97,7 @@ public class CmisTckAntTask extends Task
                     output = new File(DEFAULT_REPORT_NAME + ".txt");
                 }
             } else {
-                format = format.trim().toLowerCase();
+                format = format.trim().toLowerCase(Locale.ENGLISH);
                 if (REPORT_TEXT.equals(format)) {
                     report = new TextReport();
                     if (output == null) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/SecurityTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/SecurityTest.java?rev=1362826&r1=1362825&r2=1362826&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/SecurityTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/SecurityTest.java
Wed Jul 18 09:20:20 2012
@@ -20,6 +20,7 @@ package org.apache.chemistry.opencmis.tc
 
 import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.WARNING;
 
+import java.util.Locale;
 import java.util.Map;
 
 import org.apache.chemistry.opencmis.client.api.Session;
@@ -68,6 +69,6 @@ public class SecurityTest extends Abstra
             return false;
         }
 
-        return url.trim().toLowerCase().startsWith("https://");
+        return url.trim().toLowerCase(Locale.ENGLISH).startsWith("https://");
     }
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/NameCharsetTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/NameCharsetTest.java?rev=1362826&r1=1362825&r2=1362826&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/NameCharsetTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/NameCharsetTest.java
Wed Jul 18 09:20:20 2012
@@ -18,6 +18,7 @@
  */
 package org.apache.chemistry.opencmis.tck.tests.crud;
 
+import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.FAILURE;
 import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.WARNING;
 
 import java.util.Map;
@@ -25,6 +26,7 @@ import java.util.Map;
 import org.apache.chemistry.opencmis.client.api.Document;
 import org.apache.chemistry.opencmis.client.api.Folder;
 import org.apache.chemistry.opencmis.client.api.Session;
+import org.apache.chemistry.opencmis.tck.CmisTestResult;
 import org.apache.chemistry.opencmis.tck.impl.AbstractSessionTest;
 
 /**
@@ -32,7 +34,8 @@ import org.apache.chemistry.opencmis.tck
  */
 public class NameCharsetTest extends AbstractSessionTest {
 
-    private static final String[] NAMES = new String[] { "\u0064\u006f\u0063\u0075\u006d\u0065\u006e\u0074",
//
+    private static final String[] NAMES = new String[] { //
+    "\u0064\u006f\u0063\u0075\u006d\u0065\u006e\u0074", //
             "\u0053\u0063\u0068\u0072\u0069\u0066\u0074\u0073\u0074\u00fc\u0063\u006b", //
             "\u0648\u062b\u064a\u0642\u0629", //
             "\u0073\u0259\u006e\u0259\u0064", //
@@ -51,7 +54,8 @@ public class NameCharsetTest extends Abs
             "\u0c2a\u0c24\u0c4d\u0c30\u0c02", //
             "\u0e40\u0e2d\u0e01\u0e2a\u0e32\u0e23", //
             "\u062f\u0633\u062a\u0627\u0648\u06cc\u0632", //
-            "\u0074\u00e0\u0069\u0020\u006c\u0069\u1ec7\u0075" };
+            "\u0074\u00e0\u0069\u0020\u006c\u0069\u1ec7\u0075", //
+            "a&b" };
 
     @Override
     public void init(Map<String, String> parameters) {
@@ -62,15 +66,26 @@ public class NameCharsetTest extends Abs
 
     @Override
     public void run(Session session) {
+        CmisTestResult f;
+
         // create a test folder
         Folder testFolder = createTestFolder(session);
 
         try {
             for (int i = 0; i < NAMES.length; i++) {
                 Document doc = null;
+                Document doc2 = null;
                 try {
                     doc = null;
                     doc = createDocument(session, testFolder, NAMES[i], NAMES[i]);
+
+                    // get the newly created object by path
+                    String path = doc.getPaths().get(0);
+                    doc2 = (Document) session.getObjectByPath(path, SELECT_ALL_NO_CACHE_OC);
+                    addResult(checkObject(session, doc2, getAllProperties(doc2), "New document
object spec compliance"));
+
+                    f = createResult(FAILURE, "Names of the created and the fetched document
don't match!");
+                    assertEquals(NAMES[i], doc2.getName(), null, f);
                 } catch (Exception e) {
                     addResult(createResult(WARNING, "The name '" + NAMES[i] + "' raised this
exception: " + e, e, false));
                 } finally {
@@ -85,7 +100,7 @@ public class NameCharsetTest extends Abs
                 }
             }
 
-            addResult(createInfoResult("Tested " + NAMES.length + " differnt names."));
+            addResult(createInfoResult("Tested " + NAMES.length + "different names."));
         } finally {
             // delete the test folder
             deleteTestFolder();

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java?rev=1362826&r1=1362825&r2=1362826&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java
Wed Jul 18 09:20:20 2012
@@ -33,6 +33,7 @@ import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 import javax.swing.BorderFactory;
@@ -331,7 +332,7 @@ public class LoginDialog extends JDialog
     protected void createBindingButtons(Container pane) {
         JPanel bindingContainer = new JPanel();
         bindingContainer.setLayout(new BoxLayout(bindingContainer, BoxLayout.LINE_AXIS));
-        char bc = System.getProperty(SYSPROP_BINDING, "atom").toLowerCase().charAt(0);
+        char bc = System.getProperty(SYSPROP_BINDING, "atom").toLowerCase(Locale.ENGLISH).charAt(0);
         boolean atom = (bc == 'a');
         boolean ws = (bc == 'w');
         boolean browser = (bc == 'b');
@@ -356,8 +357,9 @@ public class LoginDialog extends JDialog
     protected void createAuthenticationButtons(Container pane) {
         JPanel authenticationContainer = new JPanel();
         authenticationContainer.setLayout(new BoxLayout(authenticationContainer, BoxLayout.LINE_AXIS));
-        boolean standard = (System.getProperty(SYSPROP_AUTHENTICATION, "standard").toLowerCase().equals("standard"));
-        boolean ntlm = (System.getProperty(SYSPROP_AUTHENTICATION, "").toLowerCase().equals("ntlm"));
+        boolean standard = (System.getProperty(SYSPROP_AUTHENTICATION, "standard").toLowerCase(Locale.ENGLISH)
+                .equals("standard"));
+        boolean ntlm = (System.getProperty(SYSPROP_AUTHENTICATION, "").toLowerCase(Locale.ENGLISH).equals("ntlm"));
         boolean none = !standard && !ntlm;
         authenticationNoneButton = new JRadioButton("None", none);
         authenticationStandardButton = new JRadioButton("Standard", standard);
@@ -537,7 +539,7 @@ public class LoginDialog extends JDialog
     protected void setClientSession(ClientSession clientSession) {
         this.clientSession = clientSession;
     }
-    
+
     public void createClientSession() {
         if (expertLogin) {
             setClientSession(new ClientSession(createExpertSessionParameters()));

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ObjectPanel.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ObjectPanel.java?rev=1362826&r1=1362825&r2=1362826&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ObjectPanel.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ObjectPanel.java
Wed Jul 18 09:20:20 2012
@@ -33,6 +33,7 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 
@@ -188,7 +189,7 @@ public class ObjectPanel extends InfoPan
                 checkButton.setEnabled(true);
 
                 if (object instanceof Document) {
-                    String name = object.getName().toLowerCase();
+                    String name = object.getName().toLowerCase(Locale.ENGLISH);
                     int x = name.lastIndexOf('.');
                     if ((x > -1) && (scriptExtensions.contains(name.substring(x
+ 1)))) {
                         scriptPanel.setVisible(true);
@@ -292,7 +293,7 @@ public class ObjectPanel extends InfoPan
                     setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                     Document doc = (Document) getClientModel().getCurrentObject();
 
-                    String name = doc.getName().toLowerCase();
+                    String name = doc.getName().toLowerCase(Locale.ENGLISH);
                     if (name.endsWith(".groovy")) {
                         File file = ClientHelper.createTempFileFromDocument(doc, null);
                         Console console = ClientHelper.openConsole(ObjectPanel.this, getClientModel(),
null);
@@ -316,7 +317,7 @@ public class ObjectPanel extends InfoPan
                     setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                     Document doc = (Document) getClientModel().getCurrentObject();
                     File file = ClientHelper.createTempFileFromDocument(doc, null);
-                    String name = doc.getName().toLowerCase();
+                    String name = doc.getName().toLowerCase(Locale.ENGLISH);
                     String ext = name.substring(name.lastIndexOf('.') + 1);
 
                     scriptOutput.setText("");

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/InfoPanel.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/InfoPanel.java?rev=1362826&r1=1362825&r2=1362826&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/InfoPanel.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/InfoPanel.java
Wed Jul 18 09:20:20 2012
@@ -39,6 +39,7 @@ import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
 import java.net.URI;
 import java.util.Collection;
+import java.util.Locale;
 
 import javax.swing.BorderFactory;
 import javax.swing.BoxLayout;
@@ -356,7 +357,7 @@ public abstract class InfoPanel extends 
                 return false;
             }
 
-            String lower = link.toLowerCase();
+            String lower = link.toLowerCase(Locale.ENGLISH);
             return lower.startsWith("http://") || lower.startsWith("https://");
         }
 



Mime
View raw message