Skip to content

Commit

Permalink
Merge branch 'team3'
Browse files Browse the repository at this point in the history
  • Loading branch information
smokhov committed Mar 18, 2018
2 parents e221a3a + 1c331aa commit bb59bb9
Show file tree
Hide file tree
Showing 32 changed files with 1,404 additions and 321 deletions.
7 changes: 7 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="lib" path="lib/json.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Ignore patterns

*~
/bin/
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>splints-fork_splints</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Binary file added lib/java/commons-codec-1.10.jar
Binary file not shown.
Binary file added lib/java/commons-logging-1.2.jar
Binary file not shown.
Binary file added lib/java/fluent-hc-4.5.5.jar
Binary file not shown.
Binary file added lib/java/httpclient-4.5.5.jar
Binary file not shown.
Binary file added lib/java/httpclient-cache-4.5.5.jar
Binary file not shown.
Binary file added lib/java/httpclient-win-4.5.5.jar
Binary file not shown.
Binary file added lib/java/httpcore-4.4.9.jar
Binary file not shown.
Binary file added lib/java/httpmime-4.5.5.jar
Binary file not shown.
Binary file added lib/java/javax.json-1.0.jar
Binary file not shown.
Binary file added lib/java/jna-4.4.0.jar
Binary file not shown.
Binary file added lib/java/jna-platform-4.4.0.jar
Binary file not shown.
Binary file added lib/json.jar
Binary file not shown.
77 changes: 77 additions & 0 deletions src/java/bitbucket/BitbucketIssuesClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package bitbucket;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

import org.json.*;

/**
*
* @author Ziad Yarbouh from soen487-team08
*
*/
public class BitbucketIssuesClient {

private static String urlprefix = "https://api.bitbucket.org/1.0/repositories/soen487-w18-08/json-parser-issue-number/issues/";

/**
* Get Issue Details given IssueNumber
*
* @param issueNumber
* @throws Exception
*/
public static void getIssueDetails(int issueNumber) throws Exception {
String inumber = Integer.toString(issueNumber);
JSONObject json;

try {
URL base = new URL(urlprefix);
URL url = new URL(base, inumber);
json = new JSONObject(getText(url));
// System.out.println(response);

String[] names = JSONObject.getNames(json);

for (String str : names) {
if (!str.equals("reported_by")) {
System.out.println(str + ":" + json.get(str));
}
}

} catch (MalformedURLException e) {
System.err.println("ERROR: " + e.getMessage());
}
}

/**
* Get Text given URL
*
* @param url
* @return response
*/
public static String getText(URL url) {
StringBuilder response = new StringBuilder();

try {
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String inputLine;

while ((inputLine = in.readLine()) != null)
response.append(inputLine);

in.close();

} catch (IOException e) {
System.err.println(e.getMessage());
}

return response.toString();
}

}
200 changes: 0 additions & 200 deletions src/java/fp/v11/CreateIssue.java

This file was deleted.

Loading

1 comment on commit bb59bb9

@smokhov
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For #13

Please sign in to comment.