• 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

Usage of getResourceAsStream method

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I hava a code that gets the InputStream for a file :
Object.class.getResourceAsStream("/config.xml");
This works fine when run on an app server with the server classpath set to the file's path.
When this code is executed outside the appserver from an Ant task the InputStream returned is null. I tried placing the file at different locations and also specifying it in Ant's classpath, but no luck.

Is it even possible to execute this code from Ant or main class?

Thanks for your help,
Kamath
[ July 18, 2006: Message edited by: Dileep Kamath ]
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

We have a forum dedicated to Ant and other build tools here. Since this question is really about dealing with the class path from Ant, I'm going to move this topic to that forum. See you there!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic