fix: custom profile dir relative to profile dir

This commit is contained in:
Norbert Renner 2014-05-22 13:09:35 +02:00
parent 3df98310fb
commit 8327fd4e24
3 changed files with 5 additions and 2 deletions

View file

@ -130,7 +130,8 @@ public class RouteServer extends Thread
ServiceContext serviceContext = new ServiceContext();
serviceContext.segmentDir = args[0];
System.setProperty( "profileBaseDir", args[1] );
serviceContext.profileDir = args[1];
System.setProperty( "profileBaseDir", serviceContext.profileDir );
serviceContext.customProfileDir = args[2];
int maxthreads = Integer.parseInt( args[4] );

View file

@ -11,6 +11,7 @@ import btools.router.OsmNodeNamed;
public class ServiceContext
{
public String segmentDir;
public String profileDir;
public String customProfileDir;
public Map<String,String> profileMap = null;
public List<OsmNodeNamed> nogoList;

View file

@ -53,7 +53,8 @@ public class ProfileUploadHandler
private File getOrCreateCustomProfileDir()
{
File customProfileDir = new File(serviceContext.customProfileDir);
// workaround: customProfileDir relative to profileDir, because RoutingEngine doesn't know custom profiles
File customProfileDir = new File(serviceContext.profileDir, serviceContext.customProfileDir);
if (!customProfileDir.exists())
{
customProfileDir.mkdir();