How would I create a spanned archive with Java, so that a large directory or file can be stored in chunks of a couple of Mbs? Is that possible with Java's ZIP API? I don't see any methods that offer this possibility.
I don't think Java's ZIP API can do it unfortunately. I've been looking for other API's as well but without any luck. If there is anyone that knows an API that can do it I am very happy to hear it.
ZIP isn't absolutely necessary. Any other type of compression will do as long as I can create spanned archives from code.
Hey Joe I see it's possible to split ZIP files with the Winzip interface, but I am not sure there is a command line argument for splitting files. I'm still looking into that. Using Winzip however, would make my program rely on Winzip, right? I prefer avoiding that.
Your suggestion did direct me to a different possible solution. Perhaps I could use Java to ZIP the entire contents of the folder and then use Java to split the ZIP file myself? Or is that for rocket scientists? I am not really familiar with the internals of files. Would it be possible to use Java to do something like this:
1. Read contents of directory and create ZIP (possible)
2. Open the file again in Java, but not with the ZIP API.
3. Read the file, and while reading, split the file into smaller bits of X Mb and save them (along with some code that defines the order)
You could certainly make a ZIP archive and then chop it into pieces with Java, no problem. That wouldn't be a spanned ZIP archive, because the pieces wouldn't be in the right format, but perhaps that isn't really a problem.