• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading a file from directory  RSS feed

 
srikanth Thandra
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I am new to file loading concepts and working on below requirement. I need your help on achieving the below:

There is a property file with name system.properties containing a property THEMES_DIR_PATH=C:/Personal/WebContent/themes. This folder is there in my project/WebContent also. The person earlier coded are reading the property file in a static block of java file and loading the THEMES_DIR_PATH and it is working only in windows operating system. Now what my requirement is can we achieve this THEMES_DIR_PATH directory loading on any operating system (windows oe linux) . How can i achieve this. Please help me on this as this is a very urgent requirement.


Thanks and regards,
Srikanth.
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We don't use the word urgent here.

Do you know how to get the OS name from the system properties?
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
srikanth Thandra wrote:There is a property file with name system.properties containing a property THEMES_DIR_PATH=C:/Personal/WebContent/themes. This folder is there in my project/WebContent also. The person earlier coded are reading the property file in a static block of java file and loading the THEMES_DIR_PATH and it is working only in windows operating system.


But that is a Windows-specific path name. If you want this to work in other environments then you'll have to change the property file to contain a proper path name for that environment.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!