i am building a java application and i am trying to access this url
http://cdn.shephertz.com/repository/files/1617a5da9a4bb32fad94d45f143ae21863bce533d283449d8023a852f787276b/5242b6593a4be2e25dec84b598fbcbe3e929c66a/picture 1.jpeg
somehow i do not know why, i get this error
java.io.IOException: Server returned HTTP response code: 403 for URL:
http://cdn.shephertz.com/repository/files/1617a5da9a4bb32fad94d45f143ae21863bce533d283449d8023a852f787276b/5242b6593a4be2e25dec84b598fbcbe3e929c66a/picture 1.jpeg
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at _mouthy.ImageLoader$1.run(ImageLoader.java:32)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL:
http://cdn.shephertz.com/repository/files/1617a5da9a4bb32fad94d45f143ae21863bce533d283449d8023a852f787276b/5242b6593a4be2e25dec84b598fbcbe3e929c66a/picture 1.jpeg
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)
at java.net.URLConnection.getContentType(Unknown Source)
at _mouthy.ImageLoader$1.run(ImageLoader.java:31)
... 1 more
and i do not know why, i have tried a whole lot,and all kinds of crazy stuff, this is currently my code
HttpURLConnection urlc = (HttpURLConnection) new URL(url).openConnection();
urlc.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0");
urlc.addRequestProperty("Connection", "keep-alive");
urlc.addRequestProperty("Referer", "www.google.com");
urlc.connect();
can someone actually enlighten me? i actually can access it from a web browser, i do not also think its user-agent because i already have that