Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

path to load a file

Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a properties file inside the following folder structure


I have to load this properties file from which is in the following folder structure....


how do I do this ?
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Properties properties = new Properties();
try {
properties.load(new FileInputStream("/project/folder1/"));
} catch (IOException e) {

you must use the absolute path or the relative path of the properties file.
remember, if you are executing p1.p2.A.class then your class could be in c:\p1\p2 folder, but you will be executing it from c:\ so the path of the properties file should be either absolute path or relative path to c:\
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic