private void RemoveDoubleDots()
 {
     if (SearchPath.Contains("/.."))
     {
         string beforeDoubleDots        = SearchPath.Substring(0, SearchPath.IndexOf("/.."));
         int    numberOfPossibleStepsUp = Regex.Matches(beforeDoubleDots, "/").Count;
         int    numberOfDoubleDots      = Regex.Matches(SearchPath, @"/\.\.").Count;
         if (numberOfPossibleStepsUp <= numberOfDoubleDots)
         {
             string afterDoubleDots = SearchPath.Substring(SearchPath.LastIndexOf("/..") + 3);
             while (numberOfDoubleDots > 0)
             {
                 if (beforeDoubleDots.LastIndexOf('/') >= 0)
                 {
                     beforeDoubleDots = beforeDoubleDots.Substring(0, beforeDoubleDots.LastIndexOf("/"));
                 }
                 else
                 {
                     break;
                 }
                 numberOfDoubleDots--;
             }
             VaultPath  = beforeDoubleDots;
             SearchPath = VaultPath + afterDoubleDots;
         }
     }
 }
 /// <summary>
 /// Add new respository paths to search for AAR and JAR files (recursive)
 /// </summary>
 /// <param name="RepositoryPath">Root directory containing the repository</param>
 /// <param name="SearchPattern">Search pattern to match</param>
 public void AddRepositories(string RepositoryPath, string SearchPattern)
 {
     if (Directory.Exists(RepositoryPath))
     {
         List <string> ToCheck = new List <string>();
         ToCheck.Add(RepositoryPath);
         while (ToCheck.Count > 0)
         {
             int    LastIndex  = ToCheck.Count - 1;
             string CurrentDir = ToCheck[LastIndex];
             ToCheck.RemoveAt(LastIndex);
             foreach (string SearchPath in Directory.GetDirectories(CurrentDir))
             {
                 if (SearchPath.Contains(SearchPattern))
                 {
                     Log.TraceInformation("Added repository: {0}", SearchPath);
                     Repositories.Add(SearchPath);
                 }
                 else
                 {
                     ToCheck.Add(SearchPath);
                 }
             }
         }
     }
     else
     {
         Log.TraceInformation("AddRepositories: Directory {0} not found; ignored", RepositoryPath);
     }
 }