mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 16:13:42 -05:00
Creating directories.
This commit is contained in:
parent
f72767ceb1
commit
1f239d7118
3 changed files with 8 additions and 6 deletions
|
@ -29,13 +29,15 @@ public class WLDirectoryNode implements PersistentStoreSource, PersistentStoreUp
|
|||
private Map<String, FileNode> fileNodeTable;
|
||||
private FileIndexStore fileIndexStore;
|
||||
|
||||
public WLDirectoryNode(String projectName, PersistentStoreAPI persistentStore) {
|
||||
this(projectName);
|
||||
public WLDirectoryNode(String projectName, File attsDirectory, File rootGitDirectory, PersistentStoreAPI persistentStore) {
|
||||
this(projectName, attsDirectory, rootGitDirectory);
|
||||
initFromPersistentStore(persistentStore);
|
||||
}
|
||||
|
||||
private WLDirectoryNode(String projectName) {
|
||||
private WLDirectoryNode(String projectName, File attsDirectory, File rootGitDirectory) {
|
||||
this.projectName = projectName;
|
||||
new File(attsDirectory, projectName).mkdirs();
|
||||
new File(rootGitDirectory, projectName).mkdirs();
|
||||
}
|
||||
|
||||
private WLDirectoryNode(String projectName, Map<String, FileNode> fileNodeTable, FileIndexStore fileIndexStore) {
|
||||
|
|
|
@ -43,7 +43,7 @@ public class WLFileStore implements PersistentStoreSource {
|
|||
public void initFromPersistentStore(PersistentStoreAPI persistentStore) {
|
||||
this.persistentStore = persistentStore;
|
||||
for (String projectName : persistentStore.getProjectNames()) {
|
||||
fileStore.put(projectName, new WLDirectoryNode(projectName, persistentStore));
|
||||
fileStore.put(projectName, new WLDirectoryNode(projectName, attDirectory, rootGitDirectory, persistentStore));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ public class WLFileStore implements PersistentStoreSource {
|
|||
private WLDirectoryNode getDirectoryNodeForProjectName(String projectName) {
|
||||
WLDirectoryNode directoryNode = fileStore.get(projectName);
|
||||
if (directoryNode == null) {
|
||||
directoryNode = new WLDirectoryNode(projectName, persistentStore);
|
||||
directoryNode = new WLDirectoryNode(projectName, attDirectory, rootGitDirectory, persistentStore);
|
||||
fileStore.put(projectName, directoryNode);
|
||||
}
|
||||
return directoryNode;
|
||||
|
|
|
@ -34,7 +34,7 @@ public class WLDataModel implements CandidateSnapshotCallback {
|
|||
System.out.println("Loaded file store and index tables.");
|
||||
List<String> excludedFromDeletion = projectStore.getProjectNames();
|
||||
excludedFromDeletion.add(".wlgb");
|
||||
WLFileStore.deleteInDirectoryApartFrom(rootGitDirectory, excludedFromDeletion.toArray(new String[]{}));
|
||||
WLFileStore.deleteInDirectoryApartFrom(rootGitDirectory, excludedFromDeletion.toArray(new String[] {}));
|
||||
}
|
||||
|
||||
public List<WritableRepositoryContents> updateProjectWithName(String name) throws FailedConnectionException, InvalidProjectException {
|
||||
|
|
Loading…
Reference in a new issue