package org.rabix.executor.pathmapper.local;

import java.io.File;
import java.io.IOException;
import java.util.Map;

import org.rabix.bindings.mapper.FileMappingException;
import org.rabix.bindings.mapper.FilePathMapper;
import org.rabix.executor.config.StorageConfiguration;

import com.google.inject.Inject;

public class LocalPathMapper implements FilePathMapper {

  private final StorageConfiguration storageConfig;
  
  @Inject
  public LocalPathMapper(final StorageConfiguration storageConfig) {
    this.storageConfig = storageConfig;
  }
  
  @Override
  public String map(String path, Map<String, Object> config) throws FileMappingException {
    if (!path.startsWith(File.separator)) {
      try {
        return new File(storageConfig.getPhysicalExecutionBaseDir(), path).getCanonicalPath();
      } catch (IOException e) {
        throw new FileMappingException(e);
      }
    }
    return path;
  }

}

@@ -84,24 +84,52 @@
 OException;%0A
+import java.nio.file.Paths;%0A
 import java.
@@ -688,38 +688,35 @@
 f (!
-path.startsWith(File.separator
+Paths.get(path).isAbsolute(
 )) %7B

Fix issue with Windows paths