ExtractPathType() public static method

public static ExtractPathType ( string path ) : enActivityIOPathType
path string
return enActivityIOPathType
        /// <summary>
        /// Return an IActivityIOPath based upont the path string
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public static IActivityIOPath CreatePathFromString(string path, string user, string pass, bool IsNotCertVerifiable)
        {
            // Fetch path type
            enActivityIOPathType type = Dev2ActivityIOPathUtils.ExtractPathType(path);

            if (type == enActivityIOPathType.Invalid)
            {
                // Default to file system
                type = enActivityIOPathType.FileSystem;
            }

            return(new Dev2ActivityIOPath(type, path, user, pass, IsNotCertVerifiable));
        }
Exemplo n.º 2
0
        public static IActivityIOPath CreatePathFromString(string path, string user, string pass, bool isNotCertVerifiable, string privateKeyFile)
        {
            VerifyArgument.IsNotNull("path", path);
            var type = Dev2ActivityIOPathUtils.ExtractPathType(path);

            if (type == enActivityIOPathType.Invalid)
            {
                // Default to file system
                type = enActivityIOPathType.FileSystem;
                if (!Path.IsPathRooted(path))
                {
                    throw new IOException(ErrorResource.InvalidPath);
                }
            }

            return(new Dev2ActivityIOPath(type, path, user, pass, isNotCertVerifiable, privateKeyFile));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Return an IActivityIOPath based upont the path string
        /// </summary>
        /// <param name="path">The path.</param>
        /// <param name="user">The user.</param>
        /// <param name="pass">The pass.</param>
        /// <param name="isNotCertVerifiable">if set to <c>true</c> [is not cert verifiable].</param>
        /// <param name="privateKeyFile">If private key file is required. This is the path</param>
        /// <returns></returns>
        public static IActivityIOPath CreatePathFromString(string path, string user, string pass, bool isNotCertVerifiable, string privateKeyFile = "")
        {
            VerifyArgument.IsNotNull("path", path);
            // Fetch path type
            enActivityIOPathType type = Dev2ActivityIOPathUtils.ExtractPathType(path);

            if (type == enActivityIOPathType.Invalid)
            {
                // Default to file system
                type = enActivityIOPathType.FileSystem;
                if (!Path.IsPathRooted(path))
                {
                    throw  new IOException("Invalid Path. Please insure that the path provided is an absolute path, if you intended to access the local file system.");
                }
            }

            return(new Dev2ActivityIOPath(type, path, user, pass, isNotCertVerifiable, privateKeyFile));
        }