Class FileTypeDetector

java.lang.Object
org.sejda.sambox.util.filetypedetector.FileTypeDetector

public final class FileTypeDetector extends Object
Author:
Drew Noakes code taken from https://github.com/drewnoakes/metadata-extractor Examines the a file's first bytes and estimates the file's type.
  • Method Details

    • detectFileType

      public static FileType detectFileType(File file) throws IOException
      Examines the a file's first bytes and estimates the file's type.
      Parameters:
      file - to examine.
      Returns:
      the file type or null if it wasn't possible to determine by reading the first bytes
      Throws:
      IOException - if an IO error occurs.
    • detectFileType

      public static FileType detectFileType(org.sejda.io.SeekableSource source) throws IOException
      Throws:
      IOException