Modification de repository pour permettre l'ajout de données et la sauvegarde en un seul appel

This commit is contained in:
Maximilien LEDOUX 2022-03-11 17:01:57 +01:00
parent dd9eb7bd2d
commit b022800098

View File

@ -39,6 +39,38 @@ public class Repository {
} }
} }
public boolean addUser(String login, String password, String key) {
if (appData.addUser(login, password, key)) {
save();
return true;
}
return false;
}
public boolean addFileFor(File file, String userName) {
if (appData.addFileFor(file, userName)) {
save();
return true;
}
return false;
}
public boolean deleteFileOf(String fileName, String userName) {
if (appData.deleteFileOf(fileName, userName)) {
save();
return true;
}
return false;
}
public boolean addStorage(String userName, File file, String storage) {
if (appData.addStorage(userName, file, storage)) {
save();
return true;
}
return false;
}
/** /**
* Loads configuration file * Loads configuration file