com.webull.openapi.config.ProjectReader Maven / Gradle / Ivy
/*
* Copyright 2022 Webull
*
* 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
*
* https://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.webull.openapi.config;
import com.webull.openapi.logger.Logger;
import com.webull.openapi.logger.LoggerFactory;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
public class ProjectReader implements ConfigReader {
private static final Logger logger = LoggerFactory.getLogger(ProjectReader.class);
private static final String PROJECT_PROPERTIES = "project.properties";
private static final ProjectReader projectReader = new ProjectReader();
public static ProjectReader getInstance() {
return ProjectReader.projectReader;
}
private final Map properties = new HashMap<>();
private ProjectReader() {
ClassLoader classLoader = ProjectReader.class.getClassLoader();
try (InputStream is = classLoader.getResourceAsStream(getPath())){
Properties prop = new Properties();
prop.load(is);
Enumeration
© 2015 - 2025 Weber Informatics LLC | Privacy Policy