|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream java.io.FilterInputStream hudson.plugins.testcomplete.mht.MHTInputStream
public class MHTInputStream
Utility class to read MHT
files produced by TestComplete and
inspired by inspired by ZipInputStream
. This class could also process
(though not tested) MHT files produced by other programs.
Field Summary |
---|
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
MHTInputStream(InputStream in)
Creates a new MHT input stream and reads the header of the MHT so getBaseUrl() can be called immediately. |
Method Summary | |
---|---|
int |
available()
Returns 0 after EOF has reached for the current entry data, otherwise always return 1. |
void |
close()
|
String |
getBaseUrl()
Returns the URL all MHT entries are referenced to. |
MHTEntry |
getNextEntry()
Returns the next MHTEntry in the stream and positions the stream
at the beginning of the entry data. |
MHTEntry |
getNextEntry(String name)
Reads the next MHT entry with the name given and positions the stream at the beginning of the entry data. |
void |
mark(int readlimit)
This operation is not supported with this input stream and UnsupportedOperationException will be thrown if this method is
called. |
boolean |
markSupported()
|
int |
read(byte[] b,
int off,
int len)
Reads from the current MHT entry into an array of bytes. |
void |
reset()
This operation is not supported with this input stream and UnsupportedOperationException will be thrown if this method is
called. |
long |
skip(long n)
This operation is not supported with this input stream and UnsupportedOperationException will be thrown if this method is
called. |
Methods inherited from class java.io.FilterInputStream |
---|
read, read |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MHTInputStream(InputStream in) throws MHTException
getBaseUrl()
can be called immediately.
in
- the actual input stream
MHTException
- if a MHT error has occurredMethod Detail |
---|
public String getBaseUrl()
public MHTEntry getNextEntry(String name) throws IOException
null
is returned and the stream is positioned at EOF.getBaseUrl()
). E.g.
If an entry has an internal URL http://localhost/index.html and
base URL of the stream is http://localhost/ then index.html
is the name of the entry. null
next entry in stream is read.
name
- the name of the entry to read or null
following
entry is desired
null
if no entry is found with the name
provided
IOException
- if an I/O error has occurred
MHTException
- if a MHT error has occurredpublic MHTEntry getNextEntry() throws IOException
MHTEntry
in the stream and positions the stream
at the beginning of the entry data. This is equivalent to calling
getNextEntry(String)
with null
name.
null
if no more entries are available.
IOException
- if an I/O error has occurred
MHTException
- if a MHT error has occurredpublic int available() throws IOException
available
in class FilterInputStream
IOException
- if an I/O error has occurredpublic long skip(long n) throws IOException
UnsupportedOperationException
will be thrown if this method is
called.
skip
in class FilterInputStream
UnsupportedOperationException
- if called
IOException
public boolean markSupported()
markSupported
in class FilterInputStream
public void mark(int readlimit)
UnsupportedOperationException
will be thrown if this method is
called.
mark
in class FilterInputStream
UnsupportedOperationException
- if calledpublic void reset() throws IOException
UnsupportedOperationException
will be thrown if this method is
called.
reset
in class FilterInputStream
UnsupportedOperationException
- if called
IOException
public void close() throws IOException
close
in interface Closeable
close
in class FilterInputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class FilterInputStream
b
- the buffer into which the data is readoff
- the start offset in the destination array blen
- the maximum number of bytes read
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |