Interface UrlFilePlugin
- All Superinterfaces:
Plugin
- All Known Implementing Classes:
ClasspathUrlFilePlugin,FilesystemUrlFilePlugin,HttpUrlFilePlugin
Get files from external sources.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepts(String url, UrlFilePluginContext context) Checks if the plugin can be applied to the given URL.default voiddeleteFile(String url, UrlFilePluginContext context) Delete file with given URL.getFile(String url, UrlFilePluginContext context) Get binary data of external file.getFileName(String url, UrlFilePluginContext context) Get filename for external file.default URLgetFileUrl(String url, UrlFilePluginContext context) Get URL to external file.getFileUrlsWithDependencies(String url, UrlFilePluginContext context) Get URLs of transitive dependencies of external file.default FilegetLocalFile(String url, UrlFilePluginContext context) Get local file reference to given URL.default booleanisLocalFile(String url, UrlFilePluginContext context) Checks if the given file is a file from the local file system and can be safely referenced via symlink.
-
Method Details
-
accepts
Checks if the plugin can be applied to the given URL.- Parameters:
url- URL string (including prefix)context- Context objects- Returns:
- true when the plugin can be applied to the given URL.
-
getFileName
Get filename for external file.- Parameters:
url- URL string (including prefix)context- Context objects- Returns:
- Filename
- Throws:
IOException- I/O exception
-
getFile
Get binary data of external file.- Parameters:
url- URL string (including prefix)context- Context objects- Returns:
- Binary data
- Throws:
IOException- If the access to the file failed
-
getFileUrl
Get URL to external file.- Parameters:
url- URL string (including prefix)context- Context objects- Returns:
- URL to file
- Throws:
IOException- If the access to the file failed
-
getFileUrlsWithDependencies
default List<URL> getFileUrlsWithDependencies(String url, UrlFilePluginContext context) throws IOException Get URLs of transitive dependencies of external file. This usually applies only to Maven artifacts. The returned list includes the URL of the artifact itself, and all it's transitive dependencies.- Parameters:
url- URL string (including prefix)context- Context objects- Returns:
- URLs to files
- Throws:
IOException- If the access to the file failed
-
deleteFile
Delete file with given URL. This is only supported by few implementations of this interface - all other throw anUnsupportedOperationException.- Parameters:
url- URL string (including prefix)context- Context objects- Throws:
IOException- If deleting the file is supported but failes for some reason
-
isLocalFile
Checks if the given file is a file from the local file system and can be safely referenced via symlink.- Parameters:
url- URL string (including prefix)context- Context objects- Returns:
- true if file is a local file
- Throws:
IOException- If the access to the file failed
-
getLocalFile
Get local file reference to given URL.- Parameters:
url- URL string (including prefix)context- Context objects- Returns:
- Local file reference.
- Throws:
IOException- If the access to the file failed
-