Created
April 4, 2017 01:38
-
-
Save easai/521b7738b8e532c9c08c9e6bfb623ddc 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
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