I'm wondering if I can store a file in cache (or somewhere else), not on the hard drive using JAVA. I got a file as input, copy it to my hard drive now to an another path, modify the copied one and return with it. But what if a user does not have rights to write on hard disk, so the application which uses the file also don't have? Thats why I'm trying to store the copy somewhere else, for example in the cache, is it possible? If yes, is it also possible without any library?
Thanks in advance!
If this is string file, and small enough to fit into memory you can just use:
IOUtils.toString(inputStream, encoding);
for binary file you need to reserve byte array big enough to fit the file content into...