I have a JSP application that allows the user to upload a ZIP file and then the application will read all the files in the ZIP and store them in a MySQL.
Upon advice I decided to use "Zip File System Provider" to handle the ZIP file:
Path zipPath = Paths.get(zipFile.getSubmittedFileName());//returns the path to the ZIP file
FileSystem fs = FileSystems.newFileSystem(zipPath, null);//creates the file system
I tried to traverse it using:
for (FileStore store: fs.getFileStores()) {
System.err.println("Store: " + store.name());
}
However it loops only one time and returns tmp.zip
which is the entire ZIP. How do I extract the physical image files one by one so I can store them in MySQL.