mirror of
https://github.com/ldqk/Masuit.Tools.git
synced 2026-10-27 11:16:34 +08:00
31 lines
963 B
C#
31 lines
963 B
C#
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using Masuit.Tools.Mime;
|
|
|
|
namespace Masuit.Tools.Files.FileDetector.Detectors;
|
|
|
|
[FormatCategory(FormatCategory.Document)]
|
|
internal sealed class DOCXDetector : AbstractZipDetailDetector
|
|
{
|
|
public override IEnumerable<string> Files
|
|
{
|
|
get
|
|
{
|
|
yield return "[Content_Types].xml";
|
|
yield return "_rels/.rels";
|
|
yield return "word/_rels/document.xml.rels";
|
|
}
|
|
}
|
|
|
|
public override string Precondition => "zip";
|
|
|
|
public override string Extension => "docx";
|
|
|
|
public override string MimeType => new MimeMapper().GetMimeFromExtension("." + Extension);
|
|
|
|
public override List<FormatCategory> FormatCategories => GetType().GetCustomAttributes<FormatCategoryAttribute>().Select(a => a.Category).ToList();
|
|
|
|
public override string ToString() => "Microsoft Word Open XML Document(DOCX) Detector";
|
|
} |