Where is data stored during streaming file downloads through Apache Commons?

I saw this great guide to downloading streaming files through Apache Commons. Did it make me wonder where the data is stored? And is it necessary to “close” or “clear” this location?

Thank!

+5
source share
3 answers

Where is the data stored?

I do not think that it is stored. The Streaming API does not use DiskFileItemFactory. But it uses a buffer to copy data, as BalusC published. After you download the stream, you can use

long bytesCopied = Streams.copy(yourInputStream, yourOutputStream, true);  

Check out the API

+5
source

Here is the javadoc for DiskFileItemFactory .

FileItemFactory. FileItem, , . , , , , .

, :

Size threshold is 10KB.
Repository is the system default temp directory, as returned by System.getProperty("java.io.tmpdir").

, , . - FileCleaningTracker, DiskFileItemFactory. , , : , . ( , File .) , FileCleaner. , , . . " " .

, close cleanup , FileItem .

+3

byte[] Java.

+2
source

All Articles