Thomas,
Look at this sample Download tile cache | ArcGIS for Developers - it should clarify you the approach, even though it is for older Java version.
Next, to export cache, you need to have a Tiled Map Service with Export Tiles capability enabled. Rely on your ArcGIS for Server instance or use dedicated Esri servers for extracting tiles i.e. http:/tiledbasemaps.arcgis.com/arcgis/rest/services.
Last, but not least. Remember to check answered questions as resolved. It would help the community a bit, when looking for an answer to the similar questions you have.
Regards,
Adam