public final class SlidesMediaTypeDetector extends MediaTypeDetector
Provides the functionality to detect the media type of a presentation.
Supported formats:
.PPT | Microsoft PowerPoint Presentation |
.PPTX | Microsoft Office Open XML Presentation |
.PPS | Microsoft PowerPoint Slideshow |
.PPSX | Microsoft Office Open XML Auto-Play Presentation |
.ODP | OpenDocument presentation |
Detecting the media type of a presentation:
// Create a media type detector of a presentation
MediaTypeDetector detector = new SlidesMediaTypeDetector();
// Detect a media type
String mediaType = detector.detect(stream);
Constructor and Description |
---|
SlidesMediaTypeDetector()
Initializes a new instance of the
SlidesMediaTypeDetector class. |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkMediaType(String mediaType)
Detects whether the
mediaType is supported by the detector. |
protected String |
detectByContent(InputStream stream)
Detects the media type by the content of the
stream . |
protected String |
detectByExt(String ext)
Detects the media type by the
ext . |
detect, detect, supports
public SlidesMediaTypeDetector()
Initializes a new instance of the SlidesMediaTypeDetector
class.
protected String detectByContent(InputStream stream)
Detects the media type by the content of the stream
.
detectByContent
in class MediaTypeDetector
stream
- Stream of the document.protected String detectByExt(String ext)
Detects the media type by the ext
.
detectByExt
in class MediaTypeDetector
ext
- The extension of the file in the UPPER case.protected boolean checkMediaType(String mediaType)
Detects whether the mediaType
is supported by the detector.
checkMediaType
in class MediaTypeDetector
mediaType
- A string with media type in the UPPER case.Copyright © 2018. All rights reserved.