org.knuth.chkupdate.provider
Class SourceForgeProvider

java.lang.Object
  extended by org.knuth.chkupdate.Provider
      extended by org.knuth.chkupdate.provider.SourceForgeProvider

Deprecated.

public class SourceForgeProvider
extends Provider

A Provider which checks for a new version on SourceForge.

This Provider is marked "deprecated" because the SourceForge-API used to retrieve informations is "unmaintained". However, this Provider should work probably.

Author:
Lukas Knuth
See Also:
SourceForge-Webseite

Field Summary
private  java.lang.String BASE_URL
          Deprecated. The Base of the Request-URL
private  java.lang.String DATE_PATTERN
          Deprecated. Pattern used to parse the returned Date
private  java.lang.String GET_PROJECT_ID
          Deprecated. URL-Part to request the Project-ID
private  java.lang.String GET_RELEASES
          Deprecated. URL-Part to request the Release-list
private  int project_id
          Deprecated. The Projects ID on SourceForge
private  java.lang.String project_name
          Deprecated. The Projects name on SourceForge
 
Constructor Summary
SourceForgeProvider(int project_id)
          Deprecated. Creates a new Provider for SourceForge
SourceForgeProvider(java.lang.String project_name)
          Deprecated. Creates a new Provider for SourceForge
This constructor first querys the SourceForge-API to get the projects ID.
 
Method Summary
private  java.net.URL createFileReleaseUrl()
          Deprecated. Creates the request-URL to get the Projects latest file-releases.
private  java.net.URL createGetIdUrl()
          Deprecated. Creates the request-URL to get the Projects ID.
 UpdateResult doCheck()
          Deprecated. Performs the Update-Check.
 java.lang.String getName()
          Deprecated. Returns the Name of the Service used by this Provider
private  int getProjectID(java.lang.String project_name)
          Deprecated. Querys the SourceForge API to get the Projects ID from it's name.
private  java.util.Date latestFileRelease()
          Deprecated. Querys the SourceForge API to get the Date of the latest added file.
private  int parseProjectID(java.lang.String json)
          Deprecated. Parses the APIs JSON-Response to get the Projects ID (called by getProjectID(String)).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASE_URL

private final java.lang.String BASE_URL
Deprecated. 
The Base of the Request-URL

See Also:
Constant Field Values

GET_PROJECT_ID

private final java.lang.String GET_PROJECT_ID
Deprecated. 
URL-Part to request the Project-ID

See Also:
Constant Field Values

GET_RELEASES

private final java.lang.String GET_RELEASES
Deprecated. 
URL-Part to request the Release-list

See Also:
Constant Field Values

DATE_PATTERN

private final java.lang.String DATE_PATTERN
Deprecated. 
Pattern used to parse the returned Date

See Also:
Constant Field Values

project_name

private java.lang.String project_name
Deprecated. 
The Projects name on SourceForge


project_id

private int project_id
Deprecated. 
The Projects ID on SourceForge

Constructor Detail

SourceForgeProvider

public SourceForgeProvider(java.lang.String project_name)
Deprecated. 
Creates a new Provider for SourceForge
This constructor first querys the SourceForge-API to get the projects ID. Using the ID to create the Provider-Object might be faster (since it makes only one request to the API).

Parameters:
project_name - The name of the Project on SourceForge.

SourceForgeProvider

public SourceForgeProvider(int project_id)
Deprecated. 
Creates a new Provider for SourceForge

Parameters:
project_id - The Projects ID on SourceForge.
Method Detail

doCheck

public UpdateResult doCheck()
                     throws UpdateRequestException,
                            UpdateResponseException
Deprecated. 
Description copied from class: Provider
Performs the Update-Check.

Specified by:
doCheck in class Provider
Returns:
An "UpdateResult"-Object holding informations about the newest update.
Throws:
UpdateRequestException - Thrown when there was a problem requesting informations from the Provider.
UpdateResponseException - Thrown when there was a problem parsing the response from the Provider.

latestFileRelease

private java.util.Date latestFileRelease()
                                  throws UpdateRequestException,
                                         UpdateResponseException
Deprecated. 
Querys the SourceForge API to get the Date of the latest added file.

Returns:
The date of the latest added file as a "Date"-object.
Throws:
UpdateRequestException - Thrown when the SourceForge-API could not be reached.
UpdateResponseException - Thrown when the APIs response could not be parsed.

getProjectID

private int getProjectID(java.lang.String project_name)
                  throws UpdateRequestException
Deprecated. 
Querys the SourceForge API to get the Projects ID from it's name.

Parameters:
project_name - The projects name on SourceForge.
Returns:
The projects ID.
Throws:
UpdateRequestException - Thrown when the SourceForge-API could not be reached.

parseProjectID

private int parseProjectID(java.lang.String json)
                    throws UpdateRequestException
Deprecated. 
Parses the APIs JSON-Response to get the Projects ID (called by getProjectID(String)).

Parameters:
json - The JSON-String.
Returns:
The ID of the Project on SourceForge.
Throws:
UpdateRequestException - Thrown when SourceForge API could not be reached.
See Also:
getProjectID(String)

createFileReleaseUrl

private java.net.URL createFileReleaseUrl()
                                   throws java.net.MalformedURLException
Deprecated. 
Creates the request-URL to get the Projects latest file-releases.

Returns:
The "URL"-Object to query the SourceForge-API for the file-release list.
Throws:
java.net.MalformedURLException - Thrown when the URL could not be created.

createGetIdUrl

private java.net.URL createGetIdUrl()
                             throws java.net.MalformedURLException
Deprecated. 
Creates the request-URL to get the Projects ID.

Returns:
The "URL"-Object to query the SourceForge-API for the Projects ID.
Throws:
java.net.MalformedURLException - Thrown when the URL could not be created.

getName

public java.lang.String getName()
Deprecated. 
Description copied from class: Provider
Returns the Name of the Service used by this Provider

Specified by:
getName in class Provider
Returns:
The Service-Name