Package org.apache.commons.collections.map

Examples of org.apache.commons.collections.map.CaseInsensitiveMap


   */
  public static String createJarWithClassPath(String inputClassPath, Path pwd,
      Map<String, String> callerEnv) throws IOException {
    // Replace environment variables, case-insensitive on Windows
    @SuppressWarnings("unchecked")
    Map<String, String> env = Shell.WINDOWS ? new CaseInsensitiveMap(callerEnv) :
      callerEnv;
    String[] classPathEntries = inputClassPath.split(File.pathSeparator);
    for (int i = 0; i < classPathEntries.length; ++i) {
      classPathEntries[i] = StringUtils.replaceTokens(classPathEntries[i],
        StringUtils.ENV_VAR_PATTERN, env);
View Full Code Here


        if (queryString == null || queryString.length() == 0) {
            return Collections.emptyMap();
        }
        String[] params = queryString.split("&");
        @SuppressWarnings("unchecked")
        Map<String, String> kvpMap = new CaseInsensitiveMap();
        for (String kvp : params) {
            String[] split = kvp.split("=");
            if (split[0].length() > 0) {
                String key = split[0];
                String value = split.length > 1 ? urlDecode(split[1]) : null;

                kvpMap.put(key, value);
            }
        }
        return kvpMap;
    }
View Full Code Here

    public static String createUri(final URL baseUrl, final Map<String, String> queryStringKvp) {
        String query = baseUrl.getQuery();
        Map<String, String> finalKvpMap = new HashMap<String, String>(queryStringKvp);
        if (query != null && query.length() > 0) {
            Map<String, String> userParams = new CaseInsensitiveMap(queryStringKvp);
           
            // there might be a "&amp;" at the end, make sure to remove it
            if (query.endsWith("&amp;")) {
              query = query.substring(0, query.length() - 5);
            }
           
            String[] rawUrlKvpSet = query.split("&");
            for (String rawUrlKvp : rawUrlKvpSet) {
                int eqIdx = rawUrlKvp.indexOf('=');
                String key, value;
                if (eqIdx > 0) {
                    key = rawUrlKvp.substring(0, eqIdx);
                    value = rawUrlKvp.substring(eqIdx + 1);
                } else {
                    key = rawUrlKvp;
                    value = null;
                }
                try {
                    value = URLDecoder.decode(value, "UTF-8");
                } catch (UnsupportedEncodingException e) {
                    throw new RuntimeException(e);
                }
                if (userParams.containsKey(key)) {
                    LOGGER.fine("user supplied value for query string argument " + key
                            + " overrides the one in the base url");
                } else {
                    finalKvpMap.put(key, value);
                }
View Full Code Here

                    throw new RuntimeException(e);
                }
            }
            kvp.put(key, value);
        }
        return new CaseInsensitiveMap(kvp);
    }
View Full Code Here

        // Create a case insensitive version of issueLinkTemplatePerSystem
        // We need something case insensitive to maintain backward compatibility
        if ( issueLinkTemplatePerSystem == null )
        {
            caseInsensitiveIssueLinkTemplatePerSystem = new CaseInsensitiveMap();
        }
        else
        {
            caseInsensitiveIssueLinkTemplatePerSystem = new CaseInsensitiveMap( issueLinkTemplatePerSystem );
        }

        // Set good default values for issue management systems here, but only
        // if they have not been configured already by the user
        addIssueLinkTemplate( ChangesReportGenerator.DEFAULT_ISSUE_SYSTEM_KEY, issueLinkTemplate );
View Full Code Here

     */
    private void addIssueLinkTemplate( String system, String issueLinkTemplate )
    {
        if ( caseInsensitiveIssueLinkTemplatePerSystem == null )
        {
            caseInsensitiveIssueLinkTemplatePerSystem = new CaseInsensitiveMap();
        }
        if ( !caseInsensitiveIssueLinkTemplatePerSystem.containsKey( system ) )
        {
            caseInsensitiveIssueLinkTemplatePerSystem.put( system, issueLinkTemplate );
        }
View Full Code Here

            throw new IllegalArgumentException("Empty list of fileExtensions provided");
        }
        if(mimeTypes.isEmpty()){
            throw new IllegalArgumentException("Empty list of mimeTypes provided");
        }       
        this.mimeTypes= new CaseInsensitiveMap(new HashMap<String, String>(mimeTypes));
        this.outputFormats= new ArrayList<String>(outputFormats);
        this.fileExtensions= new CaseInsensitiveMap(fileExtensions);
        this.geoserver=geoserver;
       
    }
View Full Code Here

        super();
    }

    @SuppressWarnings("unchecked")
    protected GetCoverageType parse(String url) throws Exception {
        Map<String, Object> rawKvp = new CaseInsensitiveMap(KvpUtils.parseQueryString(url));
        Map<String, Object> kvp = new CaseInsensitiveMap(parseKvp(rawKvp));
        WCS20GetCoverageRequestReader reader = new WCS20GetCoverageRequestReader();
        GetCoverageType gc = (GetCoverageType) reader.createRequest();
        return (GetCoverageType) reader.read(gc, kvp, rawKvp);
    }
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    public static Map<String, String> selectedStringsFromMap(Map<String, ?> map, String encoding,
            String... keys) {

        map = new CaseInsensitiveMap(map);
        Map<String, String> selected = new CaseInsensitiveMap();
        for (String key : keys) {
            Object value = map.get(key);
            if (value != null) {
                String sValue = value instanceof String[] ? ((String[]) value)[0] : String
                        .valueOf(value);
                selected.put(key.toUpperCase(), URLDecode(sValue, encoding));
            }
        }
        return selected;
    }
View Full Code Here

        when(gwcd.getServletPrefix()).thenReturn(null);
       
        service = new WMSService(sb, tld, mock(RuntimeStats.class), new NullURLMangler(), gwcd);

        @SuppressWarnings("unchecked")
        Map<String, String> kvp = new CaseInsensitiveMap();
        kvp.put("format", "image/png");
        kvp.put("srs", "EPSG:4326");
        kvp.put("width", "256");
        kvp.put("height", "256");
        kvp.put("layers", "mockLayer");
        kvp.put("tiled", "true");
        kvp.put("request", "GetMap");

        List<String> gridSetNames = Arrays.asList("GlobalCRS84Pixel", "GlobalCRS84Scale",
                "EPSG:4326");
        TileLayer tileLayer = mockTileLayer("mockLayer", gridSetNames);

        // make the request match a tile in the expected gridset
        BoundingBox bounds;
        bounds = tileLayer.getGridSubset(expectedGridset).boundsFromIndex(tileIndex);
        kvp.put("bbox", bounds.toString());

        HttpServletRequest req = mock(HttpServletRequest.class);
        HttpServletResponse resp = mock(HttpServletResponse.class);

        when(req.getCharacterEncoding()).thenReturn("UTF-8");
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.map.CaseInsensitiveMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.