How do I make sure that a file is not branchable across different projects in UCM ? 

It should always be picked from `/main/LATEST/` for all the parallel projects
['https://Stackoverflow.com/questions/38740587', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3119109/']
Your `createFileMain` only creates files which already exist. 

You don't need to create a file to write to it, all you need is the directory you want to write it into.

```
public void writeInFile(String path, List<String> content) {
    File file = new File(path);
    File parent = file.getParentFile();
    if (parent != null && !parent.exists())
        parent.mkdirs();

    try (PrintWriter writer = new PrintWriter(path, "ASCII")) {
        for (String contentItem : content) {
            writer.println(contentItem);
        }
        writer.close();
    } catch (IOException e1) {
        //DO STUFF
    }
}

```
```
private boolean createFile(File file) {
    if(!file.exists()) {
        if(file.getParentFile().exists()) {
            // ...
        } else { // In this case, neither file nor its parent exist
            if(this.createDirectory(file)) {
                this.createFile(file); // HERE, you're calling the same method again
            } else {
                // ...;
            }
        }
    }
    return true;
}

```

I believe you want to replace the line marked `HERE` with `this.createFile(file.getParentFile());`. Here what happens is that your function recursively calls itself with the same arguments, so nothing ever happens, and your program gets stuck in a loop until it runs out of stack memory.