ioutils

TDirectory.GetDirectoryRoot does not handle correctly paths of Max_Path characters

一笑奈何 提交于 2021-01-27 17:51:10
问题 IOUtils.TDirectory.GetDirectoryRoot(Folder) gives me an error when 'Folder' is 259 chars long (yes, it includes the \ separator at the end): Project Tester.exe raised exception class EPathTooLongException with message 'The specified path is too long'. I though that I can use up to 260 chars in paths. Why GetDirectoryRoot does not accept paths that are of Max_Path chars? 回答1: And this is why: class procedure TDirectory.InternalCheckDirPathParam(const Path: string; const ExistsCheck: Boolean);

Does IOUtils.toByteArray(inputStream) method internally close inputStream object?

这一生的挚爱 提交于 2020-07-22 10:27:47
问题 Here is my code flow for which file content is getting lost and I think may be IOUtils.toByteArray() line is problem, please guide what is actually going wrong here. File content getting lost : InputStream stream = someClient.downloadApi(fileId); byte[] bytes = IOUtils.toByteArray(stream); String mimeType = CommonUtils.fileTypeFromByteArray(bytes); String fileExtension=FormatToExtensionMapping.getByFormat(mimeType).getExtension(); String filePath = configuration.getDownloadFolder() + "/" ;