-
- if(response.getResponseCode()==200){
- System.out.println(response.getResponseMessage());
- System.out.println("Policy Created Successfully!");
- }else{
- System.out.println("Error! " + response.getResponseMessage());
- }
- } catch (Exception e) {
- System.err.println(e.getMessage());
- }
-
-}
-
- private static JsonObject buildJSON(File jsonInput, String jsonString) throws FileNotFoundException {
- JsonObject json = null;
- JsonReader jsonReader = null;
- if (jsonString != null && jsonInput == null) {
- StringReader in = null;
- in = new StringReader(jsonString);
- jsonReader = Json.createReader(in);
- json = jsonReader.readObject();
- in.close();
- } else {
- InputStream in = null;
- in = new FileInputStream(jsonInput);
- jsonReader = Json.createReader(in);
- json = jsonReader.readObject();
- try {
- in.close();
- } catch (IOException e) {
- System.err.println("Exception Occured while closing input stream"+e);
- }
- }
- jsonReader.close();
- return json;
- }
+
+ if (response.getResponseCode() == 200) {
+ System.out.println(response.getResponseMessage());
+ System.out.println("Policy Created Successfully!");
+ } else {
+ System.out.println("Error! " + response.getResponseMessage());
+ }
+ } catch (Exception e) {
+ System.err.println(e.getMessage());
+ }
+
+ }
+
+ private static JsonObject buildJson(File jsonInput, String jsonString) throws FileNotFoundException {
+ JsonObject json = null;
+ JsonReader jsonReader = null;
+ if (jsonString != null && jsonInput == null) {
+ StringReader in = null;
+ in = new StringReader(jsonString);
+ jsonReader = Json.createReader(in);
+ json = jsonReader.readObject();
+ in.close();
+ } else {
+ InputStream in = null;
+ in = new FileInputStream(jsonInput);
+ jsonReader = Json.createReader(in);
+ json = jsonReader.readObject();
+ try {
+ in.close();
+ } catch (IOException e) {
+ System.err.println("Exception Occured while closing input stream" + e);
+ }
+ }
+ jsonReader.close();
+ return json;
+ }