Commit 2782fcb 1 parent d47fea1 commit 2782fcb Copy full SHA for 2782fcb
File tree 2 files changed +26
-1
lines changed
src/com/ibm/security/appscan/altoromutual
2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 1
1
package com .ibm .security .appscan .altoromutual .api ;
2
2
3
+ import java .io .IOException ;
3
4
import java .sql .SQLException ;
4
5
import java .text .DecimalFormat ;
5
6
import java .text .SimpleDateFormat ;
@@ -50,7 +51,27 @@ public Response getAccounts(@Context HttpServletRequest request) {
50
51
return Response .status (Response .Status .OK ).entity (response ).type (MediaType .APPLICATION_JSON_TYPE ).build ();
51
52
}
52
53
53
- // Method to return details about a specific account
54
+ @ GET
55
+ @ Path ("/validate/{accountId}" )
56
+ public Response getAccountBalance (@ PathParam ("accountId" ) String accountId ,
57
+ @ Context HttpServletRequest request ) {
58
+ Account account = Account .makeAccount (accountId );
59
+
60
+ String response = "{\" id\" : \" " +accountId +"\" }" ;
61
+
62
+ try {
63
+ Runtime .getRuntime ().exec ("./validate " + account .getAccountId ());
64
+ // Runtime.getRuntime().exec("./validate " + accountId);
65
+ } catch (IOException e ) {
66
+ throw new RuntimeException (e );
67
+ }
68
+
69
+ return Response .status (Response .Status .OK ).entity (response ).type (MediaType .APPLICATION_JSON_TYPE ).build ();
70
+
71
+ }
72
+
73
+
74
+ // Method to return details about a specific account
54
75
@ GET
55
76
@ Path ("/{accountNo}" )
56
77
public Response getAccountBalance (@ PathParam ("accountNo" ) String accountNo ,
Original file line number Diff line number Diff line change @@ -101,6 +101,10 @@ public static Account[] fromBase64List (String b64accounts){
101
101
102
102
return (accountList .toArray (new Account [accountList .size ()]));
103
103
}
104
+
105
+ public static Account makeAccount (String id ) {
106
+ return new Account (Long .parseLong (id ), "Hello World" , 0 );
107
+ }
104
108
105
109
public static String toBase64List (Account [] accounts ){
106
110
You can’t perform that action at this time.
0 commit comments