I had to resort to this method, as they (at the svn end) at somehow disabled PROPFIND request. So I couldn't download the whole thing using my Subclipse installation in Eclipse. Earlier I could do it by switching from JavaHL (Native JNI) to SvnKit (Pure Java). Now I was denied this also.
So to get back to hacking, I had to write code which will go over the Internet and do the retrieval stuff. As it happens, I again forgot which are parameters related to proxy servers that need to be set. Moreover this time I had to deal with HTTP Password challenge also.
So this post is meant to be a reminder to me and a point to come back to when in need.
1) How to set proxy paramters?
We can do it on the command line, in the code, from a GUI etc. Whatever the method following four system propeties need to be set
a) http.proxyHost
b) http.proxyPort
c) http.proxyUser
d) http.proxyPassword
2) How to answer HTTP challenge
Quite easy. Two ways that I tried.
a) In the URL itself, embed the credentials as follows
"http://user:password@www.some-server.com"
b) Before opening the connection, execute the following
Authenticator.setDefault(new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(
"
}
});
Other ways include using third party libraries, like this one from Apache.
* I promise myself to learn usage of code formatting in blog posts and update these entries.
Catch you later.