first commit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package org.palomafp.aadd.rmr;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Properties;
|
||||
|
||||
public class GestorPropiedades {
|
||||
|
||||
private static Properties propiedades = new Properties();
|
||||
|
||||
static {
|
||||
|
||||
Path ruta = Paths.get("config", "application.properties");
|
||||
|
||||
try (BufferedReader entrada = Files.newBufferedReader(ruta, StandardCharsets.ISO_8859_1)) {
|
||||
propiedades.load(entrada);
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("Error al cargar el archivo de propiedades: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static String get(String clave) {
|
||||
return propiedades.getProperty(clave);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user