public class TileWriter extends Object implements IFilesystemCache
IFilesystemCache
. It writes tiles to the file system cache. If the
cache exceeds 600 Mb then it will be trimmed to 500 Mb.OpenStreetMapTileProviderConstants
Modifier and Type | Field and Description |
---|---|
(package private) static boolean |
hasInited |
(package private) Thread |
initThread |
Constructor and Description |
---|
TileWriter() |
Modifier and Type | Method and Description |
---|---|
boolean |
exists(ITileSource pTileSource,
MapTile pTile)
return true if the map file for download already exists
|
static long |
getUsedCacheSpace()
Get the amount of disk space used by the tile cache.
|
void |
onDetach()
Used when the map engine is shutdown, use it to perform any clean up activities and to terminate
any background threads
|
boolean |
remove(ITileSource pTileSource,
MapTile pTile)
Removes a tile from the cache, see issue
https://github.com/osmdroid/osmdroid/issues/426
|
boolean |
saveFile(ITileSource pTileSource,
MapTile pTile,
InputStream pStream)
Save an InputStream as the specified tile in the file system cache for the specified tile
source.
|
static boolean hasInited
Thread initThread
public static long getUsedCacheSpace()
public boolean saveFile(ITileSource pTileSource, MapTile pTile, InputStream pStream)
IFilesystemCache
saveFile
in interface IFilesystemCache
pTileSource
- a tile sourcepTile
- a tilepStream
- an InputStreampublic void onDetach()
IFilesystemCache
onDetach
in interface IFilesystemCache
public boolean remove(ITileSource pTileSource, MapTile pTile)
IFilesystemCache
remove
in interface IFilesystemCache
public boolean exists(ITileSource pTileSource, MapTile pTile)
IFilesystemCache
exists
in interface IFilesystemCache