/// <summary> /// Create the appropriate file destination for the specified settings profile and initial path /// </summary> /// <param name="settings"></param> /// <param name="initialPath"></param> /// <returns></returns> public static FileDestination CreateFileDestination(WebPublishSettings settings, string initialPath) { DestinationProfile destProfile = settings.Destination.Profile; if (destProfile.Type == DestinationProfile.DestType.WINDOWS) { return new LocalFileSystemDestination(initialPath); } else { return new WinInetFTPFileDestination(destProfile.FtpServer, initialPath, destProfile.UserName, destProfile.Password); } }
/// <summary> /// Create the appropriate file destination for the specified settings profile and initial path /// </summary> /// <param name="settings"></param> /// <param name="initialPath"></param> /// <returns></returns> public static FileDestination CreateFileDestination(WebPublishSettings settings, string initialPath) { DestinationProfile destProfile = settings.Destination.Profile; if (destProfile.Type == DestinationProfile.DestType.WINDOWS) { return(new LocalFileSystemDestination(initialPath)); } else { return(new WinInetFTPFileDestination(destProfile.FtpServer, initialPath, destProfile.UserName, destProfile.Password)); } }
/// <summary> /// Creates a destination that points to the destination's root folder. /// </summary> /// <returns></returns> public static FileDestination CreateRootDestination(WebPublishSettings settings) { FileDestination dest; if (settings.Destination.Profile.Type == DestinationProfile.DestType.FTP) { if (settings.PublishRootPath.StartsWith("/", StringComparison.OrdinalIgnoreCase)) dest = CreateFileDestination(settings, "/"); else dest = CreateFileDestination(settings, ""); } else dest = CreateFileDestination(settings, ""); return dest; }
/// <summary> /// Creates a destination that points to the destination's root folder. /// </summary> /// <returns></returns> public static FileDestination CreateRootDestination(WebPublishSettings settings) { FileDestination dest; if (settings.Destination.Profile.Type == DestinationProfile.DestType.FTP) { if (settings.PublishRootPath.StartsWith("/", StringComparison.OrdinalIgnoreCase)) { dest = CreateFileDestination(settings, "/"); } else { dest = CreateFileDestination(settings, ""); } } else { dest = CreateFileDestination(settings, ""); } return(dest); }