/** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * * This file is part of Liferay Social Office. Liferay Social Office is free * software: you can redistribute it and/or modify it under the terms of the GNU * Affero General Public License as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. * * Liferay Social Office is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License * for more details. * * You should have received a copy of the GNU General Public License along with * Liferay Social Office. If not, see http://www.gnu.org/licenses/agpl-3.0.html. */ package com.liferay.contacts.util; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; /** * @author Ryan Park */ public class ContactsExtensionsUtil { public static Map<String, String> getExtensions() { return _instance._getExtensions(); } public static void register(String servletContextName, String path) { _instance._register(servletContextName, path); } public static void unregister(String servletContextName) { _instance._unregister(servletContextName); } private ContactsExtensionsUtil() { _extensions = new ConcurrentHashMap<>(); } private Map<String, String> _getExtensions() { return _extensions; } private void _register(String servletContextName, String path) { _extensions.put(servletContextName, path); } private void _unregister(String servletContextName) { _extensions.remove(servletContextName); } private static ContactsExtensionsUtil _instance = new ContactsExtensionsUtil(); private Map<String, String> _extensions; }