public override bool CanHandle(string[] args)
 {
     if (args.Length != 1)
     {
         throw ExceptionsFactory.IncorrectArgument("Path to delete", nameof(args));
     }
     return(Path.IsPathFullyQualified(args[0]));
 }
Ejemplo n.º 2
0
        public bool StringPathIsDirectory(string path)
        {
            if (path is null)
            {
                throw ExceptionsFactory.IncorrectArgument("Path to file or directory", nameof(path));
            }
            var pathToCheck = Path.IsPathRooted(path) ? path : Path.Combine(CurrentDirectoryPath, path);
            var attributes  = File.GetAttributes(pathToCheck);

            return(attributes.HasFlag(FileAttributes.Directory));
        }