I want to download picture from URL - direct link to a picture. It is somehow protected, when I try :
InputStream in = new URL("http://www.somesite.sk/somepicture.jpg")
Files.copy(in, Paths.get("C:/picture.jpg"));
it downloads, but not as the original picture, the file "picture.jpg" has only this text inside :
<head><title>Document Moved</title></head>
<body><h1>Object Moved</h1>This document may be found <a HREF="http://www.somesite.sk/somepicture.jpg">here</a></body>
when I try direct download - right mouse-click and Save Picture, it works, if I try some download manager, it works. Some idea?