How to bundle all files and directories in a package?

how to bundle all files and directories in a package?
i plan to put all image files, .class files and some other files together.and then double click the package to execute the program.
should i use jar?is there a link for tutorial or example?
thanks in advance

http://java.sun.com/docs/books/tutorial/jar/

Similar Messages

  • How to list all files and directories in another directory

    I need to be able to list all the directories and files in a directory. I need to write a servlet that allows me to create an html page that has a list of files in that directory and also list all the directories. That list of files will be put into an applet tag as a parameter for an applet that I have already written. I am assuming that reading directories/files recursively on a web server will be the same as reading directories/files on a local system, but I don't know how to do that either.

    Hi,
    Here is a method to rotate through a directory and put all the files into a Vector (files).
          * Iterates throught the files in the root file / directory that is passed
          * as a parameter. The files are loaded into a <code>Vector</code> for
          * processing later.
          * @param file the root directory or the file
          *         that you wish to have inspected.
         public void loadFiles(File file) {
              if (file.isDirectory()) {
                   File[] entry= file.listFiles();
                   for (int i= 0; i < entry.length; i++) {
                        if (entry.isFile()) {
                             //Add the file to the list
                             files.add(entry[i]);
                        } else {
                             if (entry[i].isDirectory()) {
                                  //Iterate over the entries again
                                  loadFiles(entry[i]);
              } else {
                   if (file.isFile()) {
                        //Add the file
                        files.add(file);
    See ya
    Michael

  • How to delete all files and folders (with files) in IsolatedStorage.

    Hi awesome programmer:-) The code I have to clean up the local folder doesn't work properly so I won't even bother posting it here. I basically want to have a "master reset" option to remove all new created files and folder in the local folder.
    Can you give me simple code to remove all files/folder so the app goes back to the state it was when the user installed it for the first time? Thanks in advance. ps I were able to delete a directory(-ies) with this method:
    private async void DeleteDirectory(string directoryName)
    try
    var folder = await Windows.Storage.ApplicationData.Current.LocalFolder.GetFolderAsync(directoryName);
    if (folder != null)
    await folder.DeleteAsync();
    this.Dispatcher.BeginInvoke(delegate()
    txtUpdateFeed.Text = "Folder < " + directoryName + " > deleted.";
    catch (Exception ex)
    this.Dispatcher.BeginInvoke(delegate()
    txtUpdateFeed.Text = "Delete Directory << " + directoryName + " >> Error: " + ex.GetBaseException().Message.ToString();
    It seems to work, I have not tested with all conditions though. Anyway let me put up the code so you can see I have been trying: This is to delete everything but not all files are deleted:
    private void WipeAllData(bool bln)
    try
    txtUpdateFeed.Text = "Removing files...";
    if (bln)
    txtUpdateFeed.Text = "Removing folders...";
    //Delete videos directory
    DeleteDirectory("videos");
    //Delete pictures directory
    DeleteDirectory("pictures");
    txtUpdateFeed.Text = "Folders removed.";
    //Delete the rest of the files
    var iso = IsolatedStorageFile.GetUserStoreForApplication();
    foreach (string name in iso.GetFileNames())
    iso.DeleteFile(name);
    BtnWipeAllData.Content = "Wipe All Data";
    VideoCameraPowerValue = "on";
    BtnVideoCameraPower.Content = "Video Camera: ON";
    PhotoCameraPowerValue = "on";
    BtnPhotoCameraPower.Content = "Photo Camera: ON";
    txtUpdateFeed.Text = "Files removed successfully.";
    catch (Exception ex)
    MessageBox.Show("Wipe All Data Error:\n" + ex.Message.ToString());
    Why isn't all files being deleted?

    Hi Clint William Theron,
    Based on your descriptions, I know that when you run the above code, it does not delete all the files, then have you checked that which kinds of files or in which folder the files can not been deleted?
    Besides, if you want to let the app go back to the state it was when the user installed it for the first time, then an easy way is to uninstall and reinstall it.
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to list all files in directories

    Here's what I'd like to do, and I know there's a genius on this forum that knows the answer:
    Let's say I burn a disc with lots of folders and files. How could I see a list of all those folders with their included files in one easy to read place? Like, could I go to Terminal and list the contents of the disc in kind of a directory tree sorta layout that could be copied to a text document?
    I have several dozen discs of data I've burned over the years, and when I want to find a certain file, I have to open the disc and manually click thru all the folders to see their contents until I find what I'm looking for. I'd like to make an "index" of each disc so I can find things faster, or better, list the folders/files in a text file I could save, 1 per burned disc. Does this make sense. Is this do-able?

    That works pretty sweet, too. As with other techniques, a lot of output to filter thru, hard on the eyes, might kill a printer, I dunno. As far as the output itself... what is this command asking for, in English, like, "Ms. Terminal application: please list ..." What? (the " -lR part)
    And the results:
    /Users/rob/Desktop/Websites/ARP-new content,May 2008/arp new ens/new vert en:
    total 752
    -rw-r--r-- 1 rob rob 48593 Jun 3 16:28 608v1_en.jpg
    What's the "total 752" mean?
    What's the "1" in front of the "rob rob" part?
    Apparently the date only shows the year if it's other than this year?
    I noticed Terminal doesn't like spaces in path names, like "/Users/rob/Desktop/My Best Folder Ever",
    should I rename everything like "MyBest_FolderEver", or is there a workaround for name spaces? Just some curiosity. Do you know of a concise, easy to digest guide to commands in the Terminal? It's something I'd like to learn more about. And thanks for the DIRECT answer to my original post.

  • How to move all files, and authorisations...

    Hi.
    I have been making music on a G4 powerbook for a while, but now i have got an imac G5 20" machine ready and waiting for me.
    The powerbook is running 10.3.9 and the imac will be running the latest tiger os.
    I need to find out the most painless way of moving all my software (i have a lot of music software (logic pro, audio instruments, each with their own validation codes etc) and i need to work out how to get this over to the other mac without having to move things one by one.
    Can it be done, or do i have to do everything one app at a time?
    Many thanks
    David Tobin

    You should be able to use the Setup Assistant found in your Utilities folder without a problem.
    Apple has a description and some FAQs HERE for you.

  • How to transfer all files and programs from old HDD to new HDD?

    I would like to change my laptop's HDD to one with a larger capacity. Is there a way for me to transfer all my current content to the new HDD from the old one without having to re-install all programs/ the OS?

    Check this MS page about Windows Backup and Restore Center
    http://www.microsoft.com/windows/windows-vista/features/backup.aspx
    There you can find this:
    +Windows Complete PC Backup and Restore Available in Windows Vista Business, Ultimate, and Enterprise editions, Windows Complete PC Backup and Restore is a comprehensive, image-based backup tool that will help you out of a tight spot if you need to recover your entire system+.
    So I would assume that this is similar to the ghost or another image tools

  • Traversing files and directories underneath a directory

    I'm looking at some sample code about traversing files and directories underneath a directory. I'm trying to understand exactly what the code is doing. I see that dir.list() is building a string array of filenames and directory names. Then it tests each to see whether it's a directory. If it's a directory then is looks and each file and or directory in that directory.
    But I don't understand how it keeps going below just the second level directory. The two lines of code I'm not sure I understand are:
    1) process(dir);
    2) visitAllDirsAndFiles(new File(dir, children));
    Can anyone help me to understand exactly how this code block can traverse beyond just the second directory level?
    // Process all files and directories under dir
        public static void visitAllDirsAndFiles(File dir) {
            process(dir);
            if (dir.isDirectory()) {
                String[] children = dir.list();
                for (int i=0; i<children.length; i++) {
                    visitAllDirsAndFiles(new File(dir, children));

    No, I guess they might be assuming somethings. Here is the page with the sample code:
    [http://exampledepot.com/egs/java.io/TraverseTree.html]

  • Copying files and directories from AIX/UNIX to Client PC in ABAP.

    Hi all,
    Can someone help me. I have to make an ABAP program which copies the J2EE Visual Adminstrator programs from our AIX/UNIX server to the Client PC.
    I have to copy all files and directories in /usr/sap/DXI/DVEBMGS70/j2ee/admin/.  to  D:\j2ee\*.*
    Is it possibly in ABAP? How would you do it?
    Best regards
    Brian Strunge

    Hi,
    try this.
    DATA: lcl_directory TYPE char128,
    constants: c_mask TYPE char9 VALUE ',.,..'.
    lcl_directory = ''/local/data/interface/A28/DM/OUT'. <b>"target directory</b>
    CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
    EXPORTING
    directory = lcl_directory
    filemask = c_mask
    IMPORTING
    serverfile = p_f2
    EXCEPTIONS
    canceled_by_user = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE e000(zmm) WITH text-039.
    flg_app = 'X'.
    ENDIF.
    ******************************************************8
    REPORT zdirtest.
    DATA lv_dir TYPE rsmrgstr-path VALUE '/usr/sap/trans/data'. <b>"source directory</b>
    DATA: wa_files TYPE rsfillst,
    it_files LIKE TABLE OF wa_files.
    START-OF-SELECTION.
    CALL FUNCTION 'SUBST_GET_FILE_LIST'
    EXPORTING
    dirname = lv_dir
    filenm = '*'
    TABLES
    file_list = it_files
    EXCEPTIONS
    access_error = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    WRITE /1 'Error! :-('.
    ELSE.
    LOOP AT it_files INTO wa_files.
    WRITE: /1 wa_files-name,
    wa_files-len.
    ENDLOOP.
    Regards
    Anver

  • [SOLVED] Check for old configuration files and directories in ~/

    Hello,
    Since I started with Arch I tried and uninstalled a few programs and would like to check for possible left overs in ~/
    I tried the "lostfiles" script, but it does not seem to check the home directory. Then I followed this: https://wiki.archlinux.org/index.php/Pa … ny_package - But using the suggested alias in my bash, it gives me the below:
    $ pacman-disowned-files
    [sudo] password for [my user]:
    bash: -path: command not found
    bash: /root: Is a directory
    bash: -print: command not found
    What am I doing wrong?
    Regards
    Martin
    Last edited by onslow77 (2015-02-04 23:52:44)

    Hello,
    ohh, I see, I need to do this (in directory where I put the script)
    sh pacman-disowned -files > test.txt
    That solved the usage of the commands, but it does not however list files [in the test.txt file] that do not belong to any package in my ~/ directory (I put a dummy file in my ~/ to see if it got noticed) - but it did not. So how can I list files and directories in my ~/ directory that is not put there by any package that currently is installed?
    Regards
    Martin
    Last edited by onslow77 (2015-02-04 22:49:11)

  • Set numerous files and directories to 664 and 775

    This is actually a Solaris 9 question:
    I need to set numerous files/directories under a selected "branch" (directory) to 664 (files) and 775 (directories), recursively.
    also need to ensure all files/directories created from then on are 664/775, respectively.
    Thanks

    I guess I wasn't clear...
    The directory/file structure consists of multiple levels (subdirectories) and files in each of those subdirectories.
    I can do a
    chmod -R 775 whatever
    this changes ALL files AND directories under directory: whatever to 755
    I need to change all subdirectories to 775 and all files (non-directories) within those subdirectories to 664
    Is there a way to indicate file or directory.. There does not appear to be an option using chmod..
    Thanks

  • How can I remove all photos and directories from iPhoto?

    How can I remove all photos and directories from iPhoto as if it was a brand new install?
    I am new to iPhoto and was unaware of how it works, honestly I still am a little confused as to when pics I am using 1/2 the time, some from iPhoto and some from MyPics.
    Anyhow, I am looking to remove all photos from iPhoto because during the migration of all my photos from PC to MAC, somehow my timeline became messed up and all my photos that have been logged my dates since 1998 are now all messed up.
    Although all my year folders are still in tact, IE 1998-2006, the subfolders and like pics are all intertwined somehow.
    And when I search iPhoto for a given year, photos from 2,4, 8 yrs back show up in 2006.
    Anyhow, I have selected and deleted all photos and folders within iPhoto, and then import the desired photos from MyPics, only to have the photos double up in the library. ( The old ones that should be deleted and the new imports)
    I simply don't get it, they fill the trash and disappear when it's emptied, then reappear when iPhoto re-opens!
    Can someone help????
    I have completely reworked all my photos so that they are all in the correct folders outside of iPhoto, and now I want to import those and only those pics with that file structure.
    IE Structure = YEAR > MONTH > DAY ( or if needed) > DAY/EVENT

    Do you want to remove the existing full sized image files also? If so then just drag the iPhoto Library folder from the Pictures folder to the Trash and empty it. But be warned you'll lose all of your image files.
    You are dragging the files to the iPhoto Trash bin and then using the iPhoto->Empty Trash menu, right?
    In copying your photos to myspace and then back the original capture date may not be retained and then either the created date or modified date will be used by iPhoto. If the files in the current library are the originals from your camera then those have the best chance of retaining the correct Captured Date. You can check that out by dragging the Originals folder from your iPhoto Library folder to the desktop and then trash what remains of the iPhoto Library folder. Then launch iPhoto and it will ask you to create an new library. Then import that Originals folder and it's subfolders by dragging it into iPhoto's open window. You'll keep the same rolls that was. The roll dates may change but you can check the captured date of the files by using the calendar in the Source pane.
    You won't be able to keep your folder structure within iPhoto. Each outside folder will result in a roll with the same title as the folder. You'll be able to create folders in the Source pane to put albums inside. You can create a smart album to include all photos in a certain date range, line one month.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    G5 Dual Core 2GHz, 2G RAM, 250G HD; G4 Dual 1Ghz, 1.5G RAM, 80G HD,   Mac OS X (10.4.7)   22 LCD Display, 200G & 160G FW HDs, Canon S400, i850 & LIDE 50, Epson R200

  • I have an external hard drive that was formatted by a PC and has files and directories etc. I want to format it and use it on my IMAC for backup but I can't seem to write to it nor can I delete current content. How do I initialize it for use with the MAC?

    I have an external hard drive that was formatted by a PC and has files and directories copied to it etc. I want to use it on my IMAC for backup. I see it on my my IMAC . I can open files etc.  But I can't seem to write to it nor can I delete current content. I don't care if I lose current content. How do I initialize it for use with the MAC?

    You can't write to it because it's formatted as NTFS which OS X will read but not write to. If you want to continue using the drive with both a PC and OS X you will need to download and install NTFS-3G so you can then write to it from your Mac. You can get NTFS-3G at:
    http://www.macupdate.com/app/mac/24481/ntfs-3g
    If you want to use the drive exclusively with your Mac then move the data off it and reformat it in Disk Utility (Applications - Utilities - Disk Utilities) as Mac OS Extended (Journaled.)

  • When I try to same an image under the command 'save as' it will only let me save as file types 'firefox document' or 'all files' and when I try to look at them later they dont work. How can I save an image as the same file type it is on the web site?!

    When I try to save an image under the command 'save as' it will only let me save as file types 'firefox document' or 'all files' and when I try to look at them later they dont work. How can I save an image as the same file type it is on the web site?!
    == This happened ==
    Every time Firefox opened
    == I updated to one of the firefox versions (Not sure which one it was)

    Thanks Alex, but sadly I already tried that. Neither .docx or .xlsx files show up in the content list. They both show as a Chrome HTML document so changing how Firefox addresses those doesn't help since it thinks its the same type of file. I don't think I can manually add files into the "Content Type" left side nav.

  • I like the idea of auto back-up for my new iMac, Ipad and PC Netbook, particularly if I can access all files and data stored on any device.  But I have a Conceptronic router.  Will Time Capsule work with this and how?

    I like the idea of auto back-up for my new iMac, Ipad and PC Netbook, particularly if I can access all files and data stored on any device.  But I have a Conceptronic router.
    1. Will Time Capsule work with this and how?
    2. Can my printer USB be plugged in and then shared between the devices?
    3. Can I create a network and how?
    4.  What happend when a visitor logs onto my existing wireless router?
    I'm new to Macs (well a returning user having started with Mac Plus!!) and not very technical.  Any help / advice will be much appreciated.
    Ray

    The key to what you seem to want to do is to be able to get Apple's Time Capsule router to "join" the network that your Conceptronic router.  I believe that works with some third-party routers, but I've never seen a list of those that work in such a configuration and I have no experience with Conceptronic equipment.
    You might be better off with a Network-Attached Storage (NAS) device instead of a Time Capsule.

  • How to Unlock all folders and Files in One Main Folder

    How do i unlock all files and folders in one main folder? This way I wouldn't have to do it over 1,000 times to fix my folders I imported from my external drive.

    Open the Script Editor in the /Applications/AppleScript/ folder and enter the following:
    tell application "Finder"
    set locked of every item of entire contents of (selection as alias) to false
    end tell
    Select the main folder in the Finder and run the script.
    (39015)

Maybe you are looking for