This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Finding a File outside Workspace in Eclipse IDE

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
i have made a Properties File where i will be storing some information that is required for configuring The Velocity engine. The properties file also stores the path where all the Velocity Templates are stored. If i keep the Velocity Templates in a Folder inside the Workspace itself, it finds it and gives me the required output But if i give a path outside the Workspace, it is not able to find the resource.

My Workspace is VelocityPOC
i want to store all Velocity Templates outside the workspace in a folder VelTemplates

Can any1 Please tell me how i must specify the path in the properties file to access the Velocity Template stored in the folder VelTemplates

Thanks in advance
 
Marshal
Posts: 75637
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not any1, please.

Moving thread; too difficult for "beginning".
 
Anupama Sudhakaran
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i actually tried to finda forum for Eclipse but could not find any. so posted the query there.
can you tell me the solution
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'd need to provide a complete, absolute path, or figure out what directory Eclipse is using as the current directory when running the program.

For what it's worth, unless you have a specific need to allow users to override your templates, I'd get the templates as a classpath resource. (Even if you *do* need to allow users to supply their own templates, I'd do so in a different way, like a property or command line argument.)
 
Anupama Sudhakaran
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes i am doing this so that User can supply his own templates also. Can you be a little more clear how i should go about doing this?
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what else I can tell you--provide a default path, allow the user to override, and build the absolute template pathnames out of the defined path and the template name.
 
Your buns are mine! But you can have this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic