• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reading a file from directory

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Wink, wink, nudge, nudge, say no more, it's a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic