示例#1
0
        public void SetProperty(string path, PSObject propertyValue)
        {
            if (PathResolver.IsLocalPath(path))
            {
                return;
            }

            var parts = PathResolver.SplitPath(path);

            if (parts.Count == 0)
            {
                return;
            }

            //if the provider is not mounted, then create it first
            var drive = GetDrive(parts[0]);

            if (drive == null)
            {
                return;
            }

            //delegate it
            drive.SetProperty(PathResolver.GetSubpath(path), propertyValue);
        }
示例#2
0
        public void GetProperty(string path, System.Collections.ObjectModel.Collection <string> providerSpecificPickList)
        {
            if (PathResolver.IsLocalPath(path))
            {
                return;
            }

            var parts = PathResolver.SplitPath(path);

            if (parts.Count == 0)
            {
                return;
            }

            //if the provider is not mounted, then create it first
            var drive = GetDrive(parts[0]);

            if (drive == null)
            {
                return;
            }

            //delegate it
            drive.GetProperty(PathResolver.GetSubpath(path), providerSpecificPickList);
        }
示例#3
0
        public IContentReader GetContentReader(string path)
        {
            if (PathResolver.IsLocalPath(path))
            {
                return(null);
            }

            var parts = PathResolver.SplitPath(path);

            if (parts.Count == 0)
            {
                return(null);
            }

            //if the provider is not mounted, then create it first
            var drive = GetDrive(parts[0]);

            if (drive == null)
            {
                return(null);
            }

            //delegate it
            return(drive.GetContentReader(PathResolver.GetSubpath(path)));
        }
示例#4
0
        protected override bool ItemExists(string path)
        {
            if (PathResolver.IsLocalPath(path))
            {
                return(true);
            }

            var parts = PathResolver.SplitPath(path);

            if (parts.Count == 0)
            {
                return(true);
            }

            //if the provider is not mounted, then create it first
            var drive = GetDrive(parts[0]);

            if (drive == null)
            {
                return(false);
            }

            //delegate it
            return(drive.ItemExists(PathResolver.GetSubpath(path)));
        }
示例#5
0
        public override bool ItemExists(string path)
        {
            if (PathResolver.IsLocalPath(path))
            {
                path = PathResolver.ConvertToRealLocalPath(path);
                return(File.Exists(path) || Directory.Exists(path));
            }

            try
            {
                var r      = AzureFilePathResolver.ResolvePath(this.Client, path, skipCheckExistence: false);
                var exists = r.Exists();
                return(exists);
            }
            catch (Exception)
            {
                return(false);
            }
        }
示例#6
0
        public override bool IsItemContainer(string path)
        {
            if (PathResolver.IsLocalPath(path))
            {
                return(true);
            }

            var parts = PathResolver.SplitPath(path);

            if (parts.Count == 0)
            {
                return(true);
            }

            try
            {
                var r = AzureFilePathResolver.ResolvePath(this.Client, path, hint: PathType.AzureFileDirectory, skipCheckExistence: false);
                return(r.Exists());
            }
            catch (Exception)
            {
                return(false);
            }
        }