Search in sources :

Example 1 with ASqliteDbFile

use of net.osmand.aidl.tiles.ASqliteDbFile in project Osmand by osmandapp.

the class OsmandAidlApi method getSqliteDbFiles.

private boolean getSqliteDbFiles(List<ASqliteDbFile> fileNames, boolean activeOnly) {
    File tilesPath = app.getAppPath(IndexConstants.TILES_INDEX_DIR);
    if (tilesPath.canRead()) {
        File[] files = tilesPath.listFiles();
        if (files != null) {
            String activeFile = app.getSettings().MAP_OVERLAY.get();
            for (File tileFile : files) {
                String fileName = tileFile.getName();
                String fileNameLC = fileName.toLowerCase();
                if (tileFile.isFile() && !fileNameLC.startsWith("hillshade") && fileNameLC.endsWith(SQLiteTileSource.EXT)) {
                    boolean active = fileName.equals(activeFile);
                    if (!activeOnly || active) {
                        fileNames.add(new ASqliteDbFile(fileName, tileFile.lastModified(), tileFile.length(), active));
                    }
                }
            }
        }
    }
    return true;
}
Also used : ASqliteDbFile(net.osmand.aidl.tiles.ASqliteDbFile) GPXFile(net.osmand.GPXUtilities.GPXFile) SelectedGpxFile(net.osmand.plus.track.helpers.GpxSelectionHelper.SelectedGpxFile) ASqliteDbFile(net.osmand.aidl.tiles.ASqliteDbFile) File(java.io.File) ASelectedGpxFile(net.osmand.aidl.gpx.ASelectedGpxFile) AGpxFile(net.osmand.aidl.gpx.AGpxFile)

Aggregations

File (java.io.File)1 GPXFile (net.osmand.GPXUtilities.GPXFile)1 AGpxFile (net.osmand.aidl.gpx.AGpxFile)1 ASelectedGpxFile (net.osmand.aidl.gpx.ASelectedGpxFile)1 ASqliteDbFile (net.osmand.aidl.tiles.ASqliteDbFile)1 SelectedGpxFile (net.osmand.plus.track.helpers.GpxSelectionHelper.SelectedGpxFile)1