public Downloadable getDownloadable(String url) { for (DataSource dataSource : getDataSources()) { if(!url.startsWith(dataSource.getBaseUrl())) continue; String uri = url.substring(dataSource.getBaseUrl().length()); Downloadable downloadable = dataSource.getDownloadable(uri); if (downloadable != null) return downloadable; } return null; }
String fileName = filePath.substring(directoryPath.length() + 1); Downloadable downloadable = dataSource.getDownloadable(fileName); if (downloadable != null) return downloadable;
if (isInitialized()) { for (String key : uris) { Downloadable downloadable = getSegments().getDownloadable(key); if (downloadable != null) { if (!createSegmentFile(downloadable.getUri()).exists())
private Collection<Downloadable> getDownloadablesFor(BoundingBox boundingBox) { Collection<Downloadable> result = new HashSet<>(); double longitude = boundingBox.getSouthWest().getLongitude(); while (longitude < boundingBox.getNorthEast().getLongitude()) { double latitude = boundingBox.getSouthWest().getLatitude(); while (latitude < boundingBox.getNorthEast().getLatitude()) { String key = createFileKey(longitude, latitude); Downloadable downloadable = getSegments().getDownloadable(key); if (downloadable != null) result.add(downloadable); latitude += 1.0; } longitude += 1.0; } return result; }