Skip to content

Instantly share code, notes, and snippets.

@easai
Created April 4, 2017 01:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save easai/521b7738b8e532c9c08c9e6bfb623ddc to your computer and use it in GitHub Desktop.
Save easai/521b7738b8e532c9c08c9e6bfb623ddc to your computer and use it in GitHub Desktop.
public void readProperties()
{
FileInputStream in=null;
try
{
File file=new File("ImportFile.properties");
if(file.exists())
{
in=new FileInputStream(file);
properties.loadFromXML(in);
}
}
catch(Exception e){e.printStackTrace();}
finally
{
try
{
if(in!=null)
in.close();
}
catch(Exception e){e.printStackTrace();}
}
String property="";
if((property=properties.getProperty("destDir"))==null || property.equals(""))
properties.setProperty("destDir","e:/photos");
if((property=properties.getProperty("sourceDir"))==null || property.equals(""))
properties.setProperty("sourceDir","g:/");
if((property=properties.getProperty("debug"))!=null && !property.equals(""))
debug=property.equals("true")?true:false;
else
properties.setProperty("debug","false");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment