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 classURLFileUpdater.FactoryFactory for constructing URLFileUpdater with basic settings
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONTENT_TYPEstatic intDEFAULT_TIMEOUTstatic java.lang.StringE_TAGstatic URLFileUpdater.FactoryFACTORYstatic java.lang.StringIF_MODIFIED_SINCEstatic java.lang.StringIF_NONE_MATCHstatic java.lang.StringLAST_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 URLFileUpdaterFactoryfactory()java.lang.StringgetContentType()java.lang.StringgetReasonCode()intgetResultCode()voidupdateFile(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 FileUpdaterExceptionDescription copied from interface:FileUpdaterUpdate the destination file.- Specified by:
updateFilein 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()
-
-