|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.archiva.repository.metadata.MetadataTools
@Service(value="metadataTools#default") public class MetadataTools
MetadataTools
Field Summary | |
---|---|
private ChecksumAlgorithm[] |
algorithms
|
private List<String> |
artifactPatterns
|
private ArchivaConfiguration |
configuration
|
private FileTypes |
filetypes
|
private static char |
GROUP_SEPARATOR
|
private SimpleDateFormat |
lastUpdatedFormat
|
private org.slf4j.Logger |
log
|
static String |
MAVEN_ARCHETYPE_CATALOG
|
static String |
MAVEN_METADATA
|
private static char[] |
NUMS
|
private static char |
PATH_SEPARATOR
|
private Map<String,Set<String>> |
proxies
|
Constructor Summary | |
---|---|
MetadataTools()
|
Method Summary | |
---|---|
void |
afterConfigurationChange(org.apache.archiva.redback.components.registry.Registry registry,
String propertyName,
Object propertyValue)
|
void |
beforeConfigurationChange(org.apache.archiva.redback.components.registry.Registry registry,
String propertyName,
Object propertyValue)
|
private Set<String> |
findPossibleVersions(Set<String> versions,
File metadataParentDirectory)
Skims the parent directory of a metadata in vain hope of finding subdirectories that contain poms. |
private String |
formatAsDirectory(String directory)
|
Set<String> |
gatherSnapshotVersions(ManagedRepositoryContent managedRepository,
VersionedReference reference)
Gather the set of snapshot versions found in a particular versioned reference. |
ArchivaConfiguration |
getConfiguration()
|
private long |
getExistingLastUpdated(File metadataFile)
|
FileTypes |
getFiletypes()
|
ArtifactReference |
getFirstArtifact(ManagedRepositoryContent managedRepository,
VersionedReference reference)
Get the first Artifact found in the provided VersionedReference location. |
private long |
getLastUpdated(ArchivaRepositoryMetadata metadata)
|
private List<ArchivaRepositoryMetadata> |
getMetadatasForManagedRepository(ManagedRepositoryContent managedRepository,
String logicalResource)
|
String |
getRepositorySpecificName(RemoteRepositoryContent repository,
String path)
Adjusts a path for a metadata.xml file to its repository specific path. |
String |
getRepositorySpecificName(String proxyId,
String path)
Adjusts a path for a metadata.xml file to its repository specific path. |
private boolean |
hasNumberAnywhere(String version)
|
private void |
initConfigVariables()
|
void |
initialize()
|
ArchivaRepositoryMetadata |
readProxyMetadata(ManagedRepositoryContent managedRepository,
ProjectReference reference,
String proxyId)
|
ArchivaRepositoryMetadata |
readProxyMetadata(ManagedRepositoryContent managedRepository,
String logicalResource,
String proxyId)
|
ArchivaRepositoryMetadata |
readProxyMetadata(ManagedRepositoryContent managedRepository,
VersionedReference reference,
String proxyId)
|
void |
setConfiguration(ArchivaConfiguration configuration)
|
void |
setFiletypes(FileTypes filetypes)
|
private Date |
toLastUpdatedDate(long lastUpdated)
|
private long |
toLastUpdatedLong(String timestampString)
|
String |
toPath(ProjectReference reference)
|
String |
toPath(VersionedReference reference)
|
ProjectReference |
toProjectReference(String path)
|
VersionedReference |
toVersionedReference(String path)
Take a path to a maven-metadata.xml, and attempt to translate it to a VersionedReference. |
void |
updateMetadata(ManagedRepositoryContent managedRepository,
ProjectReference reference)
Deprecated. |
void |
updateMetadata(ManagedRepositoryContent managedRepository,
String logicalResource)
|
void |
updateMetadata(ManagedRepositoryContent managedRepository,
VersionedReference reference)
Deprecated. |
private void |
updateMetadataVersions(Collection<String> allVersions,
ArchivaRepositoryMetadata metadata)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private org.slf4j.Logger log
public static final String MAVEN_METADATA
public static final String MAVEN_ARCHETYPE_CATALOG
private static final char PATH_SEPARATOR
private static final char GROUP_SEPARATOR
@Inject @Named(value="archivaConfiguration#default") private ArchivaConfiguration configuration
@Inject @Named(value="fileTypes") private FileTypes filetypes
private ChecksumAlgorithm[] algorithms
private List<String> artifactPatterns
private Map<String,Set<String>> proxies
private static final char[] NUMS
private SimpleDateFormat lastUpdatedFormat
Constructor Detail |
---|
public MetadataTools()
Method Detail |
---|
public void afterConfigurationChange(org.apache.archiva.redback.components.registry.Registry registry, String propertyName, Object propertyValue)
afterConfigurationChange
in interface org.apache.archiva.redback.components.registry.RegistryListener
public void beforeConfigurationChange(org.apache.archiva.redback.components.registry.Registry registry, String propertyName, Object propertyValue)
beforeConfigurationChange
in interface org.apache.archiva.redback.components.registry.RegistryListener
public Set<String> gatherSnapshotVersions(ManagedRepositoryContent managedRepository, VersionedReference reference) throws LayoutException, IOException, ContentNotFoundException
LayoutException
ContentNotFoundException
IOException
public VersionedReference toVersionedReference(String path) throws RepositoryMetadataException
path
-
RepositoryMetadataException
private boolean hasNumberAnywhere(String version)
public ProjectReference toProjectReference(String path) throws RepositoryMetadataException
RepositoryMetadataException
public String toPath(ProjectReference reference)
public String toPath(VersionedReference reference)
private String formatAsDirectory(String directory)
public String getRepositorySpecificName(RemoteRepositoryContent repository, String path)
repository
- the repository to base new path off of.path
- the path to the metadata.xml file to adjust the name of.
public String getRepositorySpecificName(String proxyId, String path)
proxyId
- the repository id to base new path off of.path
- the path to the metadata.xml file to adjust the name of.
@PostConstruct public void initialize()
public ArchivaRepositoryMetadata readProxyMetadata(ManagedRepositoryContent managedRepository, ProjectReference reference, String proxyId)
public ArchivaRepositoryMetadata readProxyMetadata(ManagedRepositoryContent managedRepository, String logicalResource, String proxyId)
public ArchivaRepositoryMetadata readProxyMetadata(ManagedRepositoryContent managedRepository, VersionedReference reference, String proxyId)
public void updateMetadata(ManagedRepositoryContent managedRepository, String logicalResource) throws RepositoryMetadataException
RepositoryMetadataException
private Set<String> findPossibleVersions(Set<String> versions, File metadataParentDirectory)
metadataParentDirectory
-
private List<ArchivaRepositoryMetadata> getMetadatasForManagedRepository(ManagedRepositoryContent managedRepository, String logicalResource)
public void updateMetadata(ManagedRepositoryContent managedRepository, ProjectReference reference) throws LayoutException, RepositoryMetadataException, IOException, ContentNotFoundException
managedRepository
- the managed repository where the metadata is kept.reference
- the reference to update.
LayoutException
RepositoryMetadataException
IOException
ContentNotFoundException
private void updateMetadataVersions(Collection<String> allVersions, ArchivaRepositoryMetadata metadata)
private Date toLastUpdatedDate(long lastUpdated)
private long toLastUpdatedLong(String timestampString)
private long getLastUpdated(ArchivaRepositoryMetadata metadata)
private long getExistingLastUpdated(File metadataFile)
public void updateMetadata(ManagedRepositoryContent managedRepository, VersionedReference reference) throws LayoutException, RepositoryMetadataException, IOException, ContentNotFoundException
managedRepository
- the managed repository where the metadata is kept.reference
- the versioned reference to update
LayoutException
RepositoryMetadataException
IOException
ContentNotFoundException
private void initConfigVariables()
public ArtifactReference getFirstArtifact(ManagedRepositoryContent managedRepository, VersionedReference reference) throws LayoutException, IOException
managedRepository
- the repository to search within.reference
- the reference to the versioned reference to search within
IOException
- if the versioned reference is invalid (example: doesn't exist, or isn't a directory)
LayoutException
public ArchivaConfiguration getConfiguration()
public void setConfiguration(ArchivaConfiguration configuration)
public FileTypes getFiletypes()
public void setFiletypes(FileTypes filetypes)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |