Is there a way to put a directory full of zip files inside a list in a java springboot application? Say for example in my local:
/Macintosh HD/Systems/Volumes/Macintosh HD/folder1/profile/sent
There is a bunch of zip files and trg files, and I want to load these into eclipse java and look at the contents inside of each one (this is where the list comes in from I assume), how would I do that?
I tried doing
String folder1path = "/Macintosh HD/Systems/Volumes/Macintosh HD/folder1/profile/sent";
List<File> fileList = Arrays.asList(new File(folder1path).listFiles());
logger.info(fileList);
But this results in an list that looks like:
[
/Macintosh HD/Systems/Volumes/Macintosh HD/folder1/profile/sent/testZip1.zip
/Macintosh HD/Systems/Volumes/Macintosh HD/folder1/profile/sent/testZip2.trg
/Macintosh HD/Systems/Volumes/Macintosh HD/folder1/profile/sent/testZip5.zip
/Macintosh HD/Systems/Volumes/Macintosh HD/folder1/profile/sent/testZip3.zip
/Macintosh HD/Systems/Volumes/Macintosh HD/folder1/profile/sent/testZip4.zip
/Macintosh HD/Systems/Volumes/Macintosh HD/folder1/profile/sent/testZip1.trg
/Macintosh HD/Systems/Volumes/Macintosh HD/folder1/profile/sent/testZip2.zip
/Macintosh HD/Systems/Volumes/Macintosh HD/folder1/profile/sent/testZip4.trg
...
]
I haven't worked with this kind of stuff before but this isn't a "Zip" type file I think? It's a type File, but it has the path string in front. I don't think I can even open these zips either, so I was wondering if there was like a Zip type in java, and then I could access the contents inside the zip (it would be mostly excel spreadsheets inside, but I don't need to access the excel spreadsheets)?