public void updateMetadata( ManagedRepositoryContent managedRepository, String logicalResource) throws RepositoryMetadataException
{
- ArchivaRepositoryMetadata metadata = null;
final File metadataFile = new File(managedRepository.getRepoRoot(), logicalResource);
-// final long lastUpdated = getExistingLastUpdated( metadataFile );
+ ArchivaRepositoryMetadata metadata = null;
//Gather and merge all metadata available
List<ArchivaRepositoryMetadata> metadatas = getMetadatasForManagedRepository(managedRepository, logicalResource);
updateMetadataVersions(availableVersions, metadata);
}
-// if ( lastUpdated > 0 )
-// {
-// metadata.setLastUpdatedTimestamp( toLastUpdatedDate( lastUpdated ) );
-// }
-
RepositoryMetadataWriter.write(metadata, metadataFile);
+
+ ChecksummedFile checksum = new ChecksummedFile( metadataFile );
+ checksum.fixChecksums( algorithms );
}
/**
* under the License.
*/
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
import org.apache.maven.archiva.model.ArchivaModelCloner;
import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
import org.apache.maven.archiva.model.SnapshotVersion;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.time.DateUtils;
import org.apache.maven.archiva.model.Plugin;
/**
protected static final String REPO_GROUP_WITH_INVALID_REPOS = "group-with-invalid-repos";
+ @Override
protected void setUp()
throws Exception
{
saveConfiguration( archivaConfiguration );
}
+ @Override
protected void tearDown()
throws Exception
{
response = sc.getResource( request );
assertResponseOK( response );
- assertEquals( "d2321a573e0488bca571b624f891104009408dd8 maven-metadata-group-with-valid-repos.xml", response.getText() );
+ assertEquals( "add113b0d7f8c6adb92a5015a7a3701081edf998 maven-metadata-group-with-valid-repos.xml", response.getText() );
// request the md5 checksum of the metadata
request =
response = sc.getResource( request );
assertResponseOK( response );
- assertEquals( "79d271fbe8bd1d17b23273937750d407 maven-metadata-group-with-valid-repos.xml", response.getText().trim() );
+ assertEquals( "5b85ea4aa5f52bb76760041a52f98de8 maven-metadata-group-with-valid-repos.xml", response.getText().trim() );
}
protected void assertResponseMethodNotAllowed( WebResponse response )