Created
January 4, 2015 19:51
-
-
Save ifedorenko/6eb2443c5bccca70a79a to your computer and use it in GitHub Desktop.
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
package io.takari.maven.testing.executor.junit; | |
import java.io.ByteArrayOutputStream; | |
import java.io.InputStream; | |
import java.net.URL; | |
public class NexusTest { | |
public static void main(String[] args) throws Exception { | |
URL resource = new URL("https://repository.takari.io/content/groups/public/org/apache/maven/apache-maven/3.2.6-SNAPSHOT/maven-metadata.xml"); | |
ByteArrayOutputStream buf = new ByteArrayOutputStream(); | |
try (InputStream is = resource.openStream()) { | |
byte[] ba = new byte[4096]; | |
int len; | |
while ((len = is.read(ba)) > 0) { | |
buf.write(ba, 0, len); | |
} | |
} | |
System.out.println(new String(buf.toByteArray(), "UTF-8")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment