public class ContentTypeDetector
extends java.lang.Object
Modifier and Type | Field | 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 | Description |
---|---|
ContentTypeDetector(java.io.InputStream in) |
Creates a new detector based on the given input.
|
Modifier and Type | Method | Description |
---|---|---|
java.io.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(java.io.InputStream in) throws java.io.IOException
getInputStream()
.in
- input to read the header fromjava.io.IOException
- if the stream can't be readpublic java.io.InputStream getInputStream()
public int getType()
Copyright © 2018. All rights reserved.