Created
May 26, 2015 01:47
-
-
Save r-deleon/69fa8d34a2c15e917d34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ClasesBasicas; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.util.Properties; | |
public class Config { | |
private static Properties config; | |
public static Properties getConfig() { | |
if (config == null) { | |
config = new Properties(); | |
try { | |
config.load(new FileInputStream("config.properties")); | |
} catch (IOException ioe) { | |
ioe.printStackTrace(); | |
} | |
} | |
return config; | |
} | |
} | |
// Se usa de esta manera | |
Config.getConfig().getProperty("db-user"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alfresco-host=http://localhost:8081/alfresco | |
alfresco-username=admin | |
alfresco-password=admin | |
db-user=root | |
db-password= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
config.properties va en el root del proyecto