Ignore:
Timestamp:
2009-08-02T14:24:06+02:00 (15 years ago)
Author:
stotz
Message:

Changed the default path where JMapViewer places it's tile disk cache: added user name for avoiding permission problems on systems that do not have per-user temp directories.

@see JOSM ticket #3107 <https://josm.openstreetmap.de/ticket/3107>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmFileCacheTileLoader.java

    r16392 r16768  
    5656        super(map);
    5757        String tempDir = System.getProperty("java.io.tmpdir");
     58        String userName = System.getProperty("user.name");
    5859        try {
    5960            if (cacheDir == null) {
     
    6162                    throw new IOException("No temp directory set");
    6263                }
    63                 cacheDir = new File(tempDir, "JMapViewerTiles");
     64                String subDirName = "JMapViewerTiles";
     65                // On Linux/Unix systems we do not have a per user tmp directory.
     66                // Therefore we add the user name for getting a unique dir name. 
     67                if (userName != null && userName.length() > 0)
     68                    subDirName += "_" + userName;
     69                cacheDir = new File(tempDir, subDirName);
    6470            }
    6571            log.finest("Tile cache directory: " + cacheDir);
     
    7278        }
    7379    }
    74    
     80
    7581    /**
    7682     * Create a OSMFileCacheTileLoader with system property temp dir.
Note: See TracChangeset for help on using the changeset viewer.