Exemple #1
0
        public CompressedFileEntry GetEntryDetails(string entry)
        {
            ZipArchiveEntry     contents = _file.GetEntry(entry);
            CompressedFileEntry details  = new CompressedFileEntry();

            details.FileName    = contents.FullName;
            details.IsDirectory = contents.FullName.EndsWith("/");

            return(details);
        }
        public virtual List <string> GetOutputFileURLs()
        {
            CheckIfInitialised();

            List <string> urls = new List <string>();

            using (ICompressedConfigFile compressedFile = new ZipCompressedConfigFile(_configFile))
            {
                XmlNodeList files = _xmlDocument.SelectNodes("/export/outputfiles/file");
                foreach (XmlNode current in files)
                {
                    string from = current.Attributes["internal"] == null ? string.Empty : current.Attributes["internal"].Value;
                    string to   = current.Attributes["output"] == null ? string.Empty : current.Attributes["output"].Value;

                    if (string.IsNullOrEmpty(from) || string.IsNullOrEmpty(to))
                    {
                        continue;
                    }

                    if (compressedFile.HasEntry(from))
                    {
                        CompressedFileEntry details = compressedFile.GetEntryDetails(from);
                        if (details.IsDirectory)
                        {
                            urls.Add(details.FileName + "*.*");
                        }
                        else
                        {
                            urls.Add(details.FileName);
                        }
                    }
                }
            }

            return(urls);
        }