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