Class URLFileUpdater
- java.lang.Object
-
- com.dtolabs.rundeck.core.common.impl.URLFileUpdater
-
- All Implemented Interfaces:
FileUpdater
public class URLFileUpdater extends java.lang.Object implements FileUpdater
URLUpdater updates a file by getting the contents of a url, with optional caching, and mime type accept header.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
URLFileUpdater.Factory
Factory for constructing URLFileUpdater with basic settings
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CONTENT_TYPE
static int
DEFAULT_TIMEOUT
static java.lang.String
E_TAG
static URLFileUpdater.Factory
FACTORY
static java.lang.String
IF_MODIFIED_SINCE
static java.lang.String
IF_NONE_MATCH
static java.lang.String
LAST_MODIFIED
-
Constructor Summary
Constructors Constructor Description URLFileUpdater(java.net.URL url, java.lang.String acceptHeader, int timeout, java.io.File cacheMetadataFile, java.io.File cachedContent, boolean useCaching, java.lang.String username, java.lang.String password)
Create a URLUpdater
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static URLFileUpdaterFactory
factory()
java.lang.String
getContentType()
java.lang.String
getReasonCode()
int
getResultCode()
void
updateFile(java.io.File destinationFile)
Update the destination file.
-
-
-
Field Detail
-
CONTENT_TYPE
public static final java.lang.String CONTENT_TYPE
- See Also:
- Constant Field Values
-
E_TAG
public static final java.lang.String E_TAG
- See Also:
- Constant Field Values
-
IF_NONE_MATCH
public static final java.lang.String IF_NONE_MATCH
- See Also:
- Constant Field Values
-
LAST_MODIFIED
public static final java.lang.String LAST_MODIFIED
- See Also:
- Constant Field Values
-
IF_MODIFIED_SINCE
public static final java.lang.String IF_MODIFIED_SINCE
- See Also:
- Constant Field Values
-
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUT
- See Also:
- Constant Field Values
-
FACTORY
public static final URLFileUpdater.Factory FACTORY
-
-
Constructor Detail
-
URLFileUpdater
public URLFileUpdater(java.net.URL url, java.lang.String acceptHeader, int timeout, java.io.File cacheMetadataFile, java.io.File cachedContent, boolean useCaching, java.lang.String username, java.lang.String password)
Create a URLUpdater- Parameters:
url
- the URLacceptHeader
- contents of accept header, or nulltimeout
- in seconds, -1 means use the default timeout, and 0 means no timeoutcacheMetadataFile
- file to store cache metadatacachedContent
- file containing previously cached contentuseCaching
- true to use cachingusername
- usernamepassword
- password
-
-
Method Detail
-
factory
public static URLFileUpdaterFactory factory()
- Returns:
- a URLFileUpdaterFactory for constructing the FileUpdater
-
updateFile
public void updateFile(java.io.File destinationFile) throws FileUpdaterException
Description copied from interface:FileUpdater
Update the destination file.- Specified by:
updateFile
in interfaceFileUpdater
- Parameters:
destinationFile
- the file- Throws:
FileUpdaterException
- on error
-
getContentType
public java.lang.String getContentType()
-
getResultCode
public int getResultCode()
-
getReasonCode
public java.lang.String getReasonCode()
-
-