我想在 Java 中提供 3 个输入作为命令行参数:
inputFileLocation
configFileList
outputFileLocation
但我无法理解如何将列表作为命令行参数。我试过这样的事情:
public class BatchLauncher {
public static void main(String[] args) {
int argc = 0;
String inputFileLocation = argc < args.length ? args[argc++] : null;
String configFileList = argc < args.length ? args[argc++] : null;
String outputFileLocation = argc < args.length ? args[argc++] : null;
CaptureBatch captureBatch = new CaptureBatch();
captureBatch.setInputFileLocation(inputFileLocation);
captureBatch.setConfigFileList(configFileList);
captureBatch.setOutputFileLocation(outputFileLocation);
}
}
我在captureBatch.setConfigFileList(configFileList);
.
输入将如下所示:
D:/input a.conf,b.conf,c.conf D:/output
其中,
D:/input
是带分隔符的,
是.inputFileLocation
a.conf,b.conf,c.conf
configFileList
,
D:/output
outputFileLocation