protected void updateRepositoryMetadata( ArtifactRepository localRepository,
ArtifactRepository remoteRepository )
throws IOException, XmlPullParserException
{
MetadataXpp3Reader mappingReader = new MetadataXpp3Reader();
Metadata metadata = null;
File metadataFile = new File( localRepository.getBasedir(),
localRepository.pathOfLocalRepositoryMetadata( this, remoteRepository ) );
if ( metadataFile.length() == 0 )
{
metadataFile.delete();
}
else if ( metadataFile.exists() )
{
Reader reader = null;
try
{
reader = ReaderFactory.newXmlReader( metadataFile );
metadata = mappingReader.read( reader, false );
}
finally
{
IOUtil.close( reader );
}