class ModuleArtifactRepository extends ArtifactRepositoryBaseImpl<ModuleArtifactRepository.ModuleArtifactDescriptor>
local-artifacts.properties
file, which maps classifiers to the file system
locations of the artifacts before they are uploaded into a Maven repository. (Unlike in a
Maven repository, there are no predefined locations for the artifacts in the build output
directory.)Modifier and Type | Class and Description |
---|---|
private static class |
ModuleArtifactRepository.ModuleArtifactComparableDescriptor
An artifact descriptor that can be compared with
ModuleArtifactRepository.ModuleArtifactDescriptor . |
(package private) class |
ModuleArtifactRepository.ModuleArtifactDescriptor
An artifact descriptor with Maven coordinates.
|
Modifier and Type | Field and Description |
---|---|
private ModuleArtifactMap |
artifactsMap |
private static GAV |
DUMMY_GAV |
private GAV |
moduleGAV |
private java.io.File |
p2DataFile |
static java.lang.String |
REPOSITORY_TYPE
Type string for this repository type.
|
descriptors, descriptorsMap
Modifier | Constructor and Description |
---|---|
private |
ModuleArtifactRepository(org.eclipse.equinox.p2.core.IProvisioningAgent agent,
java.io.File location,
ModuleArtifactMap artifactsMap) |
Modifier and Type | Method and Description |
---|---|
(package private) static boolean |
canAttemptRead(java.io.File repositoryDir) |
ModuleArtifactRepository.ModuleArtifactDescriptor |
createArtifactDescriptor(org.eclipse.equinox.p2.metadata.IArtifactKey key) |
org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor |
createArtifactDescriptor(org.eclipse.equinox.p2.metadata.IArtifactKey key,
WriteSessionContext writeSession) |
private static ModuleArtifactMap |
createArtifactLocationMap(java.io.File repositoryDir) |
static ModuleArtifactRepository |
createInstance(org.eclipse.equinox.p2.core.IProvisioningAgent agent,
java.io.File repositoryDir) |
(package private) static <T> boolean |
eq(T left,
T right) |
(package private) static org.eclipse.equinox.p2.core.ProvisionException |
failedReadException(java.io.File sourceFile,
java.lang.String details,
java.lang.Exception exception) |
ModuleArtifactMap |
getArtifactsMap() |
protected org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor |
getComparableDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Returns an
IArtifactDescriptor instance which is comparable to the artifact
descriptors stored in the index (i.e. |
protected ModuleArtifactRepository.ModuleArtifactDescriptor |
getInternalDescriptorForAdding(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Returns an artifact descriptor of the internal descriptor type
ArtifactDescriptorT which may be added to the index. |
private ModuleArtifactRepository.ModuleArtifactDescriptor |
getInternalDescriptorFromLoadedDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor loadedDescriptor,
java.io.File sourceFile) |
protected java.io.File |
internalGetArtifactStorageLocation(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Returns the file system location where the given artifact is or would be stored.
|
protected void |
internalStore(org.eclipse.core.runtime.IProgressMonitor monitor)
Persists the index of this repository.
|
private void |
internalStoreWithException() |
boolean |
isModifiable() |
private void |
load() |
IArtifactSink |
newAddingArtifactSink(org.eclipse.equinox.p2.metadata.IArtifactKey key,
WriteSessionContext writeSession) |
private static MavenRepositoryCoordinates |
readMavenCoordinates(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor) |
static ModuleArtifactRepository |
restoreInstance(org.eclipse.equinox.p2.core.IProvisioningAgent agent,
java.io.File repositoryDir) |
void |
setGAV(java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version) |
private void |
storeOrProvisioningException() |
contains, contains, descriptorQueryable, getArtifact, getArtifact, getArtifactDescriptors, getArtifactFile, getArtifactFile, getRawArtifact, internalAddDescriptor, internalAddInternalDescriptor, internalNewAddingArtifactSink, internalRemoveAllDescriptors, internalRemoveDescriptor, internalRemoveDescriptors, internalRemoveDescriptors, internalRemoveDescriptors, newAddingArtifactSink, newAddingRawArtifactSink, query
addDescriptor, addDescriptor, addDescriptors, addDescriptors, getArtifacts, getOutputStream, getRawArtifact, isFatal, removeAll, removeAll, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptors, removeDescriptors, removeDescriptors, removeDescriptors, setStatusOnStreamIfPossible
createArtifactKey, equals, executeBatch, hashCode
assertModifiable, getDescription, getLocation, getName, getProperties, getProperty, getProvider, getProvisioningAgent, getType, getVersion, setDescription, setLocation, setName, setProperties, setProperty, setProperty, setProvider, setType, setVersion
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addDescriptor, addDescriptor, addDescriptors, addDescriptors, createArtifactKey, executeBatch, getArtifacts, getOutputStream, getRawArtifact, removeAll, removeAll, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptors, removeDescriptors, removeDescriptors, removeDescriptors
public static final java.lang.String REPOSITORY_TYPE
IArtifactRepositoryManager.createRepository(URI, String, String, Map)
in order to
create a repository of type ModuleArtifactRepository
.private static final GAV DUMMY_GAV
private final java.io.File p2DataFile
private final ModuleArtifactMap artifactsMap
private GAV moduleGAV
private ModuleArtifactRepository(org.eclipse.equinox.p2.core.IProvisioningAgent agent, java.io.File location, ModuleArtifactMap artifactsMap)
static boolean canAttemptRead(java.io.File repositoryDir)
public static ModuleArtifactRepository restoreInstance(org.eclipse.equinox.p2.core.IProvisioningAgent agent, java.io.File repositoryDir) throws org.eclipse.equinox.p2.core.ProvisionException
org.eclipse.equinox.p2.core.ProvisionException
public static ModuleArtifactRepository createInstance(org.eclipse.equinox.p2.core.IProvisioningAgent agent, java.io.File repositoryDir) throws org.eclipse.equinox.p2.core.ProvisionException
org.eclipse.equinox.p2.core.ProvisionException
private static ModuleArtifactMap createArtifactLocationMap(java.io.File repositoryDir) throws org.eclipse.equinox.p2.core.ProvisionException
org.eclipse.equinox.p2.core.ProvisionException
public void setGAV(java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
public ModuleArtifactMap getArtifactsMap()
protected java.io.File internalGetArtifactStorageLocation(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
ArtifactRepositoryBaseImpl
ArtifactRepositoryBaseImpl.getArtifactFile(IArtifactDescriptor)
, this method does not check if the given
artifact exists in the repository and never returns null
.
This method may be called by any API method for reading or writing artifacts.
private static MavenRepositoryCoordinates readMavenCoordinates(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
protected org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor getComparableDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
ArtifactRepositoryBaseImpl
IArtifactDescriptor
instance which is comparable to the artifact
descriptors stored in the index (i.e. the ArtifactRepositoryBaseImpl.descriptors
member). A valid
implementation is to convert the argument to the internal descriptor type
ArtifactDescriptorT
, but this is not a requirement. This method should be
implemented in a way so that calling
descriptors.contains(getComparableDescriptor(foreignDescriptor))
with a
descriptor from a foreign artifact repository returns true
if and only if
copying that foreign artifact to this repository with
AbstractArtifactRepository2.getOutputStream(IArtifactDescriptor)
would not add a new artifact to this
repository.
This method may be called by any API method with an IArtifactDescriptor
argument.
getComparableDescriptor
in class ArtifactRepositoryBaseImpl<ModuleArtifactRepository.ModuleArtifactDescriptor>
descriptor
- An IArtifactDescriptor
from any artifact repository.protected ModuleArtifactRepository.ModuleArtifactDescriptor getInternalDescriptorForAdding(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor) throws java.lang.IllegalArgumentException
ArtifactRepositoryBaseImpl
ArtifactDescriptorT
which may be added to the index. Implementations may require
that the descriptor argument is a descriptor instance created by this repository – see
AbstractArtifactRepository.createArtifactDescriptor(IArtifactKey)
.
This method is called by methods that add entries to the index, i.e. from
ArtifactRepositoryBaseImpl.newAddingArtifactSink(IArtifactKey)
.
getInternalDescriptorForAdding
in class ArtifactRepositoryBaseImpl<ModuleArtifactRepository.ModuleArtifactDescriptor>
descriptor
- An IArtifactDescriptor
instancejava.lang.IllegalArgumentException
- if the provided descriptor cannot be addedpublic ModuleArtifactRepository.ModuleArtifactDescriptor createArtifactDescriptor(org.eclipse.equinox.p2.metadata.IArtifactKey key)
createArtifactDescriptor
in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
createArtifactDescriptor
in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
public org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor createArtifactDescriptor(org.eclipse.equinox.p2.metadata.IArtifactKey key, WriteSessionContext writeSession)
public IArtifactSink newAddingArtifactSink(org.eclipse.equinox.p2.metadata.IArtifactKey key, WriteSessionContext writeSession) throws org.eclipse.equinox.p2.core.ProvisionException
org.eclipse.equinox.p2.core.ProvisionException
protected void internalStore(org.eclipse.core.runtime.IProgressMonitor monitor)
ArtifactRepositoryBaseImpl
This method is called after every (bulk) change to the index.
internalStore
in class ArtifactRepositoryBaseImpl<ModuleArtifactRepository.ModuleArtifactDescriptor>
private void storeOrProvisioningException() throws org.eclipse.equinox.p2.core.ProvisionException
org.eclipse.equinox.p2.core.ProvisionException
private void internalStoreWithException() throws java.io.IOException
java.io.IOException
private void load() throws org.eclipse.equinox.p2.core.ProvisionException
org.eclipse.equinox.p2.core.ProvisionException
private ModuleArtifactRepository.ModuleArtifactDescriptor getInternalDescriptorFromLoadedDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor loadedDescriptor, java.io.File sourceFile) throws org.eclipse.equinox.p2.core.ProvisionException
org.eclipse.equinox.p2.core.ProvisionException
static org.eclipse.equinox.p2.core.ProvisionException failedReadException(java.io.File sourceFile, java.lang.String details, java.lang.Exception exception)
public boolean isModifiable()
isModifiable
in interface org.eclipse.equinox.p2.repository.IRepository<org.eclipse.equinox.p2.metadata.IArtifactKey>
isModifiable
in class org.eclipse.equinox.p2.repository.spi.AbstractRepository<org.eclipse.equinox.p2.metadata.IArtifactKey>
static <T> boolean eq(T left, T right)