This commit is contained in:
avelino
2026-11-20 17:11:52 +01:00
commit fc9935140d
48 changed files with 1156 additions and 0 deletions
@@ -0,0 +1,30 @@
package aadd.palomafp.anp.conexion;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
public class ConfigConexion {
private static final String RUTA_CONFIG = "ficheros/config.properties";
private static final Properties PROPS = new Properties();
static {
try (FileInputStream fis = new FileInputStream(RUTA_CONFIG)) {
PROPS.load(fis);
} catch (IOException e) {
throw new IllegalStateException("No se pudo leer" + RUTA_CONFIG, e);
}
}
private ConfigConexion() {}
public static String get(String clave) {
String valor = PROPS.getProperty(clave);
if (valor == null) {
System.out.println("Falta la propiedad: " + clave);
}
return valor;
}
}