From e8c2aa92f1ae37909fb0eb57788d614e66cb67bd Mon Sep 17 00:00:00 2001 From: "lucio.lelii" Date: Tue, 4 Oct 2016 13:00:26 +0000 Subject: [PATCH] git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/Common/authorization-common-client@132579 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../cl/TokenGenerator.java | 55 ------------------- 1 file changed, 55 deletions(-) delete mode 100644 src/test/java/org/gcube/common/authorizationservice/cl/TokenGenerator.java diff --git a/src/test/java/org/gcube/common/authorizationservice/cl/TokenGenerator.java b/src/test/java/org/gcube/common/authorizationservice/cl/TokenGenerator.java deleted file mode 100644 index 47efe9e..0000000 --- a/src/test/java/org/gcube/common/authorizationservice/cl/TokenGenerator.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.gcube.common.authorizationservice.cl; - -import static org.gcube.common.authorization.client.Constants.authorizationService; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; - -import org.gcube.common.authorization.client.proxy.AuthorizationProxy; -import org.gcube.common.authorization.library.provider.ContainerInfo; -import org.gcube.common.authorization.library.provider.SecurityTokenProvider; - -public class TokenGenerator { - - //call with parameters : token host port filePath scope1 ... scopeN - public static void main(String[] args) { - - String host = args[0]; - String adminToken = args[1]; - int port = Integer.parseInt(args[2]); - File file = new File(args[3]); - - - try { - file.createNewFile(); - } catch (IOException e1) { - System.out.println("error creating file "+file.getAbsolutePath()); - e1.printStackTrace(); - } - - ContainerInfo containerInfo = new ContainerInfo(host, port); - - AuthorizationProxy proxy = authorizationService(); - - try(FileWriter fw = new FileWriter(file)){ - for (int index =4; index"+token+""); - } catch (Exception e) { - System.out.println("error generating token for context "+args[index]); - e.printStackTrace(); - } finally{ - SecurityTokenProvider.instance.reset(); - } - } - } catch (Exception e) { - System.out.println("error writing file "+file.getAbsolutePath()); - e.printStackTrace(); - } - - } - -} \ No newline at end of file