Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Authenticator.setDefault(new Authenticator() {
- protected PasswordAuthentication getPasswordAuthentication() {
- return new PasswordAuthentication("admin", "1234".toCharArray());
- }
- });
- urlConnection = new URL(params[0]);
- user = params[1];
- pass = params[2];
- return new PasswordAuthentication(user, pass.toCharArray())
- httpUrlConnection.getResponseCode();
- .....
- httpUrlConnection.setConnectTimeout(2000);
- httpUrlConnection.connect();
- statusCode = httpUrlConnection.getResponseCode(); //debug stop here
- httpUrlConnection.disconnect();
- } catch (IOException e) {
- e.printStackTrace();
- }
- return statusCode;
Add Comment
Please, Sign In to add comment