Can't find a directory that's there

Hi,
I'm trying to solve a seemingly mundane problem that has managed to keep me stuck for a while.
I've a file in a directory in a jar file which I'm trying to access but I can't seem to be able to because it's not found by the code I've written.
Is there some detail which I'm overlooking here. Here is the code located in my Main.class
public java.net.URL getFileURL(String filepathAndFile){          
        java.net.URL URL = getClass().getResource(filepathAndFile);       
        if(URL!=null){           
            return URL;          
        else {
            System.out.println(path);
            javax.swing.JOptionPane.showConfirmDialog(this, "A configuration file is missing. Error 0.",
            "Alert!", javax.swing.JOptionPane.CLOSED_OPTION);
            System.exit(0);
            return null;
    }this is the scenario:
jarfile - myJar.jar
the directory structure is as follows:
-AppDirectory
-----BinDirectory
----------Main.class
-----InnerDirectory
----------InitFile0
I call: getFileURL("InnerDirectory\\InitFile0");but the Main class can't seem to find the folder and file.
Please help.

The "path" you give to getResource is relative so it tries to find the InnerDirectory from inside BinDirectory. You can make it absolute by putting the file separator character in front of the path. In addition to that, the separator character is /, I am not sure if \ works as well but / is what the api doc specifies.
So this should work:
getFileURL("/InnerDirectory/InitFile0");

Similar Messages

  • Is it possible to disable the trackpad when a wireless or usb mouse is present? With Lion 10.7.2, I can not find the checkbox that was there before I installed Lion. Is the option gone on Lion?

    Is it possible to disable the trackpad when a wireless or usb mouse is present? With Lion 10.7.2, I can not find the checkbox that was there before I installed Lion. Is the option gone on Lion?

    There is no BIOS in OS X. There is only the EFI stored in ROM that is not user modifiable. OS X is probably checking Bay 0 for the boot drive since that is where it should be. It won't check the Tempo drive since it is treated like an external drive. I suggest you open Startup Disk preferences to see if the Tempo device is selected as the boot device. If it isn't, then select it. That will probably shave off a few seconds in the startup time.

  • I have iTunes 10.6.3.25 and I can't find my audiobooks that I downloaded from a library website.  The audiobook tab is visible in iTunes but none of the audiobooks are there.  They are on my iPod nano.  Please help!

    I have iTunes 10.6.3.25 and I can't find my audiobooks that I downloaded from a library website.  The audiobook tab is visible in iTunes but none of the audiobooks are there.  They are on my iPod nano.  Please help!

    When you say they are displaying in your iTunes library, are you talking about the Audiobooks section of your iTunes library and not the audiobooks section indented under the iPod in the left pane of iTunes under Devices?
    Is the iPod Shuffle configured to sync audiobooks or do you manually manage the iPod's contents?
    B-rock

  • Hi, plz can any one help me that is there any way to locate or find the stolen ipon nano???

    hi, plz can any one help me that is there any way to locate or find the stolen ipon nano???

    Other than physically looking for it, no. It does not have WiFi.

  • How can I downgrade iOS 7.0.4 down to iOS 6.1.3? I know there is no Apple licensed way to do so, but can someone find a software that helps downgrade?????

    I know there is no Apple licensed way to do so, but can someone find a software that helps downgrade?????
    Please help me.
    Here is my list of things that suck about iOS 7:
    -motion sickness (i know how to fix that, i already did)
    -buggy
    -glitching out during games
    -apps shut down on me while i use them
    -battery life (apple says) lasts for 48 hours. for me it lasts 2 hours
    -no way to downgrade
    -terrible background choices (kinda lame, but still)
    -apps are neon (ick)
    -terrible design layouts
    -safari ***** (as usual) with its search bar functioning as web address search as well
    -mail badge says i hate not read mail when i have
    -passcode can be surpassed
    -game center push notifications will not go away
    -will not sync with my mac
    APPLE PLEASE LET US DOWNGRADE

    I'm sorry, but Apple does not provide a downgrade path for iOS. Because downgrading is unsupported by Apple we cannot discuss it on these forums.
    You may leave comments at Apple Feedback.

  • I just downloaded 950 photos on iPhoto and deleted them off my camera and now under last import there is only 4 photos and i can't find the others?? There is a whole bunch of blank events in the library with no photos in them all with todays date? Help!!

    I just downloaded 950 photos on iPhoto and deleted them off my camera and now under last import there is only 4 photos and i can't find the others?? There is a whole bunch of blank events in the library with no photos in them all with todays date? Help!!

    Yes - you need a min of 10 GB just to operate - with just 1 you certainly can lose photos and other critical things - you need to make space immediately - probably by moving your iPhoto library to a volume formatted Mac OS extended -
    Moving the iPhoto library is safe and simple - quit iPhoto and drag the iPhoto library intact as a single entity to the external drive - depress the option key and launch iPhoto using the "select library" option to point to the new location on the external drive - fully test it and then trash the old library on the internal drive (test one more time prior to emptying the trash)
    And be sure that the External drive is formatted Mac OS extended (journaled) (iPhoto does not work with drives with other formats) and that it is always available prior to launching iPhoto
    And backup soon and often - having your iPhoto library on an external drive is not a backup and if you are using Time Machine you need to check and be sure that TM is backing up your external drive
    LN

  • How can I find a printer that is compatible with my ox 10.4.11 operating system

    Helllo,
    I have several questions but my most current one is how can I find a printer that is compatible with my current operating system?

    Brother is good about supporting older Mac OS versions. We have their HL5250DN b/w laser that supports all the post-1997 Macs in the house, including a 1998 vintage Beige G3 minitower running OS 10.3.9. There is also a driver with OS9 support on the Brother web site.
    The bigger problem, based on posts I see in these forums, is not a printer failing to support an older OS but one not supporting a new Mac OS. There are numerous posts after a big OS version change (like the intro of Lion) where people run out and buy whatever printer looks cute/sounds good without researching whether the device supports the new OS yet. Printer makers are often not good about having updated drivers developed by the time Apple rolls out a new OS.

  • Where can i find a photo that i download from wechat

    where can i find a photo that i download from wechat

    Try the camera roll.  Often when photos are copied they end up there
    01101001 01110000 01101000 01101111 01101110 01100101 00100000 01110100 01101000 01100101 01110010 01100101 01100110 01101111 01110010 01100101 00100000 01001001 00100000 01100001 01101101

  • Can anybody help with this........I've bought a pack of self adhesive lables with a view to printing them via my printer,  However, I can't find a programme that allows me to do this.  Personnel in the MAC shops don't know either!!  I've a IMAC running on

    I've bought a pack of self adhesive labels that I wanted to print up on my IMAC,running on Snow Leopard.  However, I can't find a programme that will do this, nor can the personnel in the MAC shops.  The labels are stuck on a normal sheet od A4, and I just want to print addresses on them.   Can anybody help?

    Are they Avery Labels? If so there are templates here:
    http://www.avery.com/avery/en_us/Templates-&-Software/Templates

  • Can't find document/directory

    Hi Friends,
    Recently created custom appset (A),   i created few input scheduels/templates and stored in local drive.
    Now when i try to save those templates in server (i.e company folder), system prompting
    Can't find document/directory.
    what might be the reason?
    Thanks,
    naresh

    Hi
    System Preferences > Sharing. This is where you will find your computer name. Terminal is telling you that your computer name is listserv. Click Show All at the top of the System Preferences window, now select Accounts. You will see your account details listed, the short name of your account is networks. The ~ symbol is terminal shorthand for your home folder /Users/Home. This will take the short name that is in your account details you’ve just seen in System Preferences > Accounts.
    You can’t delete listserv:~network without changing your account details or creating another administrator account, logging in with that and deleting the old account. This is fairly bog standard account administration stuff that you should be familiar with. Terminal on launch displays the admin account short name and takes you to the admin account’s home folder by default.
    Hope this helps – Tony

  • How can you find an ipod that has been lost

    how can you find an ipod that has been lost and the icloud is not turned on

    lost/stolen                                      
    No app is required.                                               
    - If you previously turned on FIndMyiPod on the iPod in Settings>iCloud and wifi is on and connected go to iCloud: Find My iPhone, sign in and go to FIndMyiPhone. If the iPod has been restored it will never show up.
    iCloud: Find My iPhone
    - You can also wipe/erase the iPod and have the iPod play a sound via iCloud.
    and go to FIndMyiPhone. If the iPod has been restored it will never show up.
    iCloud: Find My iPhone
    - You can also wipe/erase the iPod and have the iPod play a sound via iCloud.
    - If not shown, then you will have to use the old fashioned way, like if you lost a wallet or purse.
    - Change the passwords for all accounts used on the iPod and report to police
    - There is no way to prevent someone from restoring the iPod (it erases it) using it unless you had iOS 7 on the device. With iOS 7, one has to enter the Apple ID and password to restore the device.
    - Apple will do nothing without a court order                                                        
    Reporting a lost or stolen Apple product                                               
    - iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number

  • HT1495 My husband and I share an i cloud account but each have our own separate ipads. We were told this would work, but now I can't find a book that I've downloaded on my ipad anymore. Where would I find it?

    My husband and I share an i cloud account but each have our own separate ipads. We were told this would work, but now I can't find a book that I've downloaded on my ipad anymore. Where would I find it?

    You and your husband can share a store account and still have seperate iCloud accounts for your contacts, bookmarks and stuff like that.  Click here for instructions to make an apple account without entering a credit card.  Make sure you use a different email address for each apple account. 
    Set up your iPhone/iPad whatever using the new account for iCloud.  Then go into settings/store and sign in with your purchasing account, you may need to sign out of the other account.  To the best of my knowledge, your household is allowed to share purchased legally, someone please correct me if I'm wrong.
    Once you each have your own devices set to your own accounts you can set them to backup to that account and it will keep all your contacts seperate.

  • Where can I find a video that tells me how to set time on photos to 1 second each?

    where can I find a video that tells me how to set time on photos to 1 second each? Where can I find a video that tells me how to add black space to the sides of all photos so that they display completely instead of only showing the center (which shows peoples' crotches but cuts off their heads- great huh?)? Would like to import whole folders of photos, set each to 1 second, have each display completely without distorting to fill. and "play" the timeline as I build it so that I can see if its working before putting in 2000 pics?

    Hello Cain,
    You can see the Domestic Outbound Scenario (DOT) for how to use incompatibility scenario.
    You can find the Customizing guides at SAP Support Poratl.
    Regards
    Nitesh

  • I have purchased Lightroom 5 and had it installed but I had to replace my matchbook pro and now I can't find the activation key - is there a way I can get it emailed to me or how do I find it? Most other plugin's email out the activation key so you have a

    I have purchased Lightroom 5 and had it installed but I had to replace my matchbook pro and now I can't find the activation key - is there a way I can get it emailed to me or how do I find it? Most other plugin's email out the activation key so you have a copy but I have seen no way to get it.

    If you registered your Lightroom with Adobe after you installed it, you can log into your Adobe account and get your serial number from your account.

  • Firefox 3.6.8. I can't find the tabs that I had open during several recent sessions.

    Firefox 3.6.8. I can't find the tabs that I had open during several sessions, the last of which was in Dec 2010. I've looked at various Views under History>Show all history. Are my old tabs stored somewhere (maybe in the Profiles folder) where I can access them? Sorry, I know that this question has probably been asked many times in the forum, but I haven't found a solution yet.

    This can be caused by anti-virus software/ real time scanners. Please try to disable the anti-virus software and try again. '''Do not forget to enable it after!'''

Maybe you are looking for

  • Installing PeopleSoft HRMS 9.0 on Windows Server 2008 with SQL Server 2008

    Hi there, Recently I was involved to develop a POC with PeopleSoft and as I was very new to PeopleSoft, I had bunch of issues while installing PeopleSoft. It took me almost more than couple of weeks to finally get the PeopleSoft Application up and ru

  • HT3386 how do I set up a mla format for a research paper?

    how do I set up a format in MLA style for an English essay paper?

  • HT4796 Migration Assistant on my Windows XP PC!

    New Macbook Pro, needing to migrate all my files from my old Windows XP PC laptop. Migration Assistant on my PC has finally loaded after copious updates, but won't run as the PC believes that Outlook Express is still running, when it's not! Restartin

  • Configuration Error (16). No version of After Effects works on PC.

    I've been receiving 'Error:16' every single time I've tried to use After Effects on my PC. It reads "Please uninstall and reinstall the product. If the problem still occurs... blah blah blah." I own a copy of AE CS5.5 in physical form and I first rec

  • SolidWorks 07 configs

    Hi When i import an assembly into Adobe 3D 8 from Solidworks 2007 the option of what config to use appears, e.g i choose the cross section config, certain parts of the assembly will cross section, but most of it won't and sometimes the part won't eve