~cszikszoy/do-plugins/fix-confluence

« back to all changes in this revision

Viewing changes to File/src/Do/Do.FilesAndFolders/Plugin.cs

  • Committer: Peng Deng
  • Date: 2009-06-10 23:11:49 UTC
  • mfrom: (618.1.1 do-plugins)
  • Revision ID: dengpeng@gmail.com-20090610231149-sw23bdm8c2qxo022
Fix the home folder match in Files and Folders plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 */
19
19
 
20
20
using System;
 
21
using System.Text.RegularExpressions;
21
22
 
22
23
using Do.Platform;
23
24
using Do.Universe;
48
49
 
49
50
                public static IFileItem NewFileItem (string path)
50
51
                {
51
 
                        return Services.UniverseFactory.NewFileItem (path);
 
52
                        return Services.UniverseFactory.NewFileItem (UnwrapHomeFolder (path));
52
53
                }
53
54
 
54
55
                public static IApplicationItem NewApplicationItem (string path)
60
61
                {
61
62
                        return new TextItem (text);
62
63
                }
 
64
 
 
65
                public static string UnwrapHomeFolder (string path)
 
66
                {
 
67
                        return Regex.Replace (path, @"^~\/", ImportantFolders.UserHome + "/");
 
68
                }
63
69
        }
64
70
}