从classpath内加载指定的文件到{@link Properties}内
777140
public static Properties readPropertiesFromClasspathFile(String fullPath) {
        Properties properties = new Properties();
        try (InputStream inputStream = readClasspathFileIntoStream(fullPath)) {
            properties.load(new InputStreamReader(inputStream));
        } catch (IOException e) {
            throw new RuntimeException("加载配置文件" + fullPath + "出错");
        }
        return properties;
    }
303833
private static String readClasspathResource(String filename) {
        InputStream is = CreateEntities.class.getResourceAsStream(filename);
        if (is == null) {
            throw new IllegalArgumentException(
                    "Could not find the given file '" + filename + "' in the classpath.");
        }
        
        return readContents(is);
    }
1282242
public static Properties loadProperties(String path, boolean required) {
        Properties properties = new Properties();
        return loadProperties(properties, path, required);
    }
1236615
private void initialize(@NotNull final String propertiesFilePath) {
        props = new Properties();
        try (InputStream in = FileUtils.getResourceAsStream(propertiesFilePath)) {
            props.load(in);
        } catch (NullPointerException ex) {
            LOGGER.error("Did not find settings file '{}'.", propertiesFilePath);
            LOGGER.debug("", ex);
        } catch (IOException ex) {
            LOGGER.error("Unable to load settings from '{}'.", propertiesFilePath);
            LOGGER.debug("", ex);
        }
        logProperties("Properties loaded", props);
    }
732933
public static Properties loadProperties(Class<?> clazz, String fileName) throws IOException {
        Properties properties = new Properties();
        try (InputStream is = clazz.getClassLoader().getResourceAsStream(fileName)) {
            properties.load(is);
        }
        return properties;
    }
1196819
public void setClasspath(Path classpath) {
        if (compileClasspath == null) {
            compileClasspath = classpath;
        } else {
            compileClasspath.append(classpath);
        }
    }
558463
public static Properties getPropertiesFromPath(String fileName)
      throws PropertiesFileNotFoundException {

    Properties props = new Properties();
    FileInputStream fis;
    try {
      fis = new FileInputStream(fileName);
      props.load(fis);
      fis.close();
    } catch (Exception e) {
      throw new PropertiesFileNotFoundException(
          "ERROR LOADING PROPERTIES FROM PATH >" + fileName + "< !!!", e);
    }
    return props;
  }
481867
public static Properties loadProperties(File f) throws IOException {
        Properties props = new Properties();
        FileInputStream in = new FileInputStream(f);
        try {
            props.load(in);
            return props;
        } finally {
            try {
                in.close();
            } catch (IOException e) {
            }
        }
    }
309072
private static Properties load() {
		Properties properties = new Properties();

		String file = System.getProperty(CONFIGURATION_PROPERTY);
		try {
			if (file != null) {
				InputStream stream;
				if (URL_DETECTION_PATTERN.matcher(file).matches()) {
					stream = new URL(file).openStream();
				} else {
					stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(file);
					if (stream == null) {
						stream = new FileInputStream(file);
					}
				}
				load(properties, stream);
			} else {
				InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(DEFAULT_CONFIGURATION_FILE);
				if (stream != null) {
					load(properties, stream);
				}
			}
		} catch (IOException ex) {
			InternalLogger.log(Level.ERROR, "Failed loading configuration from '" + file + "'");
		}

		for (Object key : new ArrayList<Object>(System.getProperties().keySet())) {
			String name = (String) key;
			if (name.startsWith(PROPERTIES_PREFIX)) {
				properties.put(name.substring(PROPERTIES_PREFIX.length()), System.getProperty(name));
			}
		}

		for (Entry<Object, Object> entry : properties.entrySet()) {
			String value = (String) entry.getValue();
			if (value.indexOf('{') != -1) {
				value = resolve(value, EnvironmentVariableResolver.INSTANCE);
				value = resolve(value, SystemPropertyResolver.INSTANCE);
				properties.put(entry.getKey(), value);
			}
		}

		return properties;
	}
