public class ResourceTypeDetector extends Object
Utility static methods for detecting resource types (formats)
Constructor and Description |
---|
ResourceTypeDetector() |
Modifier and Type | Method and Description |
---|---|
static IResourceType |
detectTypeFromFilename(String filename)
Detects a type from specified filename and returns an instance of
respective IResourceType
|
static IHtmlResource |
tryDetectResource(InputStream inputResourceStream,
String name,
IResourceType assumptiveFormat)
Tries to analyze an input stream and creates one of supportable HTML
resources from it, taking into account a specified assumptive type, if it
is not null
|
static IHtmlResource |
tryDetectResourceInternal(com.aspose.ms.System.IO.Stream inputResourceStream,
String name,
IResourceType assumptiveFormat) |
public static IResourceType detectTypeFromFilename(String filename)
Detects a type from specified filename and returns an instance of respective IResourceType
filename
- Input filename, from which this method will try to
extract the resultant IResourceType implementationpublic static IHtmlResource tryDetectResource(InputStream inputResourceStream, String name, IResourceType assumptiveFormat)
Tries to analyze an input stream and creates one of supportable HTML resources from it, taking into account a specified assumptive type, if it is not null
inputResourceStream
- Input stream, which presumably contains an
HTML resource. If invalid, an exception will be thrown.name
- Resource name, which will be used for created and returned
resource on success. Cannot be NULL, empty or whitespaceassumptiveFormat
- Assumed format of the input HTML resource, which
is useful for achieving the best performance. If completely unknown, use
the NULL value. May be incorrect, this will only worsen the performance.public static IHtmlResource tryDetectResourceInternal(com.aspose.ms.System.IO.Stream inputResourceStream, String name, IResourceType assumptiveFormat)