Archiver (part 2)

  • 32
  • Locked
Now let's implement the createZip(Path source) method, which will zip the file specified by the source argument. Java has a special ZipOutputStream class in the package. It compresses (zips) the data passed to it.
You can't complete this task, because you're not signed in.
Comments (2)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Justin Smith
Level 38 , Greenfield, USA, United States
11 April 2022, 21:40
If you have done CodeGym in order, this task may be a huge headache, because it's been a long time since we've done inputstreams and outputstreams. Don't reinvent the wheel. Use the classes and methods that already come with Java. Path.getFileName() will save you a lot of trouble here. Likewise, there are built-in methods for adding a ZipEntry to a ZipOutputStream and for closing a ZipEntry (hint: it's not ZipEntry.close(), which doesn't exist). Also there is some non-linearity in the directions here... Some of the steps involve back-tracking up and rewriting code you've written in earlier steps. Kind of a pain, but not that hard to do.
Level 41 , São Paulo, Brazil
12 August 2020, 14:52
OMG why it has to be so confusing? There's no help, so those who don't understand will just be stuck in here forever, until someone good-hearted appears.