Exemplo n.º 1
0
        IFileInfo[] GetFiles()
        {
            IDirectoryContents dir = packageProvider.FileProvider.GetDirectoryContents(null);

            IFileInfo[] files = dir.ToArray();

            // Convert package entries to package file infos
            for (int i = 0; i < files.Length; i++)
            {
                // Get file reference
                string filename = files[i].Name;
                // Match to package file extensions (e.g. *.zip)
                Match match = packageProvider.Pattern.Match(filename);
                // Don't replace
                if (!match.Success)
                {
                    continue;
                }
                // Convert path to structured format
                PackageFileReference fileReference = new PackageFileReference(filename, match.Success, null, filename);
                // Create file entry
                PackageFileInfo newFileInfo = new PackageFileInfo(packageProvider, fileReference);
                newFileInfo.filename = filename;
                // Set new entry
                files[i] = newFileInfo;
            }
            return(files);
        }