mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fix NullPointerException in getFileMetaEntry method for URLs with chunked transfer encoding.
This commit is contained in:
parent
5853e529c7
commit
ba3e4623df
@ -122,7 +122,10 @@ public class FileDownloaderServiceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FileMetaEntry fileMetaEntry = new FileMetaEntry();
|
FileMetaEntry fileMetaEntry = new FileMetaEntry();
|
||||||
fileMetaEntry.setSize(Long.parseLong(Objects.requireNonNull(response.header("Content-Length"))));
|
String contentLength = response.header("Content-Length");
|
||||||
|
if (contentLength != null) {
|
||||||
|
fileMetaEntry.setSize(Long.parseLong(contentLength));
|
||||||
|
}
|
||||||
fileMetaEntry.setFileName(fileNameSegments[0]);
|
fileMetaEntry.setFileName(fileNameSegments[0]);
|
||||||
fileMetaEntry.setExtension(fileNameSegments[1]);
|
fileMetaEntry.setExtension(fileNameSegments[1]);
|
||||||
return fileMetaEntry;
|
return fileMetaEntry;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user