Code example for PasswordAuthentication

Methods: getPassword, getUserName

0
	 
  public void setServerCredential(PasswordAuthentication inServerCredential)
  { 
    if(inServerCredential != null)
    { 
      String tempString = String.format("%s:%s", inServerCredential.getUserName(), inServerCredential.getPassword());
      _credentialString = "Basic "+ Base64.encodeToString(tempString.getBytes(),Base64.URL_SAFE|Base64.NO_WRAP);
    } 
    else 
    { 
      _credentialString = null;
    } 
  } 
 
  public boolean ensureDatabaseExists()  
  { 
    String databaseURL = urlToDatabase();
    HTTPURLResponse responseData;
 
    ///////////////////////// 
    // check existence - GET