• Post Reply Bookmark Topic Watch Topic
  • New Topic

property file  RSS feed

 
basia fish
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

content of
myproperty.properties file

directory = c:\ddd\
subdirectories = df,d,g

how do i read the file displaying whole directory
Properties property = new Properties();
FileInputStream inputFile = null;
try{
inputFile = new FileInputStream("directoryProperties.properties");
property.load(inputFile);
}catch (IOException e){}

String s = property.getProperty("directory"); - this returns directory=c dd

thanks a lot
 
Sadanand Murthy
Ranch Hand
Posts: 382
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by basia fish:
hi

content of
myproperty.properties file

directory = c:\ddd\
subdirectories = df,d,g

how do i read the file displaying whole directory
Properties property = new Properties();
FileInputStream inputFile = null;
try{
inputFile = new FileInputStream("directoryProperties.properties");
property.load(inputFile);
}catch (IOException e){}

String s = property.getProperty("directory"); - this returns directory=c dd

thanks a lot


You may have to change:

to:


It is proobably interpreting \d as some escape sequence/char.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!