473,320 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Get contents of cached jar

Here is a method that will access the contents of a cached jar if you are
running as an applet.
You can easily adapt it to return a collection or apply a filter on the
filenames to return a
collection of sound files or image files.

public void getJarContents()
{
try
{
// Bootstrap access to the jar contents
// get this class name from the class loader.
URL thisURL = getClass().getResource("xxxxxx.class");
System.out.println(thisURL);

URLConnection connection = thisURL.openConnection();
System.out.println(connection);

if (connection instanceof JarURLConnection)
{
JarFile jar = ((JarURLConnection)connection).getJarFile();
System.out.println("Jar: " + jar);
Enumeration jarEntries = jar.entries();
while(jarEntries.hasMoreElements())
{
JarEntry e = (JarEntry) jarEntries.nextElement();
System.out.println("Jar entry: " + e.getName());
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
Jul 17 '05 #1
0 1214

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Matt Kruse | last post by:
Let me break down the issue: Ultimate Goal: Building a custom debugger window which shows a function trace in and out of functions as they are called, which can be executed via IE's Context Menu...
6
by: Robert Scheer | last post by:
Hi. I have two .js files that are used on several of my pages. I made some changes in one of the files. When I call the pages, the old functions are called because of the browser's cache. What...
1
by: Harod Ruthgar | last post by:
var image = new Image(); image.src="pathToTheFile"; The above code is called 25 times (with different pathToTheFile) within a loop. I manually checked the cache directory and not all images...
21
by: Jay Levitt | last post by:
I'm just starting to play around with CSS and MovableType. My home page (http://www.jay.fm) now validates on both the CSS and the XHTML. However, the Google cached version shows the wrong font in...
10
by: cosmic foo | last post by:
I have a page with about 100 images of about 10k each. where a typical img tag looks like this, <img src="item001.jpg" height="70" alt="" onMouseOver="showPic(this)" border="0"> Not all the...
2
by: ALPO | last post by:
ANy good examples of paging against a cached dataset. Our datasets will be cached in viewstate.
2
by: Thomas | last post by:
Hi, Is AppSettings cached? And is the cache updated when web.config changes? - Thomas
2
by: Tomasz | last post by:
Hello, I'm a newbie in ASP.NET and i have following problem. I've got two separate pages. On the first one i have a list of workers, which is read from mdb database and a button with event...
14
by: Gilles Ganault | last post by:
Hi One of the ways to raise performance for PHP apps is to separate static contents from dynamic contents, so that the former can be compiled once into cache. Can someone give me a simple...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.