6
* Class to represent an operation of mkgmap
7
* including input parameters and what to do with the output
11
private String[] _arguments = null;
12
private File _outputFile = null;
13
private File _requestedFile = null;
17
* @param inArgs command line arguments to mkgmap
18
* @param inOutputFile output file generated by mkgmap
19
* @param inRequestedFile requested output file
21
public Operation(String[] inArgs, File inOutputFile, File inRequestedFile)
24
_outputFile = inOutputFile;
25
_requestedFile = inRequestedFile;
26
if (!_requestedFile.getName().toLowerCase().endsWith(".img")) {
27
_requestedFile = new File(_requestedFile.getAbsolutePath() + ".img");
32
* Constructor for a convert operation
33
* @param inOsmFile osm file to convert
34
* @param inName name of map
35
* @param inRequestedFile file requested by user
36
* @return Operation object
38
public static Operation makeConvertOperation(File inOsmFile, String inName, File inRequestedFile)
40
String[] args = new String[] {"--mapname=" + inName, inOsmFile.getAbsolutePath()};
41
return new Operation(args, new File(inName + ".img"), inRequestedFile);
45
* Constructor for a combine operation
46
* @param inFiles array of files to combine
47
* @param inRequestedFile file requested by user
48
* @return Operation object
50
public static Operation makeCombineOperation(String[] inPaths, File inRequestedFile)
52
String[] args = new String[inPaths.length + 1];
53
args[0] = "--gmapsupp";
54
System.arraycopy(inPaths, 0, args, 1, inPaths.length);
55
return new Operation(args, new File("gmapsupp.img"), inRequestedFile);
59
* @return command line arguments for mkgmap
61
public String[] getArgs()
67
* @return output file from mkgmap
69
public File getOutputFile()
75
* @return requested file
77
public File getRequestedFile()
79
return _requestedFile;