All Downloads are FREE. Search and download functionalities are using the official Maven repository.

aQute.bnd.service.repository.ResourceRepository Maven / Gradle / Ivy

package aQute.bnd.service.repository;

import java.io.*;
import java.util.*;

import aQute.bnd.service.*;
import aQute.bnd.service.repository.SearchableRepository.ResourceDescriptor;
import aQute.bnd.version.*;

/**
 * A Resource Repository represents a repository local to the workspace. A
 * Workspace will always create one Workspace Repository. References to the
 * contents are stored in a text file in {@code ./cnf/dependencies.json}.
 * Associated with the repository is a cache (which might be shared with other
 * subsystems).
 * 

* This repository can be used to get plugin dependencies. */ public interface ResourceRepository { String FILENAME = "repo.json"; enum TYPE { ADD, REMOVE, START_DOWNLOAD, END_DOWNLOAD, ERROR } class ResourceRepositoryEvent { public ResourceRepositoryEvent(TYPE type, ResourceDescriptor rds, Exception exception) { this.type = type; this.descriptor = rds; this.exception = exception; } public TYPE type; public ResourceDescriptor descriptor; public Exception exception; } interface Listener { void events(ResourceRepositoryEvent... event) throws Exception; } /** * Get the list of Resource Descriptors. This contains all the descriptors * that are n the file, regardless of cache. * * @param filter * An OSGi filter matched against the {@link ResourceDescriptor} * @return an immutable list of resource descriptors */ List< ? extends ResourceDescriptor> filter(String repository, String filter) throws Exception; File getResource(byte[] id,RepositoryPlugin.DownloadListener ... listeners) throws Exception; ResourceDescriptor getResourceDescriptor(byte[] sha) throws Exception; boolean delete(String repoId, byte[] rd) throws Exception; boolean add(String repoId, ResourceDescriptor rd) throws Exception; void addListener(Listener rrl); boolean deleteCache(byte[] id) throws Exception; SortedSet find(String repository, String bsn, VersionRange range) throws Exception; File getCacheDir(String name); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy