|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.cvsgrab.CvsWebInterface
public abstract class CvsWebInterface
Abstracts the web interface available for a CVS repository. This allows us to support different web interfaces such as viewcvs, cvsweb, sourcecast and others.
Field Summary | |
---|---|
static String |
DETECTED_WEB_INTERFACE
|
Constructor Summary | |
---|---|
CvsWebInterface(CVSGrab grabber)
Constructor for CvsWebInterface |
Method Summary | |
---|---|
abstract void |
detect(Document htmlPage)
Detects if the web page is compatible with this web interface, and if yes initialize it. |
static CvsWebInterface |
findInterface(CVSGrab grabber)
Find the cvs web interface that could have generated this html page |
String |
getAltBaseUrl()
|
abstract String |
getBaseUrl()
|
static String[] |
getBaseUrls(CVSGrab grabber)
|
abstract String[] |
getDirectories(Document doc)
|
abstract String |
getDirectoryUrl(String rootUrl,
String directoryName)
|
abstract String |
getDownloadUrl(RemoteFile file)
|
abstract RemoteFile[] |
getFiles(Document doc)
|
CVSGrab |
getGrabber()
|
abstract String |
getId()
|
static CvsWebInterface |
getInterface(CVSGrab grabber,
String interfaceId)
Explicitely select a web interface capable of handle the web pages. |
static String[] |
getInterfaceIds(CVSGrab grabber)
|
String |
getQueryParams()
|
abstract String |
getType()
|
String |
getVersionTag()
|
static Properties |
getWebProperties(CVSGrab grabber,
String rootUrl)
Guess the connection properties by parsing the full url used when connecting to the web repository |
abstract Properties |
guessWebProperties(String fullUrl)
Guess the web properties frmo the full url |
abstract void |
init()
Initialize the web interface |
boolean |
presetMatch(String rootUrl,
String packagePath)
Returns true if there is a rule that matches this web interface to the given url |
static void |
registerDocument(String url,
Document doc)
For test purposes |
void |
setQueryParams(String params)
Sets the additional query parameters |
void |
setVersionTag(String versionTag)
Sets the version tag |
boolean |
validate(List errors)
Validate that this web interface can be used on the remote repository |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DETECTED_WEB_INTERFACE
Constructor Detail |
---|
public CvsWebInterface(CVSGrab grabber)
Method Detail |
---|
public static final CvsWebInterface getInterface(CVSGrab grabber, String interfaceId) throws Exception
grabber
- The cvs grabberinterfaceId
- The id of the interface
Exception
- if initialisation of the web interface failspublic static final String[] getInterfaceIds(CVSGrab grabber)
public static final String[] getBaseUrls(CVSGrab grabber)
public static CvsWebInterface findInterface(CVSGrab grabber) throws Exception
Exception
public static Properties getWebProperties(CVSGrab grabber, String rootUrl)
rootUrl
- the rool url
public static void registerDocument(String url, Document doc)
public CVSGrab getGrabber()
public boolean presetMatch(String rootUrl, String packagePath)
rootUrl
- The root urlpackagePath
- The package pathpublic boolean validate(List errors)
errors
- A list of errors to fill if any error is found
public String getVersionTag()
public void setVersionTag(String versionTag)
versionTag
- public String getQueryParams()
public void setQueryParams(String params)
params
- public abstract void init() throws Exception
Exception
- if initialisation failspublic abstract void detect(Document htmlPage) throws MarkerNotFoundException, InvalidVersionException
htmlPage
- The web page
MarkerNotFoundException
- if the version marker for the web interface was not found.
InvalidVersionException
- if the version detected is incompatible with the version supported by this web interface.
IncompatibleInterfaceException
- if the web page is not compatible with this type of web interfacepublic abstract String getId()
public abstract String getType()
public abstract String getBaseUrl()
public String getAltBaseUrl()
public abstract String getDirectoryUrl(String rootUrl, String directoryName)
rootUrl
- directoryName
-
public abstract RemoteFile[] getFiles(Document doc)
doc
-
public abstract String[] getDirectories(Document doc)
doc
-
public abstract String getDownloadUrl(RemoteFile file)
file
-
public abstract Properties guessWebProperties(String fullUrl)
fullUrl
- the full url
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |