Package io.wcm.devops.conga.generator
Class UrlFileManager
java.lang.Object
io.wcm.devops.conga.generator.UrlFileManager
Manages copy/download of external files referenced in CONGA roles by URL, filesystem, classpath or Maven coordinates.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteFile(String url) Delete file with given URL.Get file binary data from URL.getFileName(String url) Get file name from URL.getFileUrl(String url) Get URL to to binary file.Get URLs of transitive dependencies of external file.getLocalFile(String url) Get local file reference to given URL.booleanisLocalFile(String url) Checks if the given file is a file from the local file system and can be safely referenced via symlink.
-
Constructor Details
-
UrlFileManager
- Parameters:
pluginManager- Plugin managercontext- URL file plugin context
-
-
Method Details
-
getFileName
Get file name from URL.- Parameters:
url- URL string- Returns:
- File name
- Throws:
IOException- I/O exception
-
getFile
Get file binary data from URL.- Parameters:
url- URL string- Returns:
- Input stream
- Throws:
IOException- I/O exception
-
getFileUrl
Get URL to to binary file.- Parameters:
url- URL string- Returns:
- URL
- Throws:
IOException- I/O exception
-
getFileUrlsWithDependencies
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)- Returns:
- URLs to files
- Throws:
IOException- If the access to the file failed
-
deleteFile
Delete file with given URL. This is only supported for files in the local filesystem.- Parameters:
url- URL string- Throws:
IOException- I/O exception
-
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)- 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)- Returns:
- Local file reference.
- Throws:
IOException- If the access to the file failed
-