Java Properties Get getSignExclusions(Properties properties)

Here you can find the source of getSignExclusions(Properties properties)

Description

get Sign Exclusions

License

Open Source License

Declaration

public static Set getSignExclusions(Properties properties) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2006, 2010 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://from  w  w w .  java2s  .com
 *     IBM - Initial API and implementation
 *******************************************************************************/

import java.util.*;

public class Main {
    public static final String SIGN_EXCLUDES = "sign.excludes";

    public static Set getSignExclusions(Properties properties) {
        if (properties == null)
            return Collections.EMPTY_SET;
        String signExcludes = properties.getProperty(SIGN_EXCLUDES);
        if (signExcludes != null) {
            String[] excludes = toStringArray(signExcludes, ","); //$NON-NLS-1$
            Set signExclusions = new HashSet();
            for (int i = 0; i < excludes.length; i++) {
                signExclusions.add(excludes[i]);
            }
            return signExclusions;
        }
        return Collections.EMPTY_SET;
    }

    public static String[] toStringArray(String input, String separator) {
        StringTokenizer tokenizer = new StringTokenizer(input, separator);
        int count = tokenizer.countTokens();
        String[] result = new String[count];
        for (int i = 0; i < count; i++) {
            result[i] = tokenizer.nextToken().trim();
        }
        return result;
    }
}

Related

  1. getPropertyValue(Properties props, String key)
  2. getPropertyValueAsInt(Properties props, String key, int defaultValue)
  3. getRefValue(Properties result, String v)
  4. getSection(Properties props, String sectionName, boolean removeSectionName)
  5. getSignatureContent(Properties properties)
  6. getString(Properties props, String key)
  7. getString(Properties props, String name)
  8. getString(Properties props, String name, String defaultValue)
  9. getStringConfigValue( final String configKey, final Properties config)