Ignore:
Timestamp:
2014-12-13T16:26:23+01:00 (10 years ago)
Author:
bastik
Message:

remove old migration code (.etag file)

File:
1 edited

Legend:

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

    r30430 r30847  
    406406        }
    407407
    408         /** Load backward-compatiblity .etag file and if it exists move it to new .tags file*/
    409         private void loadOldETagfromFile() {
    410             File etagFile = new File(tileCacheDir, tile.getZoom() + "_"
    411                     + tile.getXtile() + "_" + tile.getYtile() + ETAG_FILE_EXT);
    412             if (!etagFile.exists()) return;
    413             try (FileInputStream f = new FileInputStream(etagFile)) {
    414                 byte[] buf = new byte[f.available()];
    415                 f.read(buf);
    416                 String etag = new String(buf, TAGS_CHARSET.name());
    417                 tile.putValue("etag", etag);
    418                 if (etagFile.delete()) {
    419                     saveTagsToFile();
    420                 }
    421             } catch (IOException e) {
    422                 System.err.println("Failed to load compatiblity etag: " + e.getLocalizedMessage());
    423             }
    424         }
    425 
    426408        protected void loadTagsFromFile() {
    427             loadOldETagfromFile();
    428409            File tagsFile = getTagsFile();
    429410            try (BufferedReader f = new BufferedReader(new InputStreamReader(new FileInputStream(tagsFile), TAGS_CHARSET))) {
Note: See TracChangeset for help on using the changeset viewer.