Changeset 16392 in osm for applications/viewer/jmapviewer/src/org/openstreetmap/gui
- Timestamp:
- 2009-07-09T00:12:50+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmFileCacheTileLoader.java
r13758 r16392 28 28 * 29 29 * @author Jan Peter Stotz 30 * @author Stefan Zeller 30 31 */ 31 32 public class OsmFileCacheTileLoader extends OsmTileLoader { … … 45 46 protected long recheckAfter = FILE_AGE_ONE_DAY; 46 47 47 public OsmFileCacheTileLoader(TileLoaderListener map) { 48 /** 49 * Create a OSMFileCacheTileLoader with given cache directory. 50 * If cacheDir is <code>null</code> the system property temp dir 51 * is used. If not set an IOException will be thrown. 52 * @param map 53 * @param cacheDir 54 */ 55 public OsmFileCacheTileLoader(TileLoaderListener map, File cacheDir) { 48 56 super(map); 49 57 String tempDir = System.getProperty("java.io.tmpdir"); 50 58 try { 51 if (tempDir == null) 59 if (cacheDir == null) { 60 if (tempDir == null) { 61 throw new IOException("No temp directory set"); 62 } 63 cacheDir = new File(tempDir, "JMapViewerTiles"); 64 } 65 log.finest("Tile cache directory: " + cacheDir); 66 if (!cacheDir.exists() && !cacheDir.mkdirs()) { 52 67 throw new IOException(); 53 File cacheDir = new File(tempDir, "JMapViewerTiles"); 54 log.finest("Tile cache directory: " + cacheDir); 55 if (!cacheDir.exists() && !cacheDir.mkdirs()) 56 throw new IOException(); 68 } 57 69 cacheDirBase = cacheDir.getAbsolutePath(); 58 70 } catch (Exception e) { 59 71 cacheDirBase = "tiles"; 60 72 } 73 } 74 75 /** 76 * Create a OSMFileCacheTileLoader with system property temp dir. 77 * If not set an IOException will be thrown. 78 * @param map 79 */ 80 public OsmFileCacheTileLoader(TileLoaderListener map) { 81 this(map, null); 61 82 } 62 83
Note:
See TracChangeset
for help on using the changeset viewer.