public class ContentTypeDetector extends Object
Modifier and Type | Field and Description |
---|---|
static int |
CLASSFILE
File type Java class
|
static int |
UNKNOWN
Unknown file type
|
static int |
ZIPFILE
File type ZIP archive
|
Constructor and Description |
---|
ContentTypeDetector(InputStream in)
Creates a new detector based on the given input.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
getInputStream()
Returns an input stream instance to read the complete content (including
the header) of the underlying stream.
|
int |
getType()
Returns the detected file type.
|
public static final int UNKNOWN
public static final int CLASSFILE
public static final int ZIPFILE
public ContentTypeDetector(InputStream in) throws IOException
getInputStream()
.in
- input to read the header fromIOException
public InputStream getInputStream()
public int getType()
Copyright © 2012. All Rights Reserved.