Open madoar opened 7 years ago
Good idea. It's easy to have a typo in your repository URL and with this solution, you should immediately see it. Maybe we should also add a sanity check in the "add repository" dialog (e.g. if localRepositoryFile.exists()
).
What do you think should the isLoadable
method check for the different repository types?
git ls-remote
succeeds.Hmm:
JGit
, I think we may need to check for an exception, but I'm not sure... Take a look here and heregetClass().getClassLoader().getResource("javax/servlet");
? fatal: '<URL>' does not appear to be a git repository
. However, it should be easy to figure out if JGit gives an exception or just an empty return value.javax.servlet
exists, but if a file inside our repository exists. To do this, we would need to have a file, that is contained in all Phoenicis repositories. I believe such a file would be helpful in any case, because it would help us verify that the folder/git repository really is a Phoenicis repository.Shouldn't the resource check ensure that the given directory exists in the classpath? It might be empty but that could happen anyways (e.g. also for a local folder).
With regards to #901 and similar issues, which occur when a repository couldn't be read/loaded, we should add an indication about the readability/loadability of a repository to the
RepositoryLocation
. This method should not be persisted by jackson.The result of this method can then be used to visually show the user in the settings tab if a repository can't be opened. We could for example show the background of the "bad" repository location in a red color, or display an attention symbol next to the repository location. What do you think?