com.dtolabs.rundeck.core.common.impl
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.
Constructor Summary |
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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
- username
- password
-
setInteraction
public void setInteraction(URLFileUpdater.httpClientInteraction interaction)
factory
public static URLFileUpdaterFactory factory()
- Return 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 interface FileUpdater
- Throws:
FileUpdaterException
getContentType
public java.lang.String getContentType()
getResultCode
public int getResultCode()
getReasonCode
public java.lang.String getReasonCode()