You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-commits@incubator.apache.org by ap...@apache.org on 2010/12/16 08:42:33 UTC

svn commit: r1049818 - /incubator/npanday/trunk/dotnet/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/ArtifactRepository.cs

Author: apadilla
Date: Thu Dec 16 08:42:33 2010
New Revision: 1049818

URL: http://svn.apache.org/viewvc?rev=1049818&view=rev
Log:
[NPANDAY-360] 
- correct parsing of extension of artifact
- used the correct method, "GetLocalRepository) for artifact's location
- removed unused methods

Modified:
    incubator/npanday/trunk/dotnet/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/ArtifactRepository.cs

Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/ArtifactRepository.cs
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/ArtifactRepository.cs?rev=1049818&r1=1049817&r2=1049818&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/ArtifactRepository.cs (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/ArtifactRepository.cs Thu Dec 16 08:42:33 2010
@@ -32,17 +32,11 @@ namespace NPanday.Artifact
 {
     public sealed class ArtifactRepository
     {
-
-        public string GetLocalUacPath(Artifact artifact, string ext)
-        {
-            return Path.Combine(SettingsUtil.GetLocalRepositoryPath(), string.Format(@"{0}\{1}\{1}{2}-{3}", Tokenize(artifact.GroupId), artifact.ArtifactId, artifact.Version, ext));
-        }
         
         public string Tokenize(string id)
         {
             return id.Replace(".",Path.DirectorySeparatorChar.ToString());
-        }
-        
+        }        
 
         public string GetLocalRepositoryPath(Artifact artifact, string ext)
         {
@@ -178,7 +172,7 @@ namespace NPanday.Artifact
             string fileName = tokens[tokens.Length - 1];
             int index = fileName.LastIndexOf( "." );
             
-            string ext = fileName.Substring( index + 1 );
+            string ext = fileName.Substring( index );
             string version = tokens[tokens.Length - 2];
             string artifactId = tokens[tokens.Length - 3];
 
@@ -195,45 +189,13 @@ namespace NPanday.Artifact
             artifact.ArtifactId = artifactId;
             artifact.Version = version;
             artifact.GroupId = groupId;
-            artifact.FileInfo = new FileInfo(GetLocalUacPath(artifact, ext));
+            artifact.FileInfo = new FileInfo(GetLocalRepositoryPath(artifact, ext));
             
             
             
             return artifact;
         }
 
-
-
-        string getVersion(string versionAndGroupDirectoryName)
-        {
-           try
-            {
-                // 1.1.1.1__NMaven.VisualStudio from index 0 to __ is the version number
-                int index = versionAndGroupDirectoryName.IndexOf("__", 0);
-                string str = versionAndGroupDirectoryName.Substring(0, index);
-                return str;
-            }
-            catch
-            {
-                return string.Empty;
-            }
-        }
-
-        string getGroupId(string versionAndGroupDirectoryName)
-        {
-            try
-            {
-                int index = versionAndGroupDirectoryName.IndexOf("__", 0) + 2;
-                // 1.1.1.1__NMaven.VisualStudio from (next to index of __) to last is the groupid
-                string str = versionAndGroupDirectoryName.Substring(index, (versionAndGroupDirectoryName.Length - index));
-                return str;
-            }
-            catch
-            {
-                return string.Empty;
-            }
-        }
-
         #endregion