[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: getting the name of a jar
If you have created a File object for the jar file, you can find/ test the name using getName() method.
Shekhar
"Jason R. Kretzer" <jason@OpinionOne.com> wrote:
>Hello everyone,
>
>I have a jar that needs to perform an operation on itself(like read a text file inside itself). This is easy enough, however, here is the catch. How can a jar determine what its own file name is? This will need to be determined at runtime.
>
>eg.
>
>1.) foo.jar is created using the JDK jar tool.
>2.) John Q. User renames the jar to bar.jar.
>3.) When executed, bar.jar knows its name is "bar.jar" and sets up a connection to do its operation.
>
>
>Question: How can I get bar.jar to know what its name is at runtime?
>
>Thanks,
>
>-Jason
>
>************************************************************************************
>Jason R. Kretzer
>Software Engineer
>Opinion One
>Email: jason@opone.com
>Phone: (513) 361-2771
>Website: http://alia.iwarp.com
>
>"Make visible what, without you, might perhaps never have been seen."
>--Robert Bresson
>************************************************************************************
>
>
--
ChandraShekhar Pendyala
__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/
Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/