aspose file tools*
The moose likes JBoss/WildFly and the fly likes Giving file path in jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Giving file path in jar" Watch "Giving file path in jar" New topic
Author

Giving file path in jar

Sunil Huilgol
Greenhorn

Joined: Jan 22, 2006
Posts: 8
Hello ranchers,
I have given a relative path of a file in my code(a remote session bean).when i deploy my jar file and run the client somehow the working direcyory changes to JBOSS_HOME/bin and whatever path i had given in my code is not considered. I have the file i want to use in the jar.So how to get access to a the file(is is an XSD file) and why does the working directory change?

Thanks in advance
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

I think you need to use getResourceAsStream(). You won't be able to do any File operations in JBoss because of security.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Giving file path in jar