Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import SNET.Core.APIContext;
import SNET.Core.Helper;
import SecureNetRestApiSDK.Api.Models.DeveloperApplication;
import SecureNetRestApiSDK.Api.Requests.SecureNetRequest;
import SecureNetRestApiSDK.Api.Responses.SecureNetResponse;

Expand All @@ -22,12 +23,19 @@ public SecureNetResponse processRequest(APIContext apiContext, SecureNetRequest
throw new IllegalArgumentException("secureNetRequest");
}

String payLoad =new Gson().toJson(secureNetRequest);

Properties config = new Properties();
Dictionary<String, String> props = new Hashtable<String, String>();

InputStream stream = this.getClass().getResourceAsStream("/config.properties");
ClassLoader cl = Thread.currentThread().getContextClassLoader();
InputStream stream = cl.getResourceAsStream("config.properties");
if (stream == null) {
ClassLoader applicationClassLoader = BaseController.class.getClassLoader();
stream = applicationClassLoader.getResourceAsStream("config.properties");
}

if (stream == null) {
throw new IllegalArgumentException("config.properties not found");
}
config.load(stream);

props.put("secureNetId", config.getProperty("secureNetId"));
Expand All @@ -39,6 +47,14 @@ public SecureNetResponse processRequest(APIContext apiContext, SecureNetRequest
props.put("developerId", config.getProperty("developerId"));
props.put("versionId", config.getProperty("versionId"));
apiContext.setConfig(props);

DeveloperApplication devApp = new DeveloperApplication();
devApp.setDeveloperId(new Integer(config.getProperty("developerId")));
devApp.setVersion(config.getProperty("versionId"));
secureNetRequest.setDeveloperApplication( devApp );

String payLoad =new Gson().toJson(secureNetRequest);

String response = Helper.configureAndExecute(apiContext, secureNetRequest.getMethod(), secureNetRequest.getUri(), payLoad);
return (SecureNetResponse) new Gson().fromJson(response,responseClazz);
}
Expand Down
Binary file removed target/classes/SNET/Core/APIContext.class
Binary file not shown.
Binary file removed target/classes/SNET/Core/ConnectionManager.class
Binary file not shown.
Binary file removed target/classes/SNET/Core/Helper.class
Binary file not shown.
Binary file removed target/classes/SNET/Core/HttpConnection.class
Binary file not shown.
Binary file not shown.
Binary file removed target/classes/SNET/Core/HttpMethodEnum.class
Binary file not shown.
Binary file removed target/classes/SNET/Core/IAPICallPreHandler.class
Binary file not shown.
Binary file removed target/classes/SNET/Core/RestApiCallPreHandler.class
Binary file not shown.
Binary file removed target/classes/SNET/Core/UserAgentHeader.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 0 additions & 10 deletions target/classes/config.properties

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.