Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[orion-dev] Getting File Project Location

Hey all,

Is there an easy way to get the project root?

For example:
Jon imports a project from a Git repository, gitRepo, into the editor. In gitRepo, he has a folder “folderA” with a file “sillyFile.txt". The location of the file (in the file metadata) is "/file/Jon-OrionContent/gitRepo/sillyFile.txt”. I would like to get the path relative to the repo, just “folderA/sillyFile.txt” in this case.

So far I’ve used the File API to get the File object’s Git object and then taken the CloneLocation “/gitapi/clone/file/Jon-OrionContent/gitRepo/“ and removed the “/gitapi/clone“ substring to get “/file/Jon-OrionContent/gitRepo/“ as the project root.

I’ve looked into fileClient and fileUtils and haven’t found anything for this purpopse. Is there a way to do this without any requests, maybe using something similar to the fileClient? Is there a better way than pulling it from the Git CloneLocation?

Thanks!
Diana





Back to the top