• 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

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: 74352
334
  • 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: 26909
82
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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic