public static FlashCookie FromPath(String path, String url) { Cookie metaData = new FlashCookie(); IDictionary <string, string> parsedPath = PathParser.ParseSolFilePath(path); // add error checking metaData.RetrievedFrom = url; metaData.Type = "flash"; metaData.Domain = parsedPath["subdomain"] + parsedPath["domain"]; metaData.Path = parsedPath["url"]; metaData.Name = parsedPath["name"]; FileInfo file = new FileInfo(path); metaData.DateCreated = file.CreationTime.Ticks; return((FlashCookie)metaData); }
CookieJar ICookieRetriever.GetCookies(string url) { if (!Directory.Exists(flashDirectory)) { return(new CookieJar()); } var pathList = Directory.EnumerateFiles(flashDirectory, "*", SearchOption.AllDirectories) .Where(f => f.EndsWith(".sol")); CookieJar jar = new CookieJar(); foreach (String p in pathList) { System.Diagnostics.Debug.WriteLine(FlashCookie.FromPath(p, url).ToCSVRow()); jar.Add(FlashCookie.FromPath(p, url)); } return(jar); }