private boolean innerSetFilesAndLoad(boolean noSerialize, File dir, String baseName,
boolean writeEncrypted, DatabaseKey encryptionKey, ClientContext context,
RequestStarterGroup requestStarters, Random random) throws MasterKeysWrongPasswordException {
if(writeEncrypted && encryptionKey == null)
throw new MasterKeysWrongPasswordException();
File clientDat = new File(dir, baseName);
File clientDatCrypt = new File(dir, baseName+".crypt");
File clientDatBak = new File(dir, baseName+".bak");
File clientDatBakCrypt = new File(dir, baseName+".bak.crypt");
boolean clientDatExists = clientDat.exists();
boolean clientDatCryptExists = clientDatCrypt.exists();
boolean clientDatBakExists = clientDatBak.exists();
boolean clientDatBakCryptExists = clientDatBakCrypt.exists();
if(encryptionKey == null) {
if(clientDatCryptExists || clientDatBakCryptExists)
throw new MasterKeysWrongPasswordException();
}
boolean failedSerialize = false;
PartialLoad loaded = new PartialLoad();
if(clientDatExists) {
innerLoad(loaded, makeBucket(dir, baseName, false, null), noSerialize, context, requestStarters, random);