Class LocalArtifactRepository
- java.lang.Object
-
- org.eclipse.core.runtime.PlatformObject
-
- org.eclipse.equinox.p2.repository.spi.AbstractRepository<org.eclipse.equinox.p2.metadata.IArtifactKey>
-
- org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
-
- org.eclipse.tycho.repository.p2base.artifact.repository.AbstractArtifactRepository2
-
- org.eclipse.tycho.repository.p2base.artifact.repository.ArtifactRepositoryBaseImpl<GAVArtifactDescriptor>
-
- org.eclipse.tycho.repository.local.LocalArtifactRepository
-
- All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable
,org.eclipse.equinox.p2.query.IQueryable<org.eclipse.equinox.p2.metadata.IArtifactKey>
,org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
,org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository
,org.eclipse.equinox.p2.repository.IRepository<org.eclipse.equinox.p2.metadata.IArtifactKey>
,IArtifactFileProvider
,IArtifactProvider
,IRawArtifactFileProvider
,IRawArtifactProvider
public class LocalArtifactRepository extends ArtifactRepositoryBaseImpl<GAVArtifactDescriptor>
-
-
Field Summary
Fields Modifier and Type Field Description private RepositoryReader
contentLocator
private java.util.Set<org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor>
descriptorsOnLastSave
private LocalRepositoryP2Indices
localRepoIndices
-
Fields inherited from class org.eclipse.tycho.repository.p2base.artifact.repository.ArtifactRepositoryBaseImpl
descriptors, descriptorsMap
-
-
Constructor Summary
Constructors Constructor Description LocalArtifactRepository(org.eclipse.equinox.p2.core.IProvisioningAgent agent, LocalRepositoryP2Indices localRepoIndices, MavenRepositorySystem repositorySystem)
LocalArtifactRepository(org.eclipse.equinox.p2.core.IProvisioningAgent agent, LocalRepositoryP2Indices localRepoIndices, RepositoryReader contentLocator)
LocalArtifactRepository(LocalRepositoryP2Indices localRepoIndices)
LocalArtifactRepository(LocalRepositoryP2Indices localRepoIndices, RepositoryReader contentLocator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor
createArtifactDescriptor(org.eclipse.equinox.p2.metadata.IArtifactKey key)
private java.io.File
getBasedir()
protected org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor
getComparableDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Returns anIArtifactDescriptor
instance which is comparable to the artifact descriptors stored in the index (i.e.protected GAVArtifactDescriptor
getInternalDescriptorForAdding(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Returns an artifact descriptor of the internal descriptor typeArtifactDescriptorT
which may be added to the index.private java.lang.String
getMetadataRelpath(GAV gav)
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.boolean
isModifiable()
private void
loadMaven()
void
save()
private void
saveMaven()
private GAVArtifactDescriptor
toInternalDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
-
Methods inherited from class org.eclipse.tycho.repository.p2base.artifact.repository.ArtifactRepositoryBaseImpl
contains, contains, descriptorQueryable, getArtifact, getArtifact, getArtifactDescriptors, getArtifactFile, getArtifactFile, getRawArtifact, internalAddDescriptor, internalAddInternalDescriptor, internalNewAddingArtifactSink, internalRemoveAllDescriptors, internalRemoveDescriptor, internalRemoveDescriptors, internalRemoveDescriptors, internalRemoveDescriptors, internalStore, newAddingArtifactSink, newAddingRawArtifactSink, query
-
Methods inherited from class org.eclipse.tycho.repository.p2base.artifact.repository.AbstractArtifactRepository2
addDescriptor, addDescriptor, addDescriptors, addDescriptors, getArtifacts, getOutputStream, getRawArtifact, isFatal, removeAll, removeAll, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptors, removeDescriptors, removeDescriptors, removeDescriptors, setStatusOnStreamIfPossible
-
Methods inherited from class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
createArtifactKey, equals, executeBatch, hashCode
-
Methods inherited from class org.eclipse.equinox.p2.repository.spi.AbstractRepository
assertModifiable, getDescription, getLocation, getName, getProperties, getProperty, getProvider, getProvisioningAgent, getType, getVersion, setDescription, setLocation, setName, setProperties, setProperty, setProperty, setProvider, setType, setVersion
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
addDescriptor, addDescriptor, addDescriptors, addDescriptors, createArtifactKey, executeBatch, getArtifacts, getOutputStream, getRawArtifact, removeAll, removeAll, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptors, removeDescriptors, removeDescriptors, removeDescriptors
-
-
-
-
Field Detail
-
descriptorsOnLastSave
private java.util.Set<org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor> descriptorsOnLastSave
-
localRepoIndices
private final LocalRepositoryP2Indices localRepoIndices
-
contentLocator
private final RepositoryReader contentLocator
-
-
Constructor Detail
-
LocalArtifactRepository
public LocalArtifactRepository(LocalRepositoryP2Indices localRepoIndices)
-
LocalArtifactRepository
public LocalArtifactRepository(LocalRepositoryP2Indices localRepoIndices, RepositoryReader contentLocator)
-
LocalArtifactRepository
public LocalArtifactRepository(org.eclipse.equinox.p2.core.IProvisioningAgent agent, LocalRepositoryP2Indices localRepoIndices, MavenRepositorySystem repositorySystem)
-
LocalArtifactRepository
public LocalArtifactRepository(org.eclipse.equinox.p2.core.IProvisioningAgent agent, LocalRepositoryP2Indices localRepoIndices, RepositoryReader contentLocator)
-
-
Method Detail
-
loadMaven
private void loadMaven()
-
saveMaven
private void saveMaven()
-
getMetadataRelpath
private java.lang.String getMetadataRelpath(GAV gav)
-
save
public void save()
-
internalGetArtifactStorageLocation
protected java.io.File internalGetArtifactStorageLocation(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Description copied from class:ArtifactRepositoryBaseImpl
Returns the file system location where the given artifact is or would be stored. UnlikeArtifactRepositoryBaseImpl.getArtifactFile(IArtifactDescriptor)
, this method does not check if the given artifact exists in the repository and never returnsnull
.This method may be called by any API method for reading or writing artifacts.
- Specified by:
internalGetArtifactStorageLocation
in classArtifactRepositoryBaseImpl<GAVArtifactDescriptor>
-
createArtifactDescriptor
public org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor createArtifactDescriptor(org.eclipse.equinox.p2.metadata.IArtifactKey key)
- Specified by:
createArtifactDescriptor
in interfaceorg.eclipse.equinox.p2.repository.artifact.IArtifactRepository
- Overrides:
createArtifactDescriptor
in classorg.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
-
getComparableDescriptor
protected org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor getComparableDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Description copied from class:ArtifactRepositoryBaseImpl
Returns anIArtifactDescriptor
instance which is comparable to the artifact descriptors stored in the index (i.e. theArtifactRepositoryBaseImpl.descriptors
member). A valid implementation is to convert the argument to the internal descriptor typeArtifactDescriptorT
, but this is not a requirement. This method should be implemented in a way so that callingdescriptors.contains(getComparableDescriptor(foreignDescriptor))
with a descriptor from a foreign artifact repository returnstrue
if and only if copying that foreign artifact to this repository withAbstractArtifactRepository2.getOutputStream(IArtifactDescriptor)
would not add a new artifact to this repository.This method may be called by any API method with an
IArtifactDescriptor
argument.- Specified by:
getComparableDescriptor
in classArtifactRepositoryBaseImpl<GAVArtifactDescriptor>
- Parameters:
descriptor
- AnIArtifactDescriptor
from any artifact repository.
-
getInternalDescriptorForAdding
protected GAVArtifactDescriptor getInternalDescriptorForAdding(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Description copied from class:ArtifactRepositoryBaseImpl
Returns an artifact descriptor of the internal descriptor typeArtifactDescriptorT
which may be added to the index. Implementations may require that the descriptor argument is a descriptor instance created by this repository – seeAbstractArtifactRepository.createArtifactDescriptor(IArtifactKey)
.This method is called by methods that add entries to the index, i.e. from
ArtifactRepositoryBaseImpl.newAddingArtifactSink(IArtifactKey)
.- Specified by:
getInternalDescriptorForAdding
in classArtifactRepositoryBaseImpl<GAVArtifactDescriptor>
- Parameters:
descriptor
- AnIArtifactDescriptor
instance
-
toInternalDescriptor
private GAVArtifactDescriptor toInternalDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
-
getBasedir
private java.io.File getBasedir()
-
isModifiable
public boolean isModifiable()
- Specified by:
isModifiable
in interfaceorg.eclipse.equinox.p2.repository.IRepository<org.eclipse.equinox.p2.metadata.IArtifactKey>
- Overrides:
isModifiable
in classorg.eclipse.equinox.p2.repository.spi.AbstractRepository<org.eclipse.equinox.p2.metadata.IArtifactKey>
-
-