FileTypeDetector.ProbeContentType(IPath) Method

Definition

Probes the given file to guess its content type.

[Android.Runtime.Register("probeContentType", "(Ljava/nio/file/Path;)Ljava/lang/String;", "GetProbeContentType_Ljava_nio_file_Path_Handler", ApiSince=26)]
public abstract string? ProbeContentType (Java.Nio.FileNio.IPath? path);
[<Android.Runtime.Register("probeContentType", "(Ljava/nio/file/Path;)Ljava/lang/String;", "GetProbeContentType_Ljava_nio_file_Path_Handler", ApiSince=26)>]
abstract member ProbeContentType : Java.Nio.FileNio.IPath -> string

Parameters

path
IPath

the path to the file to probe

Returns

The content type or null if the file type is not recognized

Attributes

Remarks

Probes the given file to guess its content type.

The means by which this method determines the file type is highly implementation specific. It may simply examine the file name, it may use a file attribute, or it may examines bytes in the file.

The probe result is the string form of the value of a Multipurpose Internet Mail Extension (MIME) content type as defined by RFC&nbsp;2045: Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodieshttp://www.ietf.org/rfc/rfc2045.txt. The string must be parsable according to the grammar in the RFC 2045.

Java documentation for java.nio.file.spi.FileTypeDetector.probeContentType(java.nio.file.Path).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to