Java Utililty Methods Properties Load from File

List of utility methods to do Properties Load from File

Description

The list of methods to do Properties Load from File are organized into topic(s).

Method

MaploadLocalization(final ZipFile file, final String loc)
load Localization
final Map<String, Properties> locs = new HashMap<>();
final Pattern pattern = Pattern.compile(Pattern.quote(loc) + "(|_[a-z]{2}-[A-Z]{2})\\.properties");
final Enumeration<? extends ZipEntry> en = file.entries();
while (en.hasMoreElements()) {
    final ZipEntry ze = en.nextElement();
    final Matcher m = pattern.matcher(ze.getName());
    if (m.matches()) {
        final String locale = makeLocale(m.group(1));
...
PropertiesloadLocatorInfo(String fileName)
load Locator Info
FileInputStream filecontent = new FileInputStream(new File(fileName));
Properties locatorfile = new Properties();
locatorfile.load(filecontent);
return locatorfile;
voidloadLWJGL()
load LWJGL
try {
    String osName = System.getProperty("os.name").toLowerCase();
    boolean isMacOs = osName.startsWith("mac os x");
    boolean isLinuxOs = osName.startsWith("linux");
    if (isMacOs) {
        System.setProperty("java.library.path", System.getProperty("java.library.path") + ";"
                + new File("native/macosx").getAbsolutePath());
        System.setProperty("org.lwjgl.librarypath", new File("native/macosx").getAbsolutePath());
...
DictionaryloadManifest(File bundleLocation)
load Manifest
ZipFile jarFile = null;
InputStream manifestStream = null;
try {
    String extension = new Path(bundleLocation.getName()).getFileExtension();
    bundleLocation = new File(bundleLocation.getAbsolutePath());
    if (extension != null && (extension.equals("jar") || extension.equals("jar!")) 
            && bundleLocation.isFile()) {
        jarFile = new ZipFile(bundleLocation, ZipFile.OPEN_READ);
...
PropertiesloadMetaConfiguration()
Looks for a ".meta" configuration file on the same folder as the FrostWire executable.
Properties meta = new Properties();
File metaFile = new File(".meta");
if (metaFile.exists() && metaFile.isFile() && metaFile.canRead()) {
    FileInputStream fis = null;
    try {
        fis = new FileInputStream(metaFile);
        meta.load(fis);
    } catch (Exception e) {
...
voidloadMimeTypes(InputStream inputStream)
load Mime Types
MimeTypes.clear();
MimeTypes.load(inputStream);
voidloadNative(File nativeLibsFolder)
load Native
String[] libs = { "gdal", "gdalconstjni", "gdaljni", "ogrjni", "osrjni" };
String platform = getPlatformPath("");
for (String name : libs) {
    StringBuilder filename = new StringBuilder();
    if (platform.contains("win")) {
        filename.append(name);
        if (name.equals("gdal")) {
            filename.append("19");
...
PropertiesloadNecessaryPackagePrivateProperties(Class aClass, String aFileName)
load Necessary Package Private Properties
try {
    return loadProperties(aClass, aFileName, aClass.getResourceAsStream(aFileName));
} catch (NullPointerException e) {
    throw new RuntimeException(new FileNotFoundException(aClass.getPackage() + "." + aFileName));
StringloadOSDependentLibrary()
load OS Dependent Library
String osFamily = getOsFamily();
return osFamily + "." + System.getProperty("os.arch");
StringloadParamFromFile(String fileName, String param, String defValue)
devuelve el valor correspondiente al parametro en el fichero dado
Properties p = new Properties();
p.load(new FileInputStream(fileName));
return p.getProperty(param, defValue);