Class HttpUrlFilePlugin
- java.lang.Object
-
- io.wcm.devops.conga.generator.plugins.urlfile.HttpUrlFilePlugin
-
- All Implemented Interfaces:
Plugin
,UrlFilePlugin
public class HttpUrlFilePlugin extends Object implements UrlFilePlugin
Download files from HTTP or HTTPS URL.
-
-
Constructor Summary
Constructors Constructor Description HttpUrlFilePlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accepts(String url, UrlFilePluginContext context)
Checks if the plugin can be applied to the given URL.InputStream
getFile(String url, UrlFilePluginContext context)
Get binary data of external file.String
getFileName(String url, UrlFilePluginContext context)
Get filename for external file.URL
getFileUrl(String url, UrlFilePluginContext context)
Get URL to external file.String
getName()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.wcm.devops.conga.generator.spi.UrlFilePlugin
deleteFile, getFileUrlsWithDependencies, getLocalFile, isLocalFile
-
-
-
-
Field Detail
-
NAME
public static final String NAME
Plugin name- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public String getName()
-
accepts
public boolean accepts(String url, UrlFilePluginContext context)
Description copied from interface:UrlFilePlugin
Checks if the plugin can be applied to the given URL.- Specified by:
accepts
in interfaceUrlFilePlugin
- Parameters:
url
- URL string (including prefix)context
- Context objects- Returns:
- true when the plugin can be applied to the given URL.
-
getFileName
public String getFileName(String url, UrlFilePluginContext context)
Description copied from interface:UrlFilePlugin
Get filename for external file.- Specified by:
getFileName
in interfaceUrlFilePlugin
- Parameters:
url
- URL string (including prefix)context
- Context objects- Returns:
- Filename
-
getFile
public InputStream getFile(String url, UrlFilePluginContext context) throws IOException
Description copied from interface:UrlFilePlugin
Get binary data of external file.- Specified by:
getFile
in interfaceUrlFilePlugin
- Parameters:
url
- URL string (including prefix)context
- Context objects- Returns:
- Binary data
- Throws:
IOException
- If the access to the file failed
-
getFileUrl
public URL getFileUrl(String url, UrlFilePluginContext context) throws IOException
Description copied from interface:UrlFilePlugin
Get URL to external file.- Specified by:
getFileUrl
in interfaceUrlFilePlugin
- Parameters:
url
- URL string (including prefix)context
- Context objects- Returns:
- URL to file
- Throws:
IOException
- If the access to the file failed
-
-