I am fetching Zip file from S3 and then trying to unzip it. Zip file contents:- Test 2 Folder/ abc.log xyz.log
Code
val S3Object = getObject(id.bucketName, id.key_fileName)
val zipStreamm = new ZipInputStream(S3Object.getObjectContent)
val entryStream = Stream.continually(zipStreamm.getNextEntry).takeWhile(x => x != null)
val files: Stream[String] = entryStream.map { _ => scala.io.Source.fromInputStream(zipStreamm).getLines.mkString("\n") }
ERROR
Mar 10, 2017 12:48:48 AM com.twitter.finagle.Init$ $anonfun$once$1
INFO: Finagle version 6.42.0 (rev=f48520b6809792d8cb87c5d81a13075fd01c051d) built at 20170203-170145
Mar 10, 2017 12:48:50 AM com.twitter.finagle.util.DefaultMonitor logWithRemoteInfo
WARNING: Exception propagated to the default monitor (upstream address: /127.0.0.1:60721, downstream address: n/a, label: ).
java.io.FileNotFoundException: Test 2/abc.log (Not a directory)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
As I can see from this exception, you are trying to unzip file in Test 2 folder, not Test
java.io.FileNotFoundException: Test 2/abc.log (Not a directory)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
Can you share code where you execute this operation?