834685
private static void loadClientProperties(String propertiesPath, String clazzName,
            Map<?, Map<String, String>> clientProperties, Map<String, Map<String, String>> entityConfigurations)
    {

        InputStream inputStream = PropertyReader.class.getClassLoader().getResourceAsStream(propertiesPath);
        clientProperties = JsonUtil.readJson(inputStream, Map.class);

        if (clientProperties != null)
        {
            if (clientProperties.get("all") != null)
            {
                entityConfigurations.put(clazzName, clientProperties.get("all"));
            }
            else
            {

                Iterator iter = clientProperties.keySet().iterator();

                while (iter.hasNext())
                {
                    Object key = iter.next();
                    if (((String) key).indexOf(',') > 0)
                    {
                        StringTokenizer tokenizer = new StringTokenizer((String) key, ",");
                        while (tokenizer.hasMoreElements())
                        {
                            String token = tokenizer.nextToken();
                            entityConfigurations.put(token, clientProperties.get(key));
                        }
                    }
                    else
                    {
                        entityConfigurations.put((String) key, clientProperties.get(key));
                    }
                }
            }
        }

    }
1210893
protected String getFullPropertyPath(String propertyPath) {
		if (basePropertyPath.equals("")) {
			return propertyPath;
		}
		else if (propertyPath.equals("")) {
			return basePropertyPath;
		}
		else {
			return basePropertyPath + '.' + propertyPath;
		}
	}
1363442
public static Properties getProperties(final String propertiesPath) throws PropertiesException {

        Properties properties;
        String propertiesFilePath = getPropertiesFilePath(propertiesPath);
        if (propertiesFilePath == null) {
            throw new PropertiesException(String.format(
                    "Loading '%s' properties failed, no such properties.", propertiesPath));
        }
        FileInputStream fileInputStream = null;
        try {
            properties = new Properties();
            fileInputStream = new FileInputStream(propertiesFilePath);
            properties.load(fileInputStream);
            fileInputStream.close();
            return properties;
        } catch (Exception e) {
            try {
                if (fileInputStream != null)
                    fileInputStream.close();
            } catch (IOException e1) {
                e1.printStackTrace();
            }
            throw new PropertiesException(String.format("Loading '%s' properties failed.",
                    propertiesPath), e);
        }
    }
710486
private void setClassPath() throws IOException {
    String fullPath = file.getAbsolutePath();
    String rootPath = fullPath.substring(0, fullPath.lastIndexOf(classFile.getRelativePath()));
    List<File> classPath = new ArrayList<>();
    classPath.add(new File(rootPath));
    parserEnv.fileManager().setLocation(StandardLocation.CLASS_PATH, classPath);
  }
852955
public void setClasspath(Path src) {
        if (classpath == null) {
            classpath = src;
        } else {
            classpath.append(src);
        }
    }
1107389
public static final Properties read(String classpath) throws IOException{
        final URL url = Resources.getResource(classpath);
        final ByteSource byteSource = Resources.asByteSource(url);
        final Properties properties = new Properties();
        InputStream inputStream = null;
        try {
            inputStream = byteSource.openBufferedStream();
            properties.load(inputStream);
        } catch (final IOException ioException) {
            ioException.printStackTrace();
        } finally {
            if (inputStream != null) {
                try {
                    inputStream.close();
                } catch (final IOException ioException) {
                    throw ioException;
                }
            }
        }
        return properties;
    }
1252451
private Properties readPropertyFile(String file) throws IOException {
        String fileName = file.startsWith("/") ? file : "/" + file;
        LOGGER.info("Reading properties from: " + fileName + ". Will try classpath, then file system.");
        return Util.readProperties(fileName);
    }
373589
private static Environment loadClasspath(@NonNull String classpath) {
        var path = classpath;
        if (classpath.startsWith(HttpConst.SLASH)) {
            path = classpath.substring(1);
        }
        InputStream is = getDefault().getResourceAsStream(path);
        if (null == is) {
            return EMPTY_ENV;
        }
        return of(is);
    }