Skip to content

Commit

Permalink
[#288] Corrected the expected parameter list in the InstanceConfigura…
Browse files Browse the repository at this point in the history
…tor usage message.
  • Loading branch information
Oliver Galloway-Lunn committed Jul 15, 2013
1 parent 83537cd commit fda176f
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,28 +173,32 @@ public static void main(String[] args) {

private static void checkUsage(String[] args) {
if (args.length != 16) {
System.out
.println("Bad command line arguments. Usage:\n\t java com.gallatinsystems.instancecreator.app.InstanceConfigurator <awsSecretKey> <awsIdentifier> <instanceName> <s3Bucket> <directories> <s3policyFileTemplateName> <signingKey> <dataUploadUrl> <serverBase> <storepass> <keypass> <alias> <reportsEmailAddress> <scoreAPFlag> <organization> <localLocation> <keystore> <mapsApiKey> <restApiKey>");
System.out.println("Invalid command line arguments.\n\t" +
"Usage:\n\t java com.gallatinsystems.instancecreator.app.InstanceConfigurator " +
"<awsSecretKey> <awsIdentifier> <instanceName> <directories> <s3policyFileTemplateName> " +
"<signingKey> <storepass> <keypass> <alias> <reportsEmailAddress> <scoreAPFlag> " +
"<organization> <localLocation> <keystore> <mapsApiKey> <restApiKey>");
System.exit(1);
}
}

private void writeFile(String location, String name, String contents)
throws IOException {
File file = new File(location + System.getProperty("file.separator")
+ name);
String filePath = location + System.getProperty("file.separator") + name;

This comment has been minimized.

Copy link
@iperdomo

iperdomo Jul 17, 2013

Contributor

You can safely use / (slash) for dealing with paths.
http://docs.oracle.com/javase/tutorial/essential/io/pathOps.html

File file = new File(filePath);

if (file.exists()) {
if (file.delete()) {
file.createNewFile();
}
}

Writer output = new BufferedWriter(new FileWriter(file));
try {
output.write(contents);
} finally {
output.close();
}

}

private String createLocalDeployDir(String dir, String instanceName) {
Expand Down

0 comments on commit fda176f

Please # to comment.