com.pegacat.vcf.data
Class WebLoader
java.lang.Object
|
+--com.pegacat.vcf.data.Loader
|
+--com.pegacat.vcf.data.WebLoader
- public class WebLoader
- extends Loader
Constructor Summary |
WebLoader(java.net.URL server,
int gameNumber,
java.lang.String user,
java.lang.String password)
|
Method Summary |
protected void |
checkCookie(java.net.URLConnection con)
|
void |
connectToServer(java.net.URL server,
int gameNumber,
java.lang.String user,
java.lang.String password)
|
VoyagerText |
getFile(java.lang.String fileName)
This method is inherited by WebLoader and OfflineLoader
(and conceivably other loaders) to provide
their own way of getting the text file data... |
protected java.lang.String |
getPage(java.net.URL page)
Reads the given web page (using a cookie if required), returning the contents as a string. |
protected java.lang.String |
getPage(java.net.URL page,
java.lang.String data)
Reads the given web page (using a cookie if required), returning the contents as a string. |
Star[] |
getStars()
This method is inherited by WebLoader and OfflineLoader
to get and parse the star list. |
void |
loadFinished(DataLayer data)
This method can be extended to run any extra processing required when
a 'loadAll()' method has completed successfully. |
protected void |
parseReport()
obsolete ? |
protected java.lang.String |
readData(java.net.URLConnection con)
|
void |
registerCacheLoader(Loader CacheLoader)
|
protected void |
writeData(java.lang.String data,
java.net.URLConnection con)
|
Methods inherited from class com.pegacat.vcf.data.Loader |
getAllSurveys, getAllTech, getCargoReport, getCurrentTurnNo, getNewSurveys, getNewTech, getObjectTree, getPopSurveys, getRaceDesc, getRawStars, getReport, getStars, getSummary, loadAll, nextInt, saveAll, setWatcher |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
error
public boolean error
debug
public static boolean debug
WebLoader
public WebLoader(java.net.URL server,
int gameNumber,
java.lang.String user,
java.lang.String password)
connectToServer
public void connectToServer(java.net.URL server,
int gameNumber,
java.lang.String user,
java.lang.String password)
throws java.net.ProtocolException
getPage
protected java.lang.String getPage(java.net.URL page)
throws java.net.ProtocolException
- Reads the given web page (using a cookie if required), returning the contents as a string.
getPage
protected java.lang.String getPage(java.net.URL page,
java.lang.String data)
throws java.net.ProtocolException
- Reads the given web page (using a cookie if required), returning the contents as a string.
Passes any data as a POST request.
writeData
protected void writeData(java.lang.String data,
java.net.URLConnection con)
throws java.io.IOException
readData
protected java.lang.String readData(java.net.URLConnection con)
throws java.io.IOException
checkCookie
protected void checkCookie(java.net.URLConnection con)
parseReport
protected void parseReport()
throws java.net.MalformedURLException,
java.net.ProtocolException
- obsolete ?
getFile
public VoyagerText getFile(java.lang.String fileName)
- Description copied from class:
Loader
- This method is inherited by WebLoader and OfflineLoader
(and conceivably other loaders) to provide
their own way of getting the text file data...
- Overrides:
getFile
in class Loader
getStars
public Star[] getStars()
- Description copied from class:
Loader
- This method is inherited by WebLoader and OfflineLoader
to get and parse the star list.
- Overrides:
getStars
in class Loader
registerCacheLoader
public void registerCacheLoader(Loader CacheLoader)
loadFinished
public void loadFinished(DataLayer data)
- Description copied from class:
Loader
- This method can be extended to run any extra processing required when
a 'loadAll()' method has completed successfully.
- Overrides:
loadFinished
in class Loader