Results 1 to 8 of 8
Like Tree1Likes
  • 1 Post By gimbal2

Thread: Write a java program

  1. #1
    lnruther is offline Member
    Join Date
    Aug 2013
    Posts
    4
    Rep Power
    0

    Exclamation Write a java program

    Write a java based tool that
    Take two parameters : a zip file and a control file.
    Control file will be a list of strings
    Open zip file
    Read an entry from it
    See if the entry is specified in the control file
    If so, remove it from the zip file
    Create an entry in the zip file with same name but with 0 bytes.

    I'm not sure how to start out with this, beginner.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

    Default Re: Write a java program

    Moved from Advanced Java.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    lnruther is offline Member
    Join Date
    Aug 2013
    Posts
    4
    Rep Power
    0

    Default Re: Write a java program

    Thanks sorry about that!

  4. #4
    sehudson's Avatar
    sehudson is offline Senior Member
    Join Date
    Mar 2010
    Posts
    354
    Rep Power
    5

    Default Re: Write a java program

    When you say read the entry, do you mean the name of the file?

  5. #5
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,743
    Rep Power
    5

    Default Re: Write a java program

    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  6. #6
    lnruther is offline Member
    Join Date
    Aug 2013
    Posts
    4
    Rep Power
    0

    Default Re: Write a java program

    Yes zip entries

    1) Determine which payloads (zip files) can be set to a 0 file size.
    2) extract the associated payload (zip file) for that fix.
    3) set the file to 0 bytes - add it back into the zip file
    4) now extract the package
    - you will find a section in the xml, that calls out the zip file and the associated sha-1 CRC value
    - recalculate the value with sha1sum <filename (0 bytes)> - this will output a character string of the new CRC value (filename = zip file name)
    - use the output character string from sha1sum and overwrite the current value in pd.sdd
    5) place the new/modified pd.sdd file back into the original zip file

    Quote Originally Posted by gimbal2 View Post

  7. #7
    lnruther is offline Member
    Join Date
    Aug 2013
    Posts
    4
    Rep Power
    0

    Default Re: Write a java program

    Anyone with tips on how to write this program?

  8. #8
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,743
    Rep Power
    5

    Default Re: Write a java program

    There are no tips to give, you need to properly inform yourself on which classes to use and write the code; the links I gave you are a good point to start. A google for java zip files is a good start of your own research.

    Let me put it differently: if you want to bake a cake you don't go to a forum and ask for tips. The first thing you do is look for recipes.
    DarrylBurke likes this.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Write a java program
    By Khanak in forum New To Java
    Replies: 0
    Last Post: 05-16-2013, 09:23 PM
  2. Help!! Can someone write me this java program?
    By yungcotter in forum New To Java
    Replies: 7
    Last Post: 12-13-2010, 01:35 PM
  3. How to write two server program in java
    By priyamurugar in forum Networking
    Replies: 1
    Last Post: 04-27-2010, 11:20 AM
  4. need help to write Program in JAVA
    By maneibr in forum New To Java
    Replies: 1
    Last Post: 03-13-2008, 01:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •