initialize FileRepository thing with multiple folders
Hello everyone,
I am writing a service in a thing called "getInitializedFileStructure"
There I want to create multiple Folders in a specific order for a fileRepository Thing.
The code goes something like this:
function addFolder(path){
var params = {
path: path
};
fileRepo.CreateFolder(params);
}
for(i = 1; i <= 5; i++){
addFolder("/" + me.name + "/Milestone" + i.toString());
}
I want to initialize the repository with the folders "Milestone 1 ... Milestone 5" in this order. It needs to be done via a service. The problem is, that with the current code the folders are created in a random order. I guess it has to do with the asynchronous charactersitic of the "fileRepo.createFolder" function.
Any Ideas how to tackle that problem? Thank you very much in advance
Best Regards,
Dominik
Edit: An even better approach for me would be, if it was possible to create a new fileRepository Thing with some default folders

