List directories inside applet

Hi, How can I list all the directories and files that are inside my applet(inside the jar file)?
Thanks,
roland

jar tf myjar.jar or simply open in WinZip.

Thanks for the reply, Sorry I didn’t explain properly.
Do you know how to do this in code?
I have code for listing a directory outside of a jar file but I can’t list the files inside it like this.


    		List<String> contents = new ArrayList<String>();
    		File dir = new File(_strDirectory);
    
    		String[] children = dir.list();
    		if (children != null) 
    		{
    		    for (int i=0; i<children.length; i++) 
    		    {
    		        // Get filename of file or directory
    		        String filename = children[i];
    		        if (!filename.startsWith("."))
    		        	contents.add(filename);
    		    }
    		}
		
    		return contents;

The new NIO2 stuff in Java7 can treat jars like filesystems. Check out http://blogs.oracle.com/xuemingshen/entry/the_zip_filesystem_provider_in1 for an example (jars are zip files so the same code will work on a jar)

Note that by design you can’t do this with an unsigned applet, and there is not any way around this. You’ll have to generate some sort of index file ahead of time for those.

Thanks sproingie :slight_smile: