Package com.sun.javatest
Class ExcludeListUpdateHandler
java.lang.Object
com.sun.javatest.ExcludeListUpdateHandler
A class to handle downloading exclude lists from a server.
-
Constructor Summary
ConstructorsConstructorDescriptionExcludeListUpdateHandler
(URL remoteURL, File localFile) Create a handler for downloading exclude lists from a server. -
Method Summary
Modifier and TypeMethodDescriptionGet the file to which the exclude list should be written.long
Get the time that the local file was last modified.Get the URL from which the exclude list should be downloaded.long
Get the time that the remote URL was last modified.boolean
Determine if an update is available; this is determined by comparing the last modified times of the remote URL and the local file.void
update()
Update the local file with the exclude list given by the remote URL.void
Update the local file if the remote URL has been modified more recently than the local file.
-
Constructor Details
-
ExcludeListUpdateHandler
Create a handler for downloading exclude lists from a server.- Parameters:
remoteURL
- the URL from which the exclude list should be downloadedlocalFile
- the file to which the exclude list should be written
-
-
Method Details
-
getLocalFile
Get the file to which the exclude list should be written.- Returns:
- the file to which the exclude list should be written
-
getLocalFileLastModified
public long getLocalFileLastModified()Get the time that the local file was last modified.- Returns:
- the time the local file was last modified. The result is given in the standard way, in the number of seconds since January 1, 1970. The result may be -1 or if there was a problem determining the required information
-
getRemoteURL
Get the URL from which the exclude list should be downloaded.- Returns:
- the URL from which the exclude list should be downloaded
-
getRemoteURLLastModified
Get the time that the remote URL was last modified.- Returns:
- the time the remote URL was last modified The result is given in the standard way, in the number of seconds since January 1, 1970.
- Throws:
IOException
- if there is a problem determining the information.
-
isUpdateAvailable
Determine if an update is available; this is determined by comparing the last modified times of the remote URL and the local file.- Returns:
- true if the remote URL has been modified more recently than the local file.
- Throws:
IOException
- if there is a problem determining the result- See Also:
-
update
Update the local file with the exclude list given by the remote URL.- Throws:
IOException
- if there is a problem reading the exclude list
-
updateIfNewer
Update the local file if the remote URL has been modified more recently than the local file.- Throws:
IOException
- if there is a problem reading the exclude list
-