local testing without cas and https
| | |
| | | this.user = user; |
| | | this.runAs = runAs; |
| | | Config config = Config.getInstance(); |
| | | loginURL = config.getProperty("loginURL", LOGIN_URL); |
| | | backendURL = config.getProperty("backendURL", BACKEND_URL); |
| | | grantingTicket = readFiledGrantingTicket(); |
| | | loginURL = config.getProperty("loginURL", LOGIN_URL); |
| | | if ("TestUmgebung".equals(loginURL)) { |
| | | grantingTicket = "ticket:" + user; |
| | | } else { |
| | | grantingTicket = readFiledGrantingTicket(); |
| | | } |
| | | } |
| | | |
| | | public String getTicket() throws JSCliException { |
| | | if (grantingTicket != null && grantingTicket.startsWith("ticket:")) { |
| | | return grantingTicket.replaceFirst("ticket", "user"); |
| | | } |
| | | try { |
| | | String encodedParams = URLEncoder.encode("service", "UTF-8") |
| | | + "=" + URLEncoder.encode(backendURL, "UTF-8"); |
| | |
| | | throw new JSCliException("fatal error: console not found"); |
| | | } |
| | | String command = console.readLine("%s@hsadmin>", runAs); |
| | | if (command == null) { |
| | | command = ""; |
| | | } |
| | | while (!("bye".equals(command.trim()) || "exit".equals(command.trim()) || "quit".equals(command.trim()))) { |
| | | try { |
| | | console.printf("%s\n", formatter.format(scriptClient.execute(command))); |
| | |
| | | console.printf("ERR: %s\n", e.getLocalizedMessage()); |
| | | } |
| | | command = console.readLine("%s@hsadmin>", runAs); |
| | | while (command.endsWith("\\")) { |
| | | if (command == null) { |
| | | command = ""; |
| | | } |
| | | while (command.trim().endsWith("\\")) { |
| | | command = command.substring(0, command.length() - 1) + |
| | | console.readLine(">"); |
| | | "\n" + console.readLine(">"); |
| | | } |
| | | } |
| | | } |