Java ConcurrentMap getContextPath()

Here you can find the source of getContextPath()

Description

get Context Path

License

Apache License

Declaration

public static String getContextPath() 

Method Source Code


//package com.java2s;
/*/* www .  j  a v a  2 s .com*/
 * 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.
 */

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

public class Main {
    private static ConcurrentMap<Object, Object> dataMap = new ConcurrentHashMap<Object, Object>();

    public static String getContextPath() {
        return (String) dataMap.get("__contextPath__");
    }

    public static Object get(Object key) {
        if (dataMap.containsKey(key)) {
            return dataMap.get(key);
        }
        return null;
    }
}

Related

  1. fileReaderDecrement(ConcurrentMap readers, Long fileNum)
  2. fileReaderIncrement(ConcurrentMap readers, Long fileNum)
  3. get(Class clazz)
  4. getCache(String cacheName)
  5. getConcurrentMap(int... size)
  6. getFilesystem(String id)
  7. getNestedSet(K1 key, ConcurrentMap> set)
  8. getNewLogFactor(String factorName)
  9. getSingleInstance(Class classType)