public static void saveCredentials(String server,String user,String password){
  server=server.replaceAll("/MeganServer$","");
  server2Credentials.put(server,new Pair<>(user,password));
  saveCredentialsToProperties();
}

public static void saveCredentials ( String server , String user , String password ) { server = server . replaceAll ( "/MeganServer$" , "" ) ; server2Credentials . put ( server , new Pair < > ( user , password ) ) ; saveCredentialsToProperties ( ) ; }
save credentials for given server
