Skip to content

Consider detecting file type by mime type instead of extension #7

@deeplow

Description

@deeplow

As it stands, the plugin decides on the file based the extension, which I believe happens in the following lines

if (inputFile.endsWith(".hwp")) {
hType = HanType.HWP;
hwp = new HwpFile(inputFile);
} else if (inputFile.endsWith(".hwpx")) {
hType = HanType.HWPX;
hwpx = new HwpxFile(inputFile);
}

However, on Linux systems, generally the file extension doesn't matter much and ideally the file can still be detected based on the mime type.

Would it be possible to use mime types instead of the extensions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions