Fix throwing NullPointerException when getting a fileName with a query param.

Nipuni Kavindya 5 days ago
parent ed9ade859e
commit 1174d9a97d

@ -135,14 +135,12 @@ public class FileDownloaderServiceProvider {
* Extracts file name segments (name and extension) by parsing the given URL.
* <p>
* This method handles two types of URL formats:
* <ul>
* <li>If the URL includes a query parameter in the format `?fileName=`, the file name
* is extracted from this query parameter (ex: when referencing an existing
* screenshot or icon from the main release)</li>
* <li>If the URL does not have the `fileName` query parameter, the method attempts to
* extract the file name from the URL path. (ex: this applies to cases where new files are
* uploaded, and only a path-based URL is provided)</li>
* </ul>
* - If the URL includes a query parameter in the format `?fileName=`, the file name
* is extracted from this query parameter (ex: when referencing an existing
* screenshot or icon from the main release)
* - If the URL does not have the `fileName` query parameter, the method attempts to
* extract the file name from the URL path. (ex: this applies to cases where new files are
* uploaded, and only a path-based URL is provided)
* After locating the file name (from either the query parameter or path), the method
* splits the name into segments based on the last dot (`.`), returning the base name and
* extension as a two-element array. If file name cannot be extracted, `null` is returned.

Loading…
Cancel
Save