org.openstreetmap.gui.jmapviewer
Class OsmFileCacheTileLoader.FileLoadJob
java.lang.Object
org.openstreetmap.gui.jmapviewer.OsmFileCacheTileLoader.FileLoadJob
- All Implemented Interfaces:
- java.lang.Runnable
- Enclosing class:
- OsmFileCacheTileLoader
protected class OsmFileCacheTileLoader.FileLoadJob
- extends java.lang.Object
- implements java.lang.Runnable
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
input
java.io.InputStream input
tilex
int tilex
tiley
int tiley
zoom
int zoom
tile
Tile tile
source
TileSource source
tileCacheDir
java.io.File tileCacheDir
tileFile
java.io.File tileFile
fileAge
long fileAge
fileTilePainted
boolean fileTilePainted
OsmFileCacheTileLoader.FileLoadJob
public OsmFileCacheTileLoader.FileLoadJob(TileSource source,
int tilex,
int tiley,
int zoom)
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
-
- 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()
saveTileToFile
protected void saveTileToFile(byte[] rawData)
saveETagToFile
protected void saveETagToFile(java.lang.String eTag)
loadETagfromFile
protected java.lang.String loadETagfromFile()