All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.crashnote.core.util.ClassUtil Maven / Gradle / Ivy

/**
 * Copyright (C) 2011 - 101loops.com 
 *
 * Licensed 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 com.crashnote.core.util;

import java.io.File;
import java.net.URL;
import java.util.Properties;
import java.util.regex.Pattern;

/**
 * Utility class to do classpath and package reading/parsing
 */
public class ClassUtil {

    /**
     * Load properties from classpath file
     */
    public Properties load(final String fileName) {
        final Properties p = new Properties();
        final URL url = ClassLoader.getSystemResource(fileName);
        try {
            p.load(url.openStream());
        } catch (Exception ignored) {
        }
        return p;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy