Results 1 to 6 of 6
  1. #1
    anthropamorphic's Avatar
    anthropamorphic is offline Senior Member
    Join Date
    Jun 2011
    Posts
    135
    Rep Power
    0

    Default moving, getting information, and unzipping (help)

    Hello, I wanted to create a mod installer for a game and I was wondering, how would I move a file from one directory to another, how would I get if there are any folders, and how would I unzip .jars and .zips? Thanks for the help I know there is a lot of stuff.

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,755
    Rep Power
    7

    Default

    Quote Originally Posted by anthropamorphic View Post
    how would I move a file from one directory to another
    Rename it.

    how would I get if there are any folders
    I don't understand what you are asking

    and how would I unzip .jars and .zips?
    Java has some classes to handle zip files. Check out the API.

  3. #3
    anthropamorphic's Avatar
    anthropamorphic is offline Senior Member
    Join Date
    Jun 2011
    Posts
    135
    Rep Power
    0

    Default

    Quote Originally Posted by Junky View Post
    Rename it.
    how would i rename it?

    Quote Originally Posted by Junky View Post
    I don't understand what you are asking
    I'm asking how would I have java tell whether the stuff in a directory were folders or files.

    Quote Originally Posted by Junky View Post
    Java has some classes to handle zip files. Check out the API.
    ?

  4. #4
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,755
    Rep Power
    7

    Default

    The answer to all your questions are check the API. The File class has methods to do what you want. As for zip stuff guess what all the ZipXXX classes are for?

  5. #5
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    12,996
    Blog Entries
    7
    Rep Power
    19

    Default

    Quote Originally Posted by anthropamorphic View Post
    how would i rename it?
    In general when one wants to do something with/to a file, one consults the API documentation for the File class; if the answer is not there, a link is given to the API documentation part that does contain the answer. Please read it before asking questions, the answer was already given to you.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  6. #6
    Jodokus's Avatar
    Jodokus is offline Senior Member
    Join Date
    Jan 2011
    Location
    Amsterdam, the Netherlands
    Posts
    230
    Rep Power
    4

    Default

    I wanted to create a mod installer for a game
    Of course it can be done in java and it is a great exersise, but it sounds like reinventing the wheel. Did you consider using ant or an other builder tool? Eclipse (and other IDE's) support this.
    (Or Java webstart if you really get serous.)
    No bug ever had to calculate its fitnessfunction.

Similar Threads

  1. Replies: 5
    Last Post: 04-27-2011, 09:14 PM
  2. Unzipping a file
    By twiggy62 in forum New To Java
    Replies: 3
    Last Post: 02-20-2010, 12:33 AM
  3. Moving Box
    By anilanar in forum New To Java
    Replies: 2
    Last Post: 08-30-2009, 12:29 PM
  4. unzipping core files failed error 25099
    By truckerej in forum New To Java
    Replies: 17
    Last Post: 08-20-2009, 04:25 AM
  5. Unzipping
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-03-2008, 05:17 PM

Tags for this Thread

Posting Permissions

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