diff options
author | Olivier Lamy <olamy@apache.org> | 2012-03-12 08:10:38 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-03-12 08:10:38 +0000 |
commit | 6a46674535827acd278ba5271b2fac924bb24bb0 (patch) | |
tree | 23e7f339f2317eeb6c06077bbd0f3a5b8767423d /archiva-modules/archiva-web/archiva-webdav | |
parent | 2bf4472cafd03e28fe0cd89ec59281349c9d16df (diff) | |
download | archiva-6a46674535827acd278ba5271b2fac924bb24bb0.tar.gz archiva-6a46674535827acd278ba5271b2fac924bb24bb0.zip |
remove deprecated class
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1299574 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web/archiva-webdav')
2 files changed, 13 insertions, 7 deletions
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java index de71e9d15..3fad50a9a 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java @@ -33,6 +33,7 @@ import org.apache.archiva.indexer.merger.IndexMerger; import org.apache.archiva.indexer.merger.IndexMergerException; import org.apache.archiva.indexer.merger.TemporaryGroupIndex; import org.apache.archiva.indexer.search.RepositorySearch; +import org.apache.archiva.maven2.metadata.MavenMetadataReader; import org.apache.archiva.model.ArchivaRepositoryMetadata; import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.policies.ProxyDownloadException; @@ -47,7 +48,6 @@ import org.apache.archiva.repository.layout.LayoutException; import org.apache.archiva.repository.metadata.MetadataTools; import org.apache.archiva.repository.metadata.RepositoryMetadataException; import org.apache.archiva.repository.metadata.RepositoryMetadataMerge; -import org.apache.archiva.repository.metadata.RepositoryMetadataReader; import org.apache.archiva.repository.metadata.RepositoryMetadataWriter; import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler; import org.apache.archiva.security.ServletAuthenticator; @@ -55,6 +55,7 @@ import org.apache.archiva.webdav.util.MimeTypes; import org.apache.archiva.webdav.util.RepositoryPathUtil; import org.apache.archiva.webdav.util.TemporaryGroupIndexSessionCleaner; import org.apache.archiva.webdav.util.WebdavMethodUtil; +import org.apache.archiva.xml.XMLException; import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang.StringUtils; @@ -345,14 +346,19 @@ public class ArchivaDavResourceFactory try { File metadataFile = new File( resourceAbsPath ); - ArchivaRepositoryMetadata repoMetadata = RepositoryMetadataReader.read( metadataFile ); + ArchivaRepositoryMetadata repoMetadata = MavenMetadataReader.read( metadataFile ); mergedMetadata = RepositoryMetadataMerge.merge( mergedMetadata, repoMetadata ); } - catch ( RepositoryMetadataException r ) + catch ( XMLException e ) { throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Error occurred while reading metadata file." ); } + catch ( RepositoryMetadataException r ) + { + throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, + "Error occurred while merging metadata file." ); + } } try diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletRepositoryGroupTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletRepositoryGroupTest.java index bd792d368..8245cb48d 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletRepositoryGroupTest.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletRepositoryGroupTest.java @@ -23,13 +23,13 @@ import com.meterware.httpunit.GetMethodWebRequest; import com.meterware.httpunit.PutMethodWebRequest; import com.meterware.httpunit.WebRequest; import com.meterware.httpunit.WebResponse; -import org.apache.commons.io.FileUtils; -import org.apache.commons.lang.StringUtils; import org.apache.archiva.configuration.Configuration; import org.apache.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.archiva.configuration.RepositoryGroupConfiguration; +import org.apache.archiva.maven2.metadata.MavenMetadataReader; import org.apache.archiva.model.ArchivaRepositoryMetadata; -import org.apache.archiva.repository.metadata.RepositoryMetadataReader; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.StringUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -261,7 +261,7 @@ public class RepositoryServletRepositoryGroupTest File returnedMetadata = new File( "target/test-classes/retrievedMetadataFile.xml" ); FileUtils.writeStringToFile( returnedMetadata, response.getText() ); - ArchivaRepositoryMetadata metadata = RepositoryMetadataReader.read( returnedMetadata ); + ArchivaRepositoryMetadata metadata = MavenMetadataReader.read( returnedMetadata ); assertResponseOK( response ); assertEquals( "Versions list size", 4, metadata.getAvailableVersions().size() ); |