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 RepositoryReadercontentLocatorprivate java.util.Set<org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor>descriptorsOnLastSaveprivate LocalRepositoryP2IndiceslocalRepoIndices-
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.IArtifactDescriptorcreateArtifactDescriptor(org.eclipse.equinox.p2.metadata.IArtifactKey key)private java.io.FilegetBasedir()protected org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptorgetComparableDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)Returns anIArtifactDescriptorinstance which is comparable to the artifact descriptors stored in the index (i.e.protected GAVArtifactDescriptorgetInternalDescriptorForAdding(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)Returns an artifact descriptor of the internal descriptor typeArtifactDescriptorTwhich may be added to the index.private java.lang.StringgetMetadataRelpath(GAV gav)protected java.io.FileinternalGetArtifactStorageLocation(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)Returns the file system location where the given artifact is or would be stored.booleanisModifiable()private voidloadMaven()voidsave()private voidsaveMaven()private GAVArtifactDescriptortoInternalDescriptor(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:ArtifactRepositoryBaseImplReturns 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:
internalGetArtifactStorageLocationin classArtifactRepositoryBaseImpl<GAVArtifactDescriptor>
-
createArtifactDescriptor
public org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor createArtifactDescriptor(org.eclipse.equinox.p2.metadata.IArtifactKey key)
- Specified by:
createArtifactDescriptorin interfaceorg.eclipse.equinox.p2.repository.artifact.IArtifactRepository- Overrides:
createArtifactDescriptorin 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:ArtifactRepositoryBaseImplReturns anIArtifactDescriptorinstance which is comparable to the artifact descriptors stored in the index (i.e. theArtifactRepositoryBaseImpl.descriptorsmember). 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 returnstrueif 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
IArtifactDescriptorargument.- Specified by:
getComparableDescriptorin classArtifactRepositoryBaseImpl<GAVArtifactDescriptor>- Parameters:
descriptor- AnIArtifactDescriptorfrom any artifact repository.
-
getInternalDescriptorForAdding
protected GAVArtifactDescriptor getInternalDescriptorForAdding(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Description copied from class:ArtifactRepositoryBaseImplReturns an artifact descriptor of the internal descriptor typeArtifactDescriptorTwhich 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:
getInternalDescriptorForAddingin classArtifactRepositoryBaseImpl<GAVArtifactDescriptor>- Parameters:
descriptor- AnIArtifactDescriptorinstance
-
toInternalDescriptor
private GAVArtifactDescriptor toInternalDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
-
getBasedir
private java.io.File getBasedir()
-
isModifiable
public boolean isModifiable()
- Specified by:
isModifiablein interfaceorg.eclipse.equinox.p2.repository.IRepository<org.eclipse.equinox.p2.metadata.IArtifactKey>- Overrides:
isModifiablein classorg.eclipse.equinox.p2.repository.spi.AbstractRepository<org.eclipse.equinox.p2.metadata.IArtifactKey>
-
-