Skip to content

Instantly share code, notes, and snippets.

@ifedorenko
Created January 4, 2015 19:51
Show Gist options
  • Save ifedorenko/6eb2443c5bccca70a79a to your computer and use it in GitHub Desktop.
Save ifedorenko/6eb2443c5bccca70a79a to your computer and use it in GitHub Desktop.
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