Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
FileNotFoundException while Unzip file from S3 in scala

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)
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

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?

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!