예제 #1
0
        /// <summary>
        /// Creates all directories and subdirectories in the specified path unless they already exist. Will not do anything if the directory exists. See https://github.com/FrendsPlatform/Frends.Directory
        /// </summary>
        /// <returns>Object { string Path } </returns>
        public static CreateResult Create([PropertyTab] SharedInput input, [PropertyTab] CreateOptions options)
        {
            if (!options.UseGivenUserCredentialsForRemoteConnections)
            {
                return(ExecuteCreate(input));
            }

            var domainAndUserName = GetDomainAndUserName(options.UserName);

            return(RunAsUser(domainAndUserName[0], domainAndUserName[1], options.Password, () => ExecuteCreate(input)));
        }
예제 #2
0
 private static DeleteResult ExecuteDelete(SharedInput input, bool optionsDeleteRecursivly)
 {
     if (!System.IO.Directory.Exists(input.Directory))
     {
         return(new DeleteResult("")
         {
             DirectoryNotFound = true
         });
     }
     System.IO.Directory.Delete(input.Directory, optionsDeleteRecursivly);
     return(new DeleteResult(input.Directory));
 }
예제 #3
0
        private static CreateResult ExecuteCreate(SharedInput input)
        {
            var newFolder = System.IO.Directory.CreateDirectory(input.Directory);

            return(new CreateResult(newFolder.FullName));
        }