-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
1,404 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# Ignore patterns | ||
|
||
*~ | ||
/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
bb59bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For #13