• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • 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: 74037
332
  • 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?
 
Sheriff
Posts: 26777
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.
 
Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic