mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Cleaned up WLDataModel.java.
This commit is contained in:
parent
ea34136fe7
commit
f245e583b4
1 changed files with 7 additions and 11 deletions
|
@ -13,21 +13,10 @@ public class WLDataModel implements SnapshotDBAPI {
|
||||||
|
|
||||||
private final Map<String, WLProject> projects;
|
private final Map<String, WLProject> projects;
|
||||||
|
|
||||||
public WLDataModel(Map<String, WLProject> projects) {
|
|
||||||
this.projects = projects;
|
|
||||||
}
|
|
||||||
|
|
||||||
public WLDataModel() {
|
public WLDataModel() {
|
||||||
projects = new HashMap<String, WLProject>();
|
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
|
@Override
|
||||||
public boolean repositoryExists(String name) {
|
public boolean repositoryExists(String name) {
|
||||||
if (!projects.containsKey(name)) {
|
if (!projects.containsKey(name)) {
|
||||||
|
@ -41,4 +30,11 @@ public class WLDataModel implements SnapshotDBAPI {
|
||||||
return updateProjectWithName(name);
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue