org.openstreetmap.gui.jmapviewer
Class OsmFileCacheTileLoader.FileLoadJob
java.lang.Object
org.openstreetmap.gui.jmapviewer.OsmFileCacheTileLoader.FileLoadJob
- All Implemented Interfaces:
- java.lang.Runnable, TileJob
- Enclosing class:
- OsmFileCacheTileLoader
protected class OsmFileCacheTileLoader.FileLoadJob
- extends java.lang.Object
- implements TileJob
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
input
java.io.InputStream input
tile
Tile tile
tileCacheDir
java.io.File tileCacheDir
tileFile
java.io.File tileFile
fileAge
long fileAge
fileTilePainted
boolean fileTilePainted
OsmFileCacheTileLoader.FileLoadJob
public OsmFileCacheTileLoader.FileLoadJob(Tile tile)
getTile
public Tile getTile()
- Description copied from interface:
TileJob
- Function to return the tile associated with the job
- Specified by:
getTile
in interface TileJob
- Returns:
Tile
to be handled
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
loadOrUpdateTile
protected void loadOrUpdateTile()
loadTileFromFile
protected boolean loadTileFromFile()
loadTileInBuffer
protected byte[] loadTileInBuffer(java.net.URLConnection urlConn)
throws java.io.IOException
- Throws:
java.io.IOException
isOsmTileNewer
protected boolean isOsmTileNewer(long fileAge)
throws java.io.IOException
- Performs a
HEAD
request for retrieving the
LastModified
header value.
Note: This does only work with servers providing the
LastModified
header:
- Parameters:
fileAge
- time of the
- Returns:
true
if the tile on the server is newer than the
file
- Throws:
java.io.IOException
hasOsmTileETag
protected boolean hasOsmTileETag(java.lang.String eTag)
throws java.io.IOException
- Throws:
java.io.IOException
getTileFile
protected java.io.File getTileFile()
getTagsFile
protected java.io.File getTagsFile()
saveTileToFile
protected void saveTileToFile(byte[] rawData)
saveTagsToFile
protected void saveTagsToFile()
loadOldETagfromFile
private void loadOldETagfromFile()
- Load backward-compatiblity .etag file and if it exists move it to new .tags file
loadTagsFromFile
protected void loadTagsFromFile()
JOSM