Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Commenting out some old debug files
  • Loading branch information
ethan committed Jun 23, 2021
1 parent 868d0ea commit 78f6565
Showing 1 changed file with 22 additions and 20 deletions.
Expand Up @@ -259,12 +259,12 @@ public void executeQuery(ObjectClass oc, WordpressFilter filter, ResultsHandler
request = new HttpGetWithBody(configuration.getWordpressRestUrl() + "/wp/v2/users/" + searchId);
try {
uidSearchResponseJson = callRequest(request, jsonObject);
FileWriter file8 = new FileWriter("/tmp/file8.txt");
/*FileWriter file8 = new FileWriter("/tmp/file8.txt");
file8.write(uidSearchResponseJson.toString());
System.out.println("Successfully Copied JSON Object to File...");
System.out.println("\nJSON Object: " + uidSearchResponseJson);
file8.flush();
file8.close();
file8.close(); */
//builder.setUid(new Uid(String.valueOf(uidSearchResponseJson.getInt(ATTR_ID))));
handleUserId( handler, uidSearchResponseJson );
} catch (IOException IOE) {
Expand Down Expand Up @@ -333,12 +333,12 @@ else if (filter != null && filter.byEmailAddress != null) {
HttpEntityEnclosingRequestBase request;
request = new HttpGetWithBody(configuration.getWordpressRestUrl() + "/wp/v2/users");
searchResponseJson = callRequestArray(request, jsonObject);
FileWriter file9 = new FileWriter("/tmp/file9.txt");
/* FileWriter file9 = new FileWriter("/tmp/file9.txt");
file9.write(searchResponseJson.toString());
System.out.println("Successfully Copied JSON Object to File...");
System.out.println("\nJSON Object: " + searchResponseJson);
file9.flush();
file9.close();
file9.close();*/
if ( searchResponseJson.length() < 10 ) {
morePages = false;
}
Expand Down Expand Up @@ -401,12 +401,12 @@ public void delete(ObjectClass oc, Uid uid, OperationOptions oo) {
HttpEntityEnclosingRequestBase request;
request = new HttpPost(configuration.getWordpressRestUrl() + "/wp/v2/users/" + uid.getUidValue());
deleteResponseJson = callRequest(request, jsonObject);
FileWriter file6 = new FileWriter("/tmp/file6.txt");
/* FileWriter file6 = new FileWriter("/tmp/file6.txt");
file6.write(deleteResponseJson.toString());
System.out.println("Successfully Copied JSON Object to File...");
System.out.println("\nJSON Object: " + deleteResponseJson);
file6.flush();
file6.close();
file6.close();*/

//String newUid = String.valueOf(createResponseJson.getInt("id"));
//return new Uid(newUid);
Expand All @@ -432,12 +432,12 @@ public void delete(ObjectClass oc, Uid uid, OperationOptions oo) {
//HttpDeleteWithBody request;
HttpDeleteWithBody request = new HttpDeleteWithBody(configuration.getWordpressRestUrl() + "/wp/v2/users/" + uid.getUidValue());
deleteResponseJson = callRequest(request, jsonObject);
FileWriter file7 = new FileWriter("/tmp/file7.txt");
/* FileWriter file7 = new FileWriter("/tmp/file7.txt");
file7.write(deleteResponseJson.toString());
System.out.println("Successfully Copied JSON Object to File...");
System.out.println("\nJSON Object: " + deleteResponseJson);
file7.flush();
file7.close();
file7.close(); */

} catch (IOException IOE) {
throw new ConnectorIOException(IOE.getMessage(), IOE);
Expand Down Expand Up @@ -535,12 +535,13 @@ public void access(char[] chars) {
jsonObject.put(ATTR_PASS, password);
}
String jsonObjectString = jsonObject.toString();
try { FileWriter file3 = new FileWriter("/tmp/file3.txt");
try {
/* FileWriter file3 = new FileWriter("/tmp/file3.txt");
file3.write(jsonObjectString);
System.out.println("Successfully Copied JSON Object to File...");
System.out.println("\nJSON Object: " + jsonObjectString);
file3.flush();
file3.close();
file3.close();*/
} catch (Exception e) {
System.out.println("exception writing file");
}
Expand All @@ -549,12 +550,12 @@ public void access(char[] chars) {
HttpEntityEnclosingRequestBase request;
request = new HttpPost(configuration.getWordpressRestUrl() + "/wp/v2/users");
createResponseJson = callRequest(request, jsonObject);
FileWriter file = new FileWriter("/tmp/file1.txt");
/* FileWriter file = new FileWriter("/tmp/file1.txt");
file.write(createResponseJson.toString());
System.out.println("Successfully Copied JSON Object to File...");
System.out.println("\nJSON Object: " + createResponseJson);
file.flush();
file.close();
file.close(); */

String newUid = String.valueOf(createResponseJson.getInt("id"));
LOG.info("response ID: ", newUid);
Expand Down Expand Up @@ -646,12 +647,13 @@ public void access(char[] chars) {
jsonObject.put(ATTR_PASS, password);
}
String jsonObjectString = jsonObject.toString();
try { FileWriter file4 = new FileWriter("/tmp/file4.txt");
try {
/* FileWriter file4 = new FileWriter("/tmp/file4.txt");
file4.write(jsonObjectString);
System.out.println("Successfully Copied JSON Object to File...");
System.out.println("\nJSON Object: " + jsonObjectString);
file4.flush();
file4.close();
file4.close();*/
} catch (Exception e) {
System.out.println("exception writing file");
}
Expand All @@ -660,12 +662,12 @@ public void access(char[] chars) {
HttpEntityEnclosingRequestBase request;
request = new HttpPost(configuration.getWordpressRestUrl() + "/wp/v2/users/" + uid.getUidValue());
createResponseJson = callRequest(request, jsonObject);
FileWriter file5 = new FileWriter("/tmp/file5.txt");
/* FileWriter file5 = new FileWriter("/tmp/file5.txt");
file5.write(createResponseJson.toString());
System.out.println("Successfully Copied JSON Object to File...");
System.out.println("\nJSON Object: " + createResponseJson);
file5.flush();
file5.close();
file5.close(); */

String newUid = String.valueOf(createResponseJson.getInt("id"));
return new Uid(newUid);
Expand All @@ -685,12 +687,12 @@ protected JSONObject callRequest(HttpEntityEnclosingRequestBase request, JSONObj
CloseableHttpResponse response = client.execute(request);
LOG.info("response: ");
String responseText = EntityUtils.toString(response.getEntity());
FileWriter file = new FileWriter("/tmp/file2.txt");
/* FileWriter file = new FileWriter("/tmp/file2.txt");
file.write(responseText);
System.out.println("Successfully Copied JSON Object to File...");
System.out.println("\nJSON Object: " + responseText);
file.flush();
file.close();
file.close(); */
int statusCode = response.getStatusLine().getStatusCode();
if (statusCode == 500) {
JSONObject errorResult = new JSONObject(responseText);
Expand Down Expand Up @@ -730,12 +732,12 @@ protected JSONArray callRequestArray(HttpEntityEnclosingRequestBase request, JSO
CloseableHttpResponse response = client.execute(request);
LOG.info("response: ");
String responseText = EntityUtils.toString(response.getEntity());
FileWriter file = new FileWriter("/tmp/file2.txt");
/* FileWriter file = new FileWriter("/tmp/file2.txt");
file.write(responseText);
System.out.println("Successfully Copied JSON Object to File...");
System.out.println("\nJSON Object: " + responseText);
file.flush();
file.close();
file.close();*/
processResponseErrors(response);
JSONArray result = new JSONArray (responseText);
LOG.info("response body: ");
Expand Down

0 comments on commit 78f6565

Please sign in to comment.