0

If If have a link like

http://localhost:8081/nexus/service/local/artifact/maven/redirect?r=artifactorycentral&g=com.sun.xml.ws&a=jaxws-rt&v=2.1.7&e=jar

to download a jar-File from my repository, how can I download and save this file in java?

I guess I have to open some kind of http connection, but I also guess that there should be a relatively direct and easy method to download such files.

1

1 Answer 1

0

I usually create a URL object (java.net.URL), call its openStream method, read from the stream and store to disk. I don’t know if there is a way to avoid reading through the file in your own code. Hope it helps. Get back if you need more details.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.