PhoenicisOrg / phoenicis

Phoenicis PlayOnLinux and PlayOnMac 5 repository
https://phoenicis.org/
GNU Lesser General Public License v3.0
680 stars 73 forks source link

Add isLoadable method to RepositoryLocation #905

Open madoar opened 7 years ago

madoar commented 7 years ago

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?

plata commented 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()).

madoar commented 7 years ago

What do you think should the isLoadable method check for the different repository types?

plata commented 7 years ago
madoar commented 7 years ago

Hmm:

plata commented 7 years ago
madoar commented 7 years ago
plata commented 7 years ago

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).