Some import mechanisms (for example, Github project import) call methods such as 'upsert*' directly, bypassing existing filename checks.
Added checks to all methods in ProjectEntityHandler that can create or rename a file.
bug: overleaf/sharelatex#908
Signed-off-by: Simon Detheridge <s@sd.ai>
For convenience, add a method to SafePath to break a path into components and verify the status of each one.
bug: overleaf/sharelatex#908
Signed-off-by: Simon Detheridge <s@sd.ai>