public static TestRepository CreateLocalRepository(string repositoryName) { string targetPath = Path.Combine(PathHelper.ZippedRepositoriesDir, repositoryName + ".zip"); // Get the path to the repository string zippedPath = PathHelper.GetPath(targetPath); // Unzip it ZipUtils.Unzip(zippedPath, PathHelper.LocalRepositoriesDir); return(new TestRepository(repositoryName)); }
public static TestRepository CreateLocalRepository(string repositoryName) { string targetPath = Path.Combine(PathHelper.ZippedRepositoriesDir, repositoryName + ".zip"); // Get the path to the repository string zippedPath = PathHelper.GetPath(targetPath); // Local repository path string localRepositoriesDir = Path.Combine(Path.GetDirectoryName(PathHelper.LocalRepositoriesDir), Path.GetRandomFileName()); PathHelper.EnsureDirectory(localRepositoriesDir); // Unzip it ZipUtils.Unzip(zippedPath, localRepositoriesDir); return(new TestRepository(Path.Combine(localRepositoriesDir, repositoryName))); }
public static XDocument GetServerProfile(string serviceUrl, string logsTempPath, string appName, NetworkCredential credentials = null) { var zippedLogsPath = Path.Combine(logsTempPath, appName + ".zip"); var unzippedLogsPath = Path.Combine(logsTempPath, appName); var profileLogPath = Path.Combine(unzippedLogsPath, "trace", "trace.xml"); XDocument document = null; DownloadDump(serviceUrl, zippedLogsPath, credentials); if (File.Exists(zippedLogsPath)) { ZipUtils.Unzip(zippedLogsPath, unzippedLogsPath); using (var stream = File.OpenRead(profileLogPath)) { document = XDocument.Load(stream); } } return(document); }