﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
11548	TMS regression: can not load tiles from file://	akks	wiktorn	"On the forum some people complained that they have to use r8159 because newer version does not support file:// in TMS urls (they have some custom downloaded tiles, I hope from allowed sources).

The error look like 
{{{
ПРЕДУПРЕЖДЕНИЕ: java.lang.ClassCastException: sun.net.www.protocol.file.FileURLC
onnection cannot be cast to java.net.HttpURLConnection
ПРЕДУПРЕЖДЕНИЕ: JCS - Silent failure during download: file:/k:/SASPlanet/cache_g
mt/pskov/z14/4962/9558.png
ПРЕДУПРЕЖДЕНИЕ: JCS - Silent failure during download: file:/k:/SASPlanet/cache_g
mt/pskov/z14/4963/9558.png
ПРЕДУПРЕЖДЕНИЕ: JCS - Silent failure during download: file:/k:/SASPlanet/cache_g
mt/pskov/z14/4962/9559.png
ПРЕДУПРЕЖДЕНИЕ: JCS - Silent failure during download: file:/k:/SASPlanet/cache_g
mt/pskov/z14/4963/9559.png
java.lang.ClassCastException: sun.net.www.protocol.file.FileURLConnection cannot
be cast to java.net.HttpURLConnection
        at org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob.getURLConnec
tion(JCSCachedTileLoaderJob.java:426)
        at org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob.loadObject(J
CSCachedTileLoaderJob.java:331)
        at org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob.run(JCSCache
dTileLoaderJob.java:251)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
java.lang.ClassCastException: sun.net.www.protocol.file.FileURLConnection cannot
be cast to java.net.HttpURLConnection
        at org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob.getURLConnec
tion(JCSCachedTileLoaderJob.java:426)
        at org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob.loadObject(J
CSCachedTileLoaderJob.java:331)
        at org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob.run(JCSCache
dTileLoaderJob.java:251)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
}}}

Using ImageryCache plugin with old-style http loader solved the problem.

I have created some patch but it is better to be checked by specialist.
HTTP caching ticked may be related: https://josm.openstreetmap.de/ticket/10139

Compiled .jar with the patch: https://dl.dropboxusercontent.com/u/63393258/josm-custom-nonhttp-cache.jar

"	defect	closed	normal	15.08	Core imagery	latest	fixed	TMS tiles regression	
