From 47847c95c1833810b88a00b88b7ff7a5e018f40f Mon Sep 17 00:00:00 2001 From: "Maria Odea B. Ching" Date: Mon, 3 May 2010 08:49:48 +0000 Subject: [PATCH] moved getMetadataFile inline git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@940398 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/archiva/web/action/UploadAction.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java index 56f58069e..8ff18b12d 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java @@ -313,7 +313,7 @@ public class UploadAction int newBuildNumber = -1; String timestamp = null; - File versionMetadataFile = getMetadata( targetPath.getAbsolutePath() ); + File versionMetadataFile = new File( targetPath, MetadataTools.MAVEN_METADATA ); ArchivaRepositoryMetadata versionMetadata = getMetadata( versionMetadataFile ); if ( VersionUtil.isSnapshot( version ) ) @@ -501,11 +501,6 @@ public class UploadAction return pomFile; } - private File getMetadata( String targetPath ) - { - return new File( targetPath, MetadataTools.MAVEN_METADATA ); - } - private ArchivaRepositoryMetadata getMetadata( File metadataFile ) throws RepositoryMetadataException { @@ -561,8 +556,9 @@ public class UploadAction List availableVersions = new ArrayList(); String latestVersion = version; - String projectPath = targetPath.substring( 0, targetPath.lastIndexOf( File.separatorChar ) ); - File projectMetadataFile = getMetadata( projectPath ); + File projectDir = new File( targetPath ).getParentFile(); + File projectMetadataFile = new File( projectDir, MetadataTools.MAVEN_METADATA ); + ArchivaRepositoryMetadata projectMetadata = getMetadata( projectMetadataFile ); if ( projectMetadataFile.exists() ) -- 2.39.5