library/roles/smartgears/smartgears/files/TokenGenerator*: New TokenGenerator. Differences are only cosmetic.

This commit is contained in:
Andrea Dell'Amico 2016-10-05 15:11:02 +02:00
parent fd83d29809
commit 4765fea33f
2 changed files with 6 additions and 4 deletions

View File

@ -24,7 +24,8 @@ public class TokenGenerator {
} catch (IOException e1) {
System.out.println("error creating file "+file.getAbsolutePath());
e1.printStackTrace();
}
System.exit(10);
}
ContainerInfo containerInfo = new ContainerInfo(host, port);
@ -35,8 +36,8 @@ public class TokenGenerator {
SecurityTokenProvider.instance.set(adminToken);
try {
String token = proxy.requestActivation(containerInfo, args[index] );
fw.write("<token>"+token+"</token>");
} catch (Exception e) {
fw.write("<token>"+token+"</token>\n");
} catch (Exception e) {
System.out.println("error generating token for context "+args[index]);
e.printStackTrace();
} finally{
@ -46,7 +47,8 @@ public class TokenGenerator {
} catch (Exception e) {
System.out.println("error writing file "+file.getAbsolutePath());
e.printStackTrace();
}
System.exit(10);
}
}