ToString() public method

Provides the current path internal to the Directory object
public ToString ( ) : string
return string
        public FluentFileSample()
        {
            var file = new FluentFs.Core.File(@"c:\temp\test.txt");

            file.Copy.To(@"c:\temp\test2.txt");
            file.Move.To(@"c:\NewDirectory");
            file.Move.ContinueOnError.To(@"c:\DirectoryThatMayNotExist");
            file.Rename.To("test41.txt");
            file.Delete(OnError.Continue);

            var directory = new FluentFs.Core.Directory(@"c:\temp\sample");

            directory.Delete(OnError.Continue).Create(OnError.Fail);
            directory.Files();                                    //returns all files in the folder
            directory.Files("*.txt");                             //returns all files ending in .txt
            var childFolder = directory.SubFolder("childFolder"); //creates a new Directory object with a path of c:\temp\sample\childFolder

            directory.ToString();                                 //returns the path of the folder
            directory.File("test.txt");                           // returns back a FluentFilesystem.File object with a path of c:\temp\sample\test.txt

            var fileset = new FluentFs.Core.FileSet();

            fileset.Include(@"c:\Project\GUI\*.cs").RecurseAllSubDirectories
            .Exclude("assemblyInfo.cs")
            .Include(@"c:\Project\globalconfig.xml");

            ReadOnlyCollection <string> files = fileset.Files;

            fileset.Copy.To(@"c:\temp");
        }
Esempio n. 2
0
 public FileSet Exclude(Directory path)
 {
     _isInclusion = false;
     ProcessPendings();
     PendingExclude = path.ToString();
     return(this);
 }
Esempio n. 3
0
 ///<summary>
 /// Sets the output directory for the msbuild task
 ///</summary>
 /// <remarks>Sets the OutDir property (i.e. /p:OutDir)</remarks>
 ///<param name="path">the output folder</param>
 ///<returns></returns>
 public MsBuildTask OutputDirectory(FluentFs.Core.Directory path)
 {
     OutputDirectory(path.ToString());
     return(this);
 }
Esempio n. 4
0
 public void BuildFolderCopyShouldMoveToNewFolder()
 {
     var buildFolder = new Directory(@"c:\sample");
     _copyEngine.To(buildFolder);
     _fileSystemWrapper.AssertWasCalled(x => x.Copy(_source, buildFolder.ToString() + "\\nonexistant.txt"));
 }
Esempio n. 5
0
 public FileSet Include(Directory path)
 {
     _isInclusion = true;
     ProcessPendings();
     PendingInclude = path.ToString();
     return this;
 }
Esempio n. 6
0
        public FluentFileSample()
        {
            var file = new FluentFs.Core.File(@"c:\temp\test.txt");
            file.Copy.To(@"c:\temp\test2.txt");
            file.Move.To(@"c:\NewDirectory");
            file.Move.ContinueOnError.To(@"c:\DirectoryThatMayNotExist");
            file.Rename.To("test41.txt");
            file.Delete(OnError.Continue);

            var directory = new FluentFs.Core.Directory(@"c:\temp\sample");
            directory.Delete(OnError.Continue).Create(OnError.Fail);
            directory.Files(); //returns all files in the folder
            directory.Files("*.txt"); //returns all files ending in .txt
            var childFolder = directory.SubFolder("childFolder"); //creates a new Directory object with a path of c:\temp\sample\childFolder
            directory.ToString(); //returns the path of the folder
            directory.File("test.txt"); // returns back a FluentFilesystem.File object with a path of c:\temp\sample\test.txt

            var fileset = new FluentFs.Core.FileSet();
            fileset.Include(@"c:\Project\GUI\*.cs").RecurseAllSubDirectories
              .Exclude("assemblyInfo.cs")
              .Include(@"c:\Project\globalconfig.xml");

            ReadOnlyCollection<string> files = fileset.Files;

            fileset.Copy.To(@"c:\temp");
        }
Esempio n. 7
0
 public IExecutable InWorkingDirectory(FluentFs.Core.Directory directory)
 {
     WorkingDirectory = directory.ToString();
     return(this);
 }