Ok, in my solitaire software (version 0.3 will be public soon) I wanto to use multiple cards and deck backside. The technique I used to provide themes i pretty simple: for cards every subdirectory in imgs/cards is a deck theme, and for the cards backside the program should look in imgs/backs.
The only problem is that, after a week of tampering I was unable to browse effectively the files available in the jar and othside the Jar.
(In the Jar)
I can access single reources with ClassLoader.getResource() and getResourceAsStream() but as far I tried I cannot use File to enumerate the files in a directory (for example to browse the backsides…).
Another thing I noticed in many other apps for java is that usually the program can check for data in the folders in the jar or in a same folder placed at the jar level where the application is installed (since my solitary architecture is pluggable this is a must to allow others to add their solitaires preserving the application integrity).
(Outside Jar)
Another thing that bothers me is that File seems not be able to resolve relative pathnames in Windows, no matter i use “imgs\” or “.\imgs\” to locate the imgs directory it will fail always. Only if I provide the integral pathname of the directory it will locate it and let me browse files.
I tried system preferences to retrieve the path where the application is installed but the only place is store is in the classpath, togheter with other directories (and how the program will know where the user put it?).
