Modification de repository pour permettre l'ajout de données et la sauvegarde en un seul appel
This commit is contained in:
parent
dd9eb7bd2d
commit
b022800098
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user