moved getMetadataFile inline

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@940398 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Maria Odea B. Ching 2010-05-03 08:49:48 +00:00
parent 76502a997d
commit 47847c95c1
1 changed files with 4 additions and 8 deletions

View File

@ -313,7 +313,7 @@ public class UploadAction
int newBuildNumber = -1; int newBuildNumber = -1;
String timestamp = null; String timestamp = null;
File versionMetadataFile = getMetadata( targetPath.getAbsolutePath() ); File versionMetadataFile = new File( targetPath, MetadataTools.MAVEN_METADATA );
ArchivaRepositoryMetadata versionMetadata = getMetadata( versionMetadataFile ); ArchivaRepositoryMetadata versionMetadata = getMetadata( versionMetadataFile );
if ( VersionUtil.isSnapshot( version ) ) if ( VersionUtil.isSnapshot( version ) )
@ -501,11 +501,6 @@ public class UploadAction
return pomFile; return pomFile;
} }
private File getMetadata( String targetPath )
{
return new File( targetPath, MetadataTools.MAVEN_METADATA );
}
private ArchivaRepositoryMetadata getMetadata( File metadataFile ) private ArchivaRepositoryMetadata getMetadata( File metadataFile )
throws RepositoryMetadataException throws RepositoryMetadataException
{ {
@ -561,8 +556,9 @@ public class UploadAction
List<String> availableVersions = new ArrayList<String>(); List<String> availableVersions = new ArrayList<String>();
String latestVersion = version; String latestVersion = version;
String projectPath = targetPath.substring( 0, targetPath.lastIndexOf( File.separatorChar ) ); File projectDir = new File( targetPath ).getParentFile();
File projectMetadataFile = getMetadata( projectPath ); File projectMetadataFile = new File( projectDir, MetadataTools.MAVEN_METADATA );
ArchivaRepositoryMetadata projectMetadata = getMetadata( projectMetadataFile ); ArchivaRepositoryMetadata projectMetadata = getMetadata( projectMetadataFile );
if ( projectMetadataFile.exists() ) if ( projectMetadataFile.exists() )