FileFormatUtil

Inheritance: java.lang.Object

public class FileFormatUtil

Provides utility methods to detect file type.

Constructors

Constructor Description
FileFormatUtil()

Methods

Method Description
detectFileFormat(InputStream stream) Detects and returns the information about a format of a file stored in a stream.
detectFileFormat(String filePath) Detects and returns the information about a format of a file.

FileFormatUtil()

public FileFormatUtil()

detectFileFormat(InputStream stream)

public static FileFormatInfo detectFileFormat(InputStream stream)

Detects and returns the information about a format of a file stored in a stream.

Parameters:

Parameter Type Description
stream java.io.InputStream Source stream.

Returns: FileFormatInfo - The result FileFormatInfo

detectFileFormat(String filePath)

public static FileFormatInfo detectFileFormat(String filePath)

Detects and returns the information about a format of a file.

Parameters:

Parameter Type Description
filePath java.lang.String Path to the source file.

Returns: FileFormatInfo - The result FileFormatInfo