How can I list all files in a subdirectory in a jar

Hello.
I have wrote a program which lists all class files in given directory.
I used Class.getResource(""), and File.list().
Now I turned the program into single jar file.
It never works.
I know the reason but do not know how to fix the problem.
What can I do?
Thank you in advance.

If you are trying to list the files of jar file from java code you can use this code.
Try with the below code
=============================================
try {
// Open the JAR file
JarFile jarfile = new JarFile("filename.jar");
// Get the manifest
Manifest manifest = jarfile.getManifest();
// Get the manifest entries
Map map = manifest.getEntries();
// Enumerate each entry
for (Iterator it=map.keySet().iterator(); it.hasNext(); ) {
// Get entry name
String entryName = (String)it.next();
// Get all attributes for the entry
Attributes attrs = (Attributes)map.get(entryName);
// Enumerate each attribute
for (Iterator it2=attrs.keySet().iterator(); it2.hasNext(); ) {
// Get attribute name
Attributes.Name attrName = (Attributes.Name)it2.next();
// Get attribute value
String attrValue = attrs.getValue(attrName);
} catch (IOException e) {
=================================================
use import java.util.*;
and import java.io.*;

Similar Messages

  • Time capsule intern.1TB hard drive.How can I delete all files

    Hello How can I delete all files from my timecapsule.
    I have connectet it with Wifi or ethernet. It is not possible.
    I have made a reset.
    I have tried it often.
    Please help
    Greetings from Vienna
    Pepimeier

    If you open Macintosh HD > Applications > Utiltiies > AirPort Utility and click Manual Setup, are you able to access the settings for the Time Capsule?
    Or, does AirPort Utility scan for the Time Capsule and then not find it?

  • How can I list all the domains configured for Weblogic Servers?

    How can I list all the domains configured for Weblogic Servers?
    I saw a note, which says the following:
    "WebLogic Server does not support multi-domain interaction using either the Administration Console, the weblogic.Admin utility, or WebLogic Ant tasks. This restriction does not, however, explicitly preclude a user written Java application from accessing multiple domains simultaneously."
    In my case, I just want to list all the domains, is that possible by using any scripts?
    Thanks
    AJ

    If you use WLS Node Manager and the Config Wizard was used to create the domains, then the list of domains should be in a location like this:
    <MIDDLEWARE_HOME>\wlserver_10.3\common\nodemanager\nodemanager.domains
    Enterprise Manager Grid Control also has support for multi-domain management of WLS in a console.

  • I bought a mac air retina to replace a mac pro. How can I get all files of the back up and copy them to the new mac?

    I bought a mac air retina to replace a mac pro. How can I get all files of the back up and copy them to the new mac?

    Mail window may be in the Full Screen mode.
    Move the mouse pointer to the top right corner of the Mail window and hold it there.
    Menu bar should drop down and click the blue double arrow icon.
    Full Screen toggle shortcut:  control + command + F

  • How can I list all users and their DEFAULT tablespace?

    How can I list all users and their DEFAULT tablespace?
    Peter

    Peter, the following short article that lists the most heavily used Oracle rdbms dictionay views might be of interest based on your question:
    How do I find information about a database object: table, index, constraint, view, etc… in Oracle ? http://www.jlcomp.demon.co.uk/faq/object_info.html
    HTH -- Mark D Powell --

  • How can I list open files from the same application

    I often have several different files open in Word, Excel or Adobe.  However only one is visible.  How do I get a quick list of the other open files from an application?

    Many applications have a Window menu at the top of the screen. Clicking on it will list all the open windows, as well as providing other options depending on the application.
    (113485)

  • How can I list all users who have access to a particular TABLE or VIEW

    Hi,
    Can someone tell me how I can list all users who have access to a particular TABLE or VIEW.
    Abhishek

    Hi,
    Take a look on this link: http://www.petefinnigan.com/tools.htm
    Cheers

  • How can I sync all files in 2 Macs using local network only?

    I am looking to equip a small office with 2 Macs, iMac and MBAir. I would like for all files to be synced (either automatically, daily, or worst case, on demand). The trick is that this has to be in the local network only, as these are sensitive files. There will be a QNAP NAS on the network as well if it matters.
    Maybe it is possible to setup both Time Machines to look at the same folder on the NAS? Any ideas on how to make this possible?

    Here are three ways to do it. None of the ways is automatic:
    (1) Get an Acrobat.com account, and copy your files via Acrobat.com:
    http://forums.adobe.com/docs/DOC-3440
    (2) If you have a computer with iTunes, and you're syncing your iPad and iPhone to this computer, your PDF files already exist on the computer. In iTunes, select the device. Then go to the Apps folder, scroll down to the File Sharing section and select Adobe Reader. All your PDF files are shown and you can save the ones you want to your computer hard drive. Then import them in a similar way via iTunes.
    (3) Use a Dropbox account. Install Dropbox on both your iPad and iPhone. Copy the PDF files via Dropbox.

  • How can I see all files used in a Report or Transaction

    I need an expert advice. I am not an Abap  programmer but probably this is the the correct forum to post my question.
    I need to create a Query using same files that are used in report S_ALR_87012103 and some other additional files.
    Is there any transaction or functionallity that I can use to see the files used by this report ?
    << Removed - please do not offer rewards >>
    Thx. in advance for your help
    Edited by: Rob Burbank on Jun 19, 2009 1:33 PM

    Thanks for your message. I just reviewed the files in SE36.
    So I guess, next time I will have to check the name of the program in the status bar or the system status screen.
    Then, I will have to use SE38 in DEV to see the "Dictionary Structures" in the source code.
    However, on this case, I can not find the "KDF" in the source code or "Dictionary Structures".
    Other than you technical expertise ... How did you know that this program is using the KDF Logical Database.
    On my case, since I am not an Abap programmer, I would have to review all files described in the "Dictionary Structures" which by the way they are a bunch of files.
    I prefer the logical view. I liked the way the files are displayed using the SE36 and "KDF"
    Regards,
    Marco

  • How can I list all available  variables inside a movieClip

    I have a lot of movieclips in my file and each movieclip has
    its own set of variables.
    There is any way to trace all available variables inside any
    movieclip? I mean, how can i know what variables and their values
    are inside a movie clip!
    Tks,

    if your movieclip has instance name mm, you can use:

  • How can I remove all files or bad files on my Ipod 60gb

    Hi all!
    For unknown reasons , all my music library 7.5 Gb have been re-loaded on my Ipod 60Gb. It take a long time, but it doesn't erase the previous datas on my Ipod.
    I have around 7.5 Gb of my hard used with wrong datas !
    how can I erase and remove these wrong files ?
    Thanks for answers
    regards
    Chat_noir

    Restore it.
    See: How to restore the iPod to factory settings.

  • How can I list all the column names of a table by programming?

    Hi,
    Now I want to write an function which has the following features:
    Firstly, The function was given a parameter as table name.
    Then, it will lists all the columns names of the table.
    e.g
    table: person
    ---firstName------lastName----+
           Michale               Jackson
    We can get the columns 'firstname' and 'lastName' by calling the function with table name 'person'.
    And I also wonder that where I can get reference book or any other materials?
    Thanks.
    Edited by: wenjing wang on Feb 15, 2008 6:42 AM
    Edited by: wenjing wang on Feb 15, 2008 6:57 AM

    hi,
    hope the below code helps u. Just take the headee which contains the field name and split it like below and compare it with the field name u want here 'last name'.
    here,
    'First name' will be in wt_filedata1 and remaining field names in wt_filedata2, so 'do' continues.
    c_tab must be the separator, either , or + or tab etc..
    CODE:
    read table person into wl_header index 1.
    do.
        split wl_header at c_tab into: wt_filedata1 wt_filedata2.
        if wt_filedata1 <> 'lastname'.
          cnt1 = cnt1 + 1.
          wl_header = wt_filedata2.
        else.
          exit.
        endif.
      enddo.
    Please reward if it is useful.
    regards,
    sri

  • How can I sort all files and folders by size?

    Due to lack of space I need to find the biggest files and folders on my Mac OSX Mountain Lion, but "Size" is not in the Find options.
    And I don't know the wildcard to sort all files and folders by size in Easyfind.
    Thanks
    Sarah

    There are applications out there which are designed to show you files and the space they use.  Some of these applications and some strategies for making more room on your disk are given below.
    Freeing Up Hard Disk Space
    Freeing space on your Mac OS X startup disk
    Clearing Disk Space on Your Mac
    Seven ways to free up drive space

  • Scc question: how can I retrieve all files in 6.1?

    hello
    I have recently upgraded from LV5.1 to 6.1.. In 5.1
    it was possible to retrieve all files of a project
    with scc. When I try to do that in 6.1 (scc provider, select changed files, get latest version..) LV searches
    always in the local work directory for the vi's, but they don't exist, so I have to press "cancel" all the
    time.
    Is there an easier way to retrieve all files of a project at once???
    thanks

    NI support has sent me this VI, replace the original
    VI and it works..
    Attachments:
    Builtin_SCC_Retrieve_sub.vi ‏74 KB

  • How can I list all folders that contain files with a specific file extension? I want a list that shows the parent folders of all files with a .nef extension.

    not the total path to the folder containing the files but rather just a parent folder one level up of the files.
    So file.nef that's in folder 1 that's in folder 2 that's in folder 3... I just want to list folder 1, not 2 or 3 (unless they contain files themselves in their level)

    find $HOME -iname '*.nef' 2>/dev/null | awk -F '/'   'seen[$(NF-1)]++ == 0 { print $(NF-1) }'
    This will print just one occurrence of directory
    The 'find' command files ALL *.nef files under your home directory (aka Folder)
    The 2>/dev/null throws away any error messages from things like "permissions denied" on a protected file or directory
    The 'awk' command extracts the parent directory and keeps track of whether it has displayed that directory before
    -F '/' tells awk to split fields using the / character
    NF is an awk variable that contains the number of fields in the current record
    NF-1 specifies the parent directory field, as in the last field is the file name and minus one if the parent directory
    $(NF-1) extracts the parent directory
    seen[] is a context addressable array variable (I choose the name 'seen'). That means I can use text strings as lookup keys.  The array is dynamic, so the first time I reference an element, if it doesn't exist, it is created with a nul value.
    seen[$(NF-1)] accesses the array element associated with the parent directory.
    seen[$(NF-1)]++ The ++ increments the element stored in the array associated with the parent directory key AFTER the value has been fetched for processing.  That is to say the original value is preserved (short term) and the value in the array is incremented by 1 for the next time it is accessed.
    the == 0 compares the fetched value (which occurred before it was incremented) against 0.  The first time a unique parent directory is used to access the array, a new element will be created and its value will be returned as 0 for the seen[$(NF-1)] == 0 comparison.
    On the first usage of a unique parent directory the comparison will be TRUE, so the { print $(NF-1) } action will be performed.
    After the first use of a unique parent directory name, the seen[$(NF-1)] access will return a value greater than 0, so the comparison will be FALSE and thus the { print $(NF-1)] } action will NOT be performed.
    Thus we get just one unique parent directory name no matter how many *.nef files are found.  Of course you get only one unique name, even if there are several same named sub-directories but in different paths
    You could put this into an Automator workflow using the "Run Shell Script" actions.

Maybe you are looking for

  • Can not access the Instance Data of a Singleton class from MBean

    I am working against the deadline and i am sweating now. From past few days i have been working on a problem and now its the time to shout out. I have an application (let's call it "APP") and i have a "PerformanceStatistics" MBean written for APP. I

  • I have a G5 imac that is using Disk Warrior as the start up disk and can't change back.

    I am using a G5 imac (OS 10.4.8 I think the last update is) and I was attempting to use Disk Warrior to recover a lost file. On my other Macs you made Disk Warrior the start up disk to use it, which I did here but I think that was a mistake. Now I ca

  • Bluetooth driver G580 20150

    I have problem with bluetooth driver  Windows 8  I installed the one in this page http://support.lenovo.com/en_US/research/hints-or-tips/detail.page?DocID=HT073548 but it's not working  my system windows 8 Enterprise  and another problem when I click

  • Loading library from jar file

    Hi all, My question is can we load library from jar file using System.load() method. ex: myJar.jar | |----com.test.common.Util which conatins a method to load library from jar file itself, before that i used to load from File |---libraries/MozillaPar

  • Vaue Limit Purchase Order Approval

    Hi We are currently using the Value Limit Single Step Approval for Shopping Carts successfully. This is followed by 0 step approval for the creation of the PO. We have a scenario whereby we will need to apply this same single step value limit approva