Cleanup base directory selection, use Context.getExternalFilesDirs and request WRITE_EXTERNAL_STORAGE permission, use AndroidX and raise minSdkVersion to 14. Use File instead of plain Strings for paths in some places, use try-with-resources, and some other small improvements.
This commit is contained in:
parent
72e2e13d07
commit
dbdfd36f88
17 changed files with 173 additions and 220 deletions
|
|
@ -41,7 +41,7 @@ public class RoutingEngine extends Thread
|
|||
|
||||
private volatile boolean terminated;
|
||||
|
||||
protected String segmentDir;
|
||||
protected File segmentDir;
|
||||
private String outfileBase;
|
||||
private String logfileBase;
|
||||
private boolean infoLogEnabled;
|
||||
|
|
@ -64,7 +64,7 @@ public class RoutingEngine extends Thread
|
|||
|
||||
private boolean directWeaving = !Boolean.getBoolean( "disableDirectWeaving" );
|
||||
|
||||
public RoutingEngine( String outfileBase, String logfileBase, String segmentDir,
|
||||
public RoutingEngine( String outfileBase, String logfileBase, File segmentDir,
|
||||
List<OsmNodeNamed> waypoints, RoutingContext rc )
|
||||
{
|
||||
this.segmentDir = segmentDir;
|
||||
|
|
|
|||
|
|
@ -11,20 +11,20 @@ import btools.mapaccess.StorageConfigHelper;
|
|||
|
||||
public final class RoutingHelper
|
||||
{
|
||||
public static File getAdditionalMaptoolDir( String segmentDir )
|
||||
public static File getAdditionalMaptoolDir( File segmentDir )
|
||||
{
|
||||
return StorageConfigHelper.getAdditionalMaptoolDir(segmentDir);
|
||||
}
|
||||
|
||||
public static File getSecondarySegmentDir( String segmentDir )
|
||||
public static File getSecondarySegmentDir( File segmentDir )
|
||||
{
|
||||
return StorageConfigHelper.getSecondarySegmentDir(segmentDir);
|
||||
}
|
||||
|
||||
|
||||
public static boolean hasDirectoryAnyDatafiles( String segmentDir )
|
||||
public static boolean hasDirectoryAnyDatafiles( File segmentDir )
|
||||
{
|
||||
if ( hasAnyDatafiles( new File( segmentDir ) ) )
|
||||
if ( hasAnyDatafiles( segmentDir ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue