Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Nancy Schorr nmschorr

🏠
Working from home
Block or report user

Report or block nmschorr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Pom example
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>schorrmedia.com</groupId>
<artifactId>YourProgramOrClassName</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>YourProgramOrClassName</name>
</project>
@nmschorr
nmschorr / Url Reading
Last active Oct 14, 2017
The secret to easily reading a URL
View Url Reading
static void readUrlData () throws Exception {
String builderLine;
String locUrlString = "http://jsonplaceholder.typicode.com/albums";
System.out.println("\nRunning readUrlData");
HttpURLConnection newUrlConn = (HttpURLConnection) new URL(locUrlString).openConnection();
newUrlConn.setRequestMethod("GET");
newUrlConn.setRequestProperty("Accept", "application/json");
if (newUrlConn.getResponseCode() != HttpURLConnection.HTTP_OK) {
System.err.println("Can't connect to Webserver!");
}
View TestRestJson.java
/* JavaTestFive by Nancy Schorr, 2017
Demonstrates use of apis to read a json formatted text file and store it as a JSON object for further manipulation.
Also goes to url http://jsonplaceholder.typicode.com/albums and reads the data and store it in various objects.
Thanks to https://www.java2novice.com/restful-web-services/java-client-net-url/ for some ideas in this code.
*/
package com.nmschorr;
import static java.lang.System.out;
import java.io.*;
import java.net.*;
You can’t perform that action at this time.