Witam, mam pewien problem nad którym głowię się którąś godzinę. Mianowicie chodzi mi o to, w jaki sposób pobrać ContentLenght z pobieranego z FTP pliku.
kod Stremingu. Chciałbym jakoś pobrać z niego wielkość pliku i przekazać do
protected Integer contentLenght;
response.getContentLenght(contentLenght)
który użyje w metodzie setHeaders.
protected void doActualStreamingFromFtp() throws IOException {
OutputStream outputStream = null;
try {
outputStream = response.getOutputStream();
IOUtils.copyLarge(ftpInputStream, outputStream);
} catch (ClientAbortException e) {
logger.warn(getClass(), "client stopped download file, ordersEntity = %s", ordersEntity);
} catch (IOException e) {
logger.warn(getClass(), "client stopped download or file is corrupted, ordersEntity = %s", ordersEntity);
} finally {
StreamUtils.closeStreams(ftpInputStream, outputStream);
}
}