IEntryFactory.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System.Net.ApiService.Compression.Core;
  2. namespace System.Net.ApiService.Compression.Zip {
  3. /// <summary>
  4. /// Defines factory methods for creating new <see cref="ZipEntry"></see> values.
  5. /// </summary>
  6. public interface IEntryFactory
  7. {
  8. /// <summary>
  9. /// Create a <see cref="ZipEntry"/> for a file given its name
  10. /// </summary>
  11. /// <param name="fileName">The name of the file to create an entry for.</param>
  12. /// <returns>Returns a <see cref="ZipEntry">file entry</see> based on the <paramref name="fileName"/> passed.</returns>
  13. ZipEntry MakeFileEntry(string fileName);
  14. /// <summary>
  15. /// Create a <see cref="ZipEntry"/> for a file given its name
  16. /// </summary>
  17. /// <param name="fileName">The name of the file to create an entry for.</param>
  18. /// <param name="useFileSystem">If true get details from the file system if the file exists.</param>
  19. /// <returns>Returns a <see cref="ZipEntry">file entry</see> based on the <paramref name="fileName"/> passed.</returns>
  20. ZipEntry MakeFileEntry(string fileName, bool useFileSystem);
  21. /// <summary>
  22. /// Create a <see cref="ZipEntry"/> for a file given its actual name and optional override name
  23. /// </summary>
  24. /// <param name="fileName">The name of the file to create an entry for.</param>
  25. /// <param name="entryName">An alternative name to be used for the new entry. Null if not applicable.</param>
  26. /// <param name="useFileSystem">If true get details from the file system if the file exists.</param>
  27. /// <returns>Returns a <see cref="ZipEntry">file entry</see> based on the <paramref name="fileName"/> passed.</returns>
  28. ZipEntry MakeFileEntry(string fileName, string entryName, bool useFileSystem);
  29. /// <summary>
  30. /// Create a <see cref="ZipEntry"/> for a directory given its name
  31. /// </summary>
  32. /// <param name="directoryName">The name of the directory to create an entry for.</param>
  33. /// <returns>Returns a <see cref="ZipEntry">directory entry</see> based on the <paramref name="directoryName"/> passed.</returns>
  34. ZipEntry MakeDirectoryEntry(string directoryName);
  35. /// <summary>
  36. /// Create a <see cref="ZipEntry"/> for a directory given its name
  37. /// </summary>
  38. /// <param name="directoryName">The name of the directory to create an entry for.</param>
  39. /// <param name="useFileSystem">If true get details from the file system for this directory if it exists.</param>
  40. /// <returns>Returns a <see cref="ZipEntry">directory entry</see> based on the <paramref name="directoryName"/> passed.</returns>
  41. ZipEntry MakeDirectoryEntry(string directoryName, bool useFileSystem);
  42. /// <summary>
  43. /// Get/set the <see cref="INameTransform"></see> applicable.
  44. /// </summary>
  45. INameTransform NameTransform { get; set; }
  46. }
  47. }