Browse and handle jar files?

I´m going to make a little app to help some morons I know. Pretty much what I want it to do is to make you able to browse files on your HDD and then move them into a .jar file. I know terminal commands for this but is there a way to make it really easy for my friends.
I dunno if this helps but when I do it thought terminal I first unarchive the .jar, change content and then compress it and move it back.

Is this possible?

Mac Book 13 inch, Mac OS X (10.5.8)

Posted on Mar 1, 2011 5:04 PM

Reply
2 replies

Mar 1, 2011 11:57 PM in response to Prooz

I still don't think it's good for morons to create .jar files...

set javrfile to quoted form of (POSIX path of (choose file with prompt ".jar file:" of type {"jar"}))

set filestoadd to choose file with prompt "files to add:" with multiple selections allowed

set filestoadd_unixpaths to {}

repeat with filetoadd in filestoadd

set filetoadd to quoted form of (POSIX path of filetoadd)

set filestoadd_unixpaths to filestoadd_unixpaths & filetoadd

end repeat

set AppleScript's text item delimiters to " "

set filestoadd_unixpaths to filestoadd_unixpaths as text

set AppleScript's text item delimiters to ""

display dialog (do shell script "jar vuf " & filestoadd_unixpaths)

Mar 2, 2011 2:13 AM in response to Prooz

Hi

If you want to do this in Java then it's quite possible.

The package java.io contains classes which you can use to get a list of files in any folder, whilst the package java.util.jar contains a number classes that can be used to create, read and write jar files.

Put these two together and it sounds like you've got the basics of your application.

Bob

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Browse and handle jar files?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.