Adding a file to an archive

  • 28
  • Locked
The main method accepts a list of arguments. The first argument is the full path to the fileName file. The second argument is the path to a ZIP file. Add the fileName file to the archive inside the "new" directory.
You can't complete this task, because you're not signed in.
Comments (6)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Justin Smith
Level 38 , Greenfield, USA, United States
5 August 2022, 19:53
"don't use the file system" What does this even mean?
Oege Hiddema Java Developer at CodeGorilla
8 August 2022, 15:02
The hint says: you need to first save the contents of all of the zip entries somewhere. Does "don't use the file system" mean we can't use temporary files to store this content?
Justin Smith
Level 38 , Greenfield, USA, United States
8 August 2022, 19:09
I thought maybe it meant "don't use the File class" since a lot of other tasks have been emphasizing the Files utility class. But the official CodeGym solution uses the File class, so that's not it.
Oege Hiddema Java Developer at CodeGorilla
8 August 2022, 19:58
Looking at the Solution, now I know what they mean: The files that were already in the ZIP file, are temporarily stored as members of a class called 'Content', were the content of a file is stored as a byte array. So they are NOT temporarily stored as physical files. Storing these files physically somewhere on my hard drive was my first solution, which works locally, but doesn't pass the test...
Roman
Level 41 , Wieseck, Germany
3 November 2019, 21:43
Hi, in this code I've tried to considered all the hints from the available posts regarding this task. It works fine on the local machine, but on the CodeGym Server it fails by Requirements 3 and 4. Does anyone have an idea, what is wrong there?
Roman
Level 41
4 November 2019, 06:50
Please refer to Help section at our course.