-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi jan
If i get you right, you have a JWS application and you want your geo-data/Shapes to be managed by the JWS cache? I use the same technique for a long time Atlases exported with Geopublisher (GP exports JavaWebStart atlases, http://en.geopublishing.org/Geopublisher) If so, you can 1. put your shapes into signed jars 2. add the jars to the .jnlp file 3. then getClass().getResource() should work 4. you can then use JNLPService to determine which parts/=jars are already cached or will be downloaded on demand. Disadvantage: The URL to your shape will be like: jar://file://....jar!/countries.shp this works for reading, but since the jar is a zip file, it doesn't suppoert random read access... So it is a bit slower... Fell free to look into the sourcecode of Geopublisher/AtlasViewer: http://wald.intevation.org/projects/atlas-framework/ Greetings, Steve Am 03.02.2011 16:27, schrieb Jan Peters: > Dear all, > last time I asked I tried to load a shapefile from the web and thanks to Ian > Turton I got a solution for that. > > My problem now is that the loading of the file takes quite a while, so I > would rather prefer to load it while my WebStart application starts so the > user has the file locally stored in a jar file that is being retrieved on > load of the application. > > Unfortunately these > > URL shapeurl = this.getClass().getResource("map.shp"); > > and > > URL shapeurl = this.getClass().getClassLoader().getSystemResource("map.shp"); > > do not work (null pointer exception, the application does not seem to find > the path, but I tried every combination of package name, relative and > absolute paths etc. to no avail). > > Am I missing something fundamental here? > > Regards and thanks in advance again > Jan - -- wiki² - Softwareentwicklung Stefan A. Tzeggai, geb. Krüger Straßburger Weg 26 53113 Bonn email [email protected] phone 0228 24 000 528 mobile 0176 40 38 9559 webpage wikisquare.de twitter http://twitter.com/geopublishing skype alfonx reclaim your net - http://tor.eff.org enforce privacy - http://www.pgpi.org pgp key id: 51B576FD - http://pgp.mit.edu Please note that according to the German law on data retention, information on every electronic information exchange with me is retained for a period of six months. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1KzQwACgkQdFDQR1G1dv1UQwCgoby2XWKWM4sn3saUsag1aY4m ldcAoMwuiLqPde6xztYtWk0CMo32UqjN =s0NF -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
