Closed GoogleCodeExporter closed 9 years ago
Hey this problem could be fixed by:
1. add a new class named ProxyAuthenticator
import java.net.Authenticator;
import java.net.PasswordAuthentication;
class ProxyAuthenticator extends Authenticator {
private String user, password;
public ProxyAuthenticator(String user, String password) {
this.user = user;
this.password = password;
}
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(user, password.toCharArray());
}
}
2. use as
Authenticator.setDefault(new ProxyAuthenticator("username", "password"));
System.setProperty("http.proxyHost", "proxy host");
System.setProperty("http.proxyPort", "port");
Translate.setHttpReferrer("htpp://localhost/");
String translatedText = Translate.execute("how are you ?",
Language.ENGLISH, Language.HINDI);
System.out.println(translatedText);
Original comment by harishn...@gmail.com
on 11 Aug 2011 at 5:50
Attachments:
Need to see the stacktrace really to find out what the underlying cause is.
Original comment by rich.mid...@gmail.com
on 5 Nov 2011 at 5:15
Original issue reported on code.google.com by
ravi2008...@gmail.com
on 9 Jul 2011 at 4:18Attachments: