What I am trying to do :
I am trying to connect to Web Portal [that uses https]using Java. I have written code for supplying user credentials using Authenticator class.W
You don't give a body to your method. Check the line where you have the problem and override your method with the code you want.
You've probably used an IDE such as Netbeans to implement an interface / override an abstract class that needs certain methods implementing. When IDEs do this (Netbeans definitely does) they generate method stubs for you like this so the code still compiles but if you try and call a method you haven't actually implemented you get an unavoidable error.
Usually this means you have to implement the given method, but sometimes an implementation does genuinely call for a blank method stub, in which case just delete the line that's throwing the exception.
This happens when you did not provide implementations for all methods from the interface you've implemented. Check which method you not implemented.
Have you seen this code fragment ?
@Override
public Result authenticate(HttpExchange he) {
throw new UnsupportedOperationException("Not supported yet.");
}
It's precisely the one that will throw the aforementionned exception each time you try to authenticate.
So, to my mind, the solution to your authentication problem is quite simple : implement this method.
if you don't want implement this method :
@Override
public Result authenticate(HttpExchange he) {
throw new UnsupportedOperationException("Not supported yet.");
}
take it easy , only delete this line of method :
throw new UnsupportedOperationException("Not supported yet.");