public class ContentTypeDetector extends Object
Modifier and Type | Field and Description |
---|---|
static int |
CLASSFILE
File type Java class
|
static int |
GZFILE
File type GZIP compressed Data
|
static int |
PACK200FILE
File type Pack200 archive
|
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 static final int GZFILE
public static final int PACK200FILE
public ContentTypeDetector(InputStream in) throws IOException
getInputStream()
.in
- input to read the header fromIOException
- if the stream can't be readpublic InputStream getInputStream()
public int getType()
Copyright © 2015. All rights reserved.