|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.landspurg.util.URLFetcher
public class URLFetcher
A class that is going to fetch a specific URL
and then, notify the the listner after each line
read, or when the complete URL has been loaded....
note: works for text only!
This is done asynchronously..
first, initiate the fetcher, and eventully setup the listener
and then call fetch to start...
example:
u=new URLFetcher("http://landspurg.net");
u.setListener(this);
u.fetch();
....
| Field Summary | |
|---|---|
java.lang.StringBuffer |
m_res
|
| Constructor Summary | |
|---|---|
URLFetcher(java.lang.String in_url)
Set the URL to fetch... |
|
| Method Summary | |
|---|---|
static java.lang.String |
encode64(byte[] data)
|
static java.lang.StringBuffer |
encode64(byte[] data,
int start,
int len,
java.lang.StringBuffer buf)
Encodes the part of the given byte array denoted by start and len to the Base64 format. |
static java.lang.String |
encode64(java.lang.String str)
|
void |
fetch()
Fetch the data effectivily. |
void |
run()
|
void |
setListener(NotifyLoadURL inRef)
Set the listener to be called when an event happens during the download... |
void |
setMethod(java.lang.String inMethod)
|
void |
setUserNamePassword(java.lang.String inUsername,
java.lang.String inPassword)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.lang.StringBuffer m_res
| Constructor Detail |
|---|
public URLFetcher(java.lang.String in_url)
in_url - | Method Detail |
|---|
public void setMethod(java.lang.String inMethod)
public void setUserNamePassword(java.lang.String inUsername,
java.lang.String inPassword)
public void fetch()
public void setListener(NotifyLoadURL inRef)
inRef - public void run()
run in interface java.lang.Runnablepublic static java.lang.String encode64(byte[] data)
public static java.lang.String encode64(java.lang.String str)
public static java.lang.StringBuffer encode64(byte[] data,
int start,
int len,
java.lang.StringBuffer buf)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||