• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

property file

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 382
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic