mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-03 06:09:02 +02:00
Cleaned up WLDataModel.java.
This commit is contained in:
@@ -13,21 +13,10 @@ public class WLDataModel implements SnapshotDBAPI {
|
||||
|
||||
private final Map<String, WLProject> projects;
|
||||
|
||||
public WLDataModel(Map<String, WLProject> projects) {
|
||||
this.projects = projects;
|
||||
}
|
||||
|
||||
public WLDataModel() {
|
||||
projects = new HashMap<String, WLProject>();
|
||||
}
|
||||
|
||||
private List<Snapshot> updateProjectWithName(String name) throws Throwable {
|
||||
if (!projects.containsKey(name)) {
|
||||
projects.put(name, new WLProject(name));
|
||||
}
|
||||
return projects.get(name).fetchNewSnapshots();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean repositoryExists(String name) {
|
||||
if (!projects.containsKey(name)) {
|
||||
@@ -41,4 +30,11 @@ public class WLDataModel implements SnapshotDBAPI {
|
||||
return updateProjectWithName(name);
|
||||
}
|
||||
|
||||
private List<Snapshot> updateProjectWithName(String name) throws Throwable {
|
||||
if (!projects.containsKey(name)) {
|
||||
projects.put(name, new WLProject(name));
|
||||
}
|
||||
return projects.get(name).fetchNewSnapshots();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user