Class Repositories
- java.lang.Object
-
- de.julielab.jcore.pipeline.builder.base.main.Repositories
-
public class Repositories extends Object
Manages the local repository meta files in JSON format. Those are stored in the home directory of the user.
-
-
Field Summary
Fields Modifier and Type Field Description static List<ComponentRepository>JCORE_REPOSITORIESThese are the GitHub locations of the JCoRe repositories, JCoRe Base and JCoRe projects.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddRepositories(ComponentRepository... repositories)Loads existing repositories from the JSON file in thePipelineBuilderConstants.JcoreMeta.LOCAL_STORAGE, if it exists, and adds the given repositories.static voiddeleteComponentList(String repositoryName, String version)static FilegetMetaFile(ComponentRepository repository)static FilegetMetaFile(String repositoryName, String repositoryVersion)static Stream<ComponentRepository>getRepositories()Returns the repositories that are currently in use, i.e.static Stream<ComponentRepository>getRepositories(Predicate<ComponentRepository> filter)Returns the repositories that are currently in use, i.e.booleanhasComponentListMetaFile(ComponentRepository repository)static List<ComponentRepository>loadActiveRepositories()Looks in the local repository JSON meta information file for currently active repositories.static voidsaveMetaInformationToDisk(ComponentRepository repository)static voidsaveRepositoryConfiguration()
-
-
-
Field Detail
-
JCORE_REPOSITORIES
public static final List<ComponentRepository> JCORE_REPOSITORIES
These are the GitHub locations of the JCoRe repositories, JCoRe Base and JCoRe projects. They currently serve as default repositories to choose from for the pipeline builders.
-
-
Method Detail
-
loadActiveRepositories
public static List<ComponentRepository> loadActiveRepositories()
Looks in the local repository JSON meta information file for currently active repositories. Found repositories are set to this class as the active repositories from which components will be offered.
-
getRepositories
public static Stream<ComponentRepository> getRepositories()
Returns the repositories that are currently in use, i.e. for which the JSON meta data is stored in the home directory.- Returns:
- A stream of repositories currently used by the pipeline builder.
-
getRepositories
public static Stream<ComponentRepository> getRepositories(Predicate<ComponentRepository> filter)
Returns the repositories that are currently in use, i.e. for which the JSON meta data is stored in the home directory. The optional filter predicate may be used to only get specific repositories back.- Parameters:
filter- A filter to restrict the returned repositories.- Returns:
- A - possibly filtered - stream of repositories currently used by the pipeline builder.
-
addRepositories
public static void addRepositories(ComponentRepository... repositories) throws IOException
Loads existing repositories from the JSON file in thePipelineBuilderConstants.JcoreMeta.LOCAL_STORAGE, if it exists, and adds the given repositories. If the file does not exist, it is created and initialized with the given repositories. Note that this can be used to circumvent the addition of the JCoRe repositories when this method is called before the first call toloadActiveRepositories().- Parameters:
repositories-- Throws:
IOException
-
saveRepositoryConfiguration
public static void saveRepositoryConfiguration() throws IOException- Throws:
IOException
-
getMetaFile
public static File getMetaFile(ComponentRepository repository)
-
saveMetaInformationToDisk
public static void saveMetaInformationToDisk(ComponentRepository repository) throws GithubInformationException
- Throws:
GithubInformationException
-
hasComponentListMetaFile
public boolean hasComponentListMetaFile(ComponentRepository repository)
-
-