There is a specific server IP address that requires authentication I usually access through cmd line "ftp x.y.z.0" enter my u/n, enter my p/w and I'm in. I want to have my program ask for user credentials, check if they can log in to this server/IP address and simply return true if they can, false if not. I'm don't own this server or know really much about it, I just need to know if the end user of my application has access to it or not. I don't want to use any external packages, only what is available in the standard java library if at all possible. Any help with this is appreciated.
My most recent attempt:
URL url = new URL("ftp://1.0.0.0/");
URLConnection uc = url.openConnection();
String userpass = username + ":" + password;
String basicAuth = "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(userpass.getBytes());
uc.setRequestProperty ("Authorization", basicAuth);
InputStream in = uc.getInputStream();
Not sure exactly what it's doing but it seems to give same response no matter what I put in for the username and password strings.