Loads a Properties file from the given file name

@param fileName
@return The Properties file
@throws PropertiesFileNotFoundException if the Properties file could not be loaded from the
given path and file name
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;
  }
273753
public static Properties loadClasspath(String path) throws IOException {
		InputStream input = PropUtils.class.getClassLoader().getResourceAsStream(path);
		Properties prop = null;
		try {
			prop = load(input);
		} finally {
			IOUtils.close(input);
		}
		return prop;
	}
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);
    }
907243
public void loadPropertiesFromFile(final String propertiesFile)
			throws IOException {
		LOG.info("Loading properties from file: " + propertiesFile);
		File file = new File(propertiesFile);

		String bundleName = file.getPath().substring(0,
				file.getPath().indexOf("properties") - 1);
		FileInputStream inputStream = null;

		try {
			inputStream = new FileInputStream(file);
			ResourceBundle bundle = new PropertyResourceBundle(inputStream);
			LOG.info("Adding to bunlde: " + bundleName);
			bundles.put(bundleName, bundle);
		} finally {
			if (inputStream != null) {
				inputStream.close();
			}
		}

	}
512860
@Nonnull
    public static Properties loadProperties(@Nonnull String properties) throws IOException {
        Properties p = new Properties();
        p.load(new StringReader(properties));
        return p;
    }
840872
private static void loadProperty(String filePath)
    {
        try (InputStream propertyStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(
                filePath);
                Reader propertyReader = new InputStreamReader(propertyStream, DEFAULT_CHARSET);)
        {
            Properties properties = new Properties();
            properties.load(propertyReader);
            propertiesMap.put(filePath, properties);
        }
        catch (Exception ex)
        {
            String errorPattern = "Property file load failed. Skip load. : PropertyFile={0}";
            logger.warn(MessageFormat.format(errorPattern, filePath), ex);
        }
    }
412347
@Override
    public boolean loadValuesFrom(String filename) {
        String propContent = textIn(filename);
        PropertiesHelper propHelper = getEnvironment().getPropertiesHelper();
        Properties properties = propHelper.parsePropertiesString(propContent);
        Map<String, Object> propAsMap = propHelper.convertPropertiesToMap(properties);
        getCurrentValues().putAll(propAsMap);
        return true;
    }
1004524
private void load(String filename)
	{
		try
		{
			load(new FileInputStream(filename));
		}
		catch (FileNotFoundException e)
		{
			e.printStackTrace();
		}
	}
261286
public static Properties readPropertiesFromFile(String _fileName, Properties _props) {
        Properties props = _props == null ? new Properties() : _props;

        LOGGER.debug("Trying to read properties from file: " + _fileName);
        Properties newProperties = readProperties(new File(_fileName));
        if (newProperties != null) {
            LOGGER.debug("Successfully read properties from file: " + _fileName);
            props.putAll(newProperties);
        }

        return props;
    }
964386
public static Properties loadProperties(final URL fileURL) {
        checkNotNull("fileURL", fileURL);
        final Properties props = new Properties();
        try (final InputStream inStream = fileURL.openStream()) {
            props.load(inStream);
        } catch (final IOException ex) {
            throw new RuntimeException(ex);
        }
        return props;
    }
66556
public static final ConfigurationSourceKey propertyFile(final String name){
		return new ConfigurationSourceKey(Type.FILE, Format.PROPERTIES, name);
	}
219083
protected Properties loadProperties(Resource resource, String filename) throws IOException {
		InputStream is = resource.getInputStream();
		Properties props = new Properties();
		try {
			if (resource.getFilename().endsWith(XML_SUFFIX)) {
				if (logger.isDebugEnabled()) {
					logger.debug("Loading properties [" + resource.getFilename() + "]");
				}
				this.propertiesPersister.loadFromXml(props, is);
			}
			else {
				String encoding = null;
				if (this.fileEncodings != null) {
					encoding = this.fileEncodings.getProperty(filename);
				}
				if (encoding == null) {
					encoding = this.defaultEncoding;
				}
				if (encoding != null) {
					if (logger.isDebugEnabled()) {
						logger.debug("Loading properties [" + resource.getFilename() + "] with encoding '" + encoding + "'");
					}
					this.propertiesPersister.load(props, new InputStreamReader(is, encoding));
				}
				else {
					if (logger.isDebugEnabled()) {
						logger.debug("Loading properties [" + resource.getFilename() + "]");
					}
					this.propertiesPersister.load(props, is);
				}
			}
			return props;
		}
		finally {
			is.close();
		}
	}
55005
private static Properties loadProperties(String defaultsName, String propertiesName) throws IOException {
        Properties bundle = new Properties();
        ClassLoader loader = SecurityActions.getContextClassLoader();
        URL defaultUrl = null;
        URL url = null;
        // First check for local visibility via a URLClassLoader.findResource
        if (loader instanceof URLClassLoader) {
            URLClassLoader ucl = (URLClassLoader) loader;
            defaultUrl = SecurityActions.findResource(ucl, defaultsName);
            url = SecurityActions.findResource(ucl, propertiesName);
            PicketBoxLogger.LOGGER.traceAttemptToLoadResource(propertiesName);
        }
        // Do a general resource search
        if (defaultUrl == null) {
            defaultUrl = loader.getResource(defaultsName);
            if (defaultUrl == null) {
                try {
                    defaultUrl = new URL(defaultsName);
                } catch (MalformedURLException mue) {
                    PicketBoxLogger.LOGGER.debugFailureToOpenPropertiesFromURL(mue);
                    File tmp = new File(defaultsName);
                    if (tmp.exists()) {
                        defaultUrl = tmp.toURI().toURL();
                    }
                }
            }
        }
        if (url == null) {
            url = loader.getResource(propertiesName);
            if (url == null) {
                try {
                    url = new URL(propertiesName);
                } catch (MalformedURLException mue) {
                    PicketBoxLogger.LOGGER.debugFailureToOpenPropertiesFromURL(mue);
                    File tmp = new File(propertiesName);
                    if (tmp.exists()) {
                        url = tmp.toURI().toURL();
                    }
                }
            }
        }
        if (url == null && defaultUrl == null) {

            String propertiesFiles = propertiesName + "/" + defaultsName;
            throw PicketBoxMessages.MESSAGES.unableToFindPropertiesFile(propertiesFiles);
        }

        if (url != null) {
            InputStream is = null;
            try {
                is = SecurityActions.openStream(url);
            } catch (PrivilegedActionException e) {
                throw new IOException(e.getLocalizedMessage());
            }
            if (is != null) {
                try {
                    bundle.load(is);
                } finally {
                    safeClose(is);
                }
            } else {
                throw PicketBoxMessages.MESSAGES.unableToLoadPropertiesFile(propertiesName);
            }
            PicketBoxLogger.LOGGER.tracePropertiesFileLoaded(propertiesName, bundle.keySet());
        } else {
            InputStream is = null;
            try {
                is = defaultUrl.openStream();
                bundle.load(is);
                PicketBoxLogger.LOGGER.tracePropertiesFileLoaded(defaultsName, bundle.keySet());
            } catch (Throwable e) {
                PicketBoxLogger.LOGGER.debugFailureToLoadPropertiesFile(defaultsName, e);
            } finally {
                safeClose(is);
            }
        }
        return bundle;
    }
860701
public static ParameterTool fromPropertiesFile(File file) throws IOException {
		if (!file.exists()) {
			throw new FileNotFoundException("Properties file " + file.getAbsolutePath() + " does not exist");
		}
		try (FileInputStream fis = new FileInputStream(file)) {
			return fromPropertiesFile(fis);
		}
	}
519048
public static Properties fromFile(
    final File file)
    throws IOException
  {
    Objects.requireNonNull(file, "File");

    try (InputStream stream = Files.newInputStream(file.toPath())) {
      final Properties p = new Properties();
      p.load(stream);
      return p;
    }
  }
1104023
@SuppressWarnings("unchecked")
    public static <T> T load(String fileName) {
        return (T) load(new File(fileName));
    }
113754
public static Properties load (File from)
        throws IOException
    {
        Properties props = new Properties();
        BufferedInputStream bin = new BufferedInputStream(new FileInputStream(from));
        try {
            props.load(bin);
            return props;
        } finally {
            StreamUtil.close(bin);
        }
    }