Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

Launch by JAR and listing files in ZIP

Thread view: 
Karsten Wutzke - 25 Jun 2007 10:42 GMT
Hi all!

1. Is there any reliable way to tell whether the current program was
launched via JAR file or locally via the class files? I need to list
files in JAR directories in the former case, if not launched via JAR
file, I want to list files in local dirs via File.listFiles. ... which
brings me to issue #2...

2. How do I list files in JAR/ZIP directories?

I'd like to go the same way as resources do, e.g.
this.getClass().getResource(relativePath) shall (at best) create a URL
object that points to the JAR resource directory when launched via
JAR. When launched via class files, the URL resource to the local
directory should be returned. This looks like a trivial thing to me,
but it is getting more complicated than I thought, because there is no
simple way of listing files for URL's (a respective listFiles is
missing).

Any tips on how to best solve this quickly and painlessly?

TIA
Karsten
Roedy Green - 25 Jun 2007 12:13 GMT
>2. How do I list files in JAR/ZIP directories?

see http://mindprod.com/products1.html#JARLOOK
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.