File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading properties file problem

 
Angus Rose
Ranch Hand
Posts: 56
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
I'm up against one of those irritating classpath problems. Let me explain the scenario:

I have an application deployed as a jar file. This application reads a properties file when it fires up. This properties file needs to be placed in a different directory when deployed so that the administrator can edit the properties contained within it. I have tried several ways of reading this file including
InputStream l_isAttillaPropertiesInputStream = this.getClass().getClassLoader().getResourceAsStream("AttillaQ.properties");

Currently, the properties file sits in the same directory as the jar file containing the application and the directory is on the classpath. Alas, the InputStream object is still null, i.e. the classloader cannot find the properties file.

Please help me!!!

Angus
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do not post the same question in multiple forums.

See the JavaRanch FAQ: Carefully choose one forum.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic