public class HTMLInputSource extends InputSource
Modifier and Type | Field and Description |
---|---|
protected static String |
ACCEPT_CHARSET |
protected static String |
ACCEPT_CONTENT |
protected static String |
ACCEPT_LANGUAGE |
protected static String |
CONTENT_CHARSET |
protected static String |
DEFAULT_ACCEPT_CHARSET |
protected static String |
DEFAULT_CONTENT_CHARSET |
protected boolean |
m_allowFilesystemAccess |
protected IAuthenticator |
m_authenticator |
protected InputStream |
m_byteStream |
protected Reader |
m_characterStream |
protected String |
m_encoding |
protected Locale |
m_locale |
protected String |
m_publicId |
protected String |
m_systemId |
protected static int |
PREPROCESS_LENGTH |
protected static int |
REDIRECT_LOOP |
Constructor and Description |
---|
HTMLInputSource() |
HTMLInputSource(String systemId) |
Modifier and Type | Method and Description |
---|---|
protected String |
calculateCharset(URLConnection conn,
String defaultCharset)
Calculates charset as specified by connection headers.
|
protected String |
calculateLanguage(URLConnection conn,
String defaultLang)
Calculates lang as specified by connection headers.
|
void |
close()
Convenience method to close whatever stream was used.
|
boolean |
getAllowFilesystemAccess() |
IAuthenticator |
getAuthenticator() |
InputStream |
getByteStream() |
protected InputStream |
getByteStream(int loop) |
Reader |
getCharacterStream() |
String |
getEncoding() |
Locale |
getLocale() |
String |
getPublicId() |
String |
getSystemId() |
protected String |
guessCharset(InputStream in,
String lang,
String defaultCharset)
Auto-dectect charset based on content.
|
protected String |
localizeMessage(String key) |
protected String |
localizeMessage(String key,
Object[] args) |
protected String |
localizeMessage(String bundleName,
String key,
Object[] args) |
void |
open()
Convenience method to open input source and set systemId and encoding properties.
|
void |
setAllowFilesystemAccess(boolean allowFilesystemAccess) |
void |
setAuthenticator(IAuthenticator authenticator) |
void |
setByteStream(InputStream byteStream) |
void |
setCharacterStream(Reader characterStream) |
void |
setEncoding(String encoding) |
void |
setLocale(Locale locale) |
void |
setPublicId(String publicId) |
void |
setSystemId(String systemId) |
protected static final String ACCEPT_CONTENT
protected static final String ACCEPT_CHARSET
protected static final String ACCEPT_LANGUAGE
protected static final String CONTENT_CHARSET
protected static final String DEFAULT_ACCEPT_CHARSET
protected static final String DEFAULT_CONTENT_CHARSET
protected static final int PREPROCESS_LENGTH
protected static final int REDIRECT_LOOP
protected String m_publicId
protected String m_systemId
protected String m_encoding
protected InputStream m_byteStream
protected Reader m_characterStream
protected boolean m_allowFilesystemAccess
protected Locale m_locale
protected IAuthenticator m_authenticator
public HTMLInputSource()
public HTMLInputSource(String systemId)
public void setPublicId(String publicId)
setPublicId
in class InputSource
public String getPublicId()
getPublicId
in class InputSource
public void setSystemId(String systemId)
setSystemId
in class InputSource
public String getSystemId()
getSystemId
in class InputSource
public void setEncoding(String encoding)
setEncoding
in class InputSource
public String getEncoding()
getEncoding
in class InputSource
public void setByteStream(InputStream byteStream)
setByteStream
in class InputSource
public InputStream getByteStream()
getByteStream
in class InputSource
public void setCharacterStream(Reader characterStream)
setCharacterStream
in class InputSource
public Reader getCharacterStream()
getCharacterStream
in class InputSource
public boolean getAllowFilesystemAccess()
public void setAllowFilesystemAccess(boolean allowFilesystemAccess)
public Locale getLocale()
public void setLocale(Locale locale)
public IAuthenticator getAuthenticator()
public void setAuthenticator(IAuthenticator authenticator)
public void open() throws IOException
IOException
public void close() throws IOException
IOException
protected InputStream getByteStream(int loop) throws IOException
IOException
protected String calculateLanguage(URLConnection conn, String defaultLang) throws IOException
IOException
protected String calculateCharset(URLConnection conn, String defaultCharset) throws IOException
IOException
protected String guessCharset(InputStream in, String lang, String defaultCharset) throws IOException
IOException