Where is it documented that getResource() will find data in the jar?

Hello, if I package data in the .jar that is different than .class, then it was posted here a while ago by atomguy, that the following code will work
URL url = getClass().getResource("/Your/Filepath/inthe/Jar");
My question is, where does it say so? The rationale for my question is, this may work now, but if it is an undocumented feature, then one day when my customer downloads some future Java version, it might not work anymore. So I want to know that this is a documented feature before I use it, as such features are far less likely to be changed by Sun (backwards compatibility).
I read the documentation on getResource(), ultimately this seems to be delegated to ClassLoader instance getResource(), I read that doc too, and I don't see where it implies that it will produce a URL that I can then use to access the data file in the jar, for sure.
Please point me where in the docs it follows from.
Thank you,
Mark

I'm no expert, but I would say it is a documented feature that a classloader searches for and loads classes that the JVM needs - it's in the JLS and Sun JVM specs. It's documented that getResource() calls the object's classloader getSystemResource() and returns the URL for the named resource.
If you put resources in places where the classload finds classes, then those resources will be found by the same classloader. Any jar (or any directory) that contains classes that have been loaded MUST be in the search path of the classloader. (I am assuming the bootstrap classloader - if a custom classloader is used, then it might not behave the same.)
Edited by: atmguy on Mar 1, 2009 9:38 AM

Similar Messages

  • Can I download a file in different sessions or should it be in a single session? In other words can I pause the download of a file, shutdown/restart my system and then resume download from where I left off? Or will it start from the very beginning?

    Can I download a file in different sessions or should it be in a single session? In other words can I pause the download of a file, shutdown/restart my system and then resume download from where I left off? Or will it start from the very beginning?

    If a server supports resuming downloads then the download should continue where it left off.<br />
    You can test that by simple starting a large download and wait a minute or so before pausing it.<br />
    Then you can close and restart Firefox and see if resuming works.
    You can set the pref browser.download.manager.quitBehavior to 2 on the about:config page.<br />
    That will make Firefox ask for confirmation if you want to cancel the download if you close Firefox.
    See:
    * http://kb.mozillazine.org/browser.download.manager.quitBehavior

  • New user here.  Trying to import iPhoto 9.4.2 libraries into Aperture 3.4.3 as referenced files. When accessing File Import Library, it finds the iPhoto library just fine, but then imports it as Master files. No option that I can find to leave the photos

    New user here.  Trying to import iPhoto 9.4.2 libraries into Aperture 3.4.3 as referenced files. When accessing File>Import>Library, it finds the iPhoto library just fine, but then imports it as Master files. No option that I can find to leave the photos in place on the file system.  All the literature says their should be an option to choose, but I never get that option.  What?

    All the literature says their should be an option to choose, but I never get that option.
    That has been true for the previous Aperture versions. Now Aperture simply treats the original image files exactly as they are in the imported library. Referenced images will stay referenced, managed will be imported as managed. But you can always relocate the imported managed images afterwards by using "File > Relocate".
    Regards
    Léonie

  • Is there a chance that Captivate will be bundled into the Creative Cloud Suite?

    Is there a chance that Captivate will be bundled into the Creative Cloud Suite?

    When I'm asking about this in some webinars, I get mostly two answers: that is another business unit (Captivate and Presenter), or those applications are not considered for 'creative' people. The last reason always makes me laughing but is typical of the way 'big' Adobe is looking down on 'small' Adobe.
    Rod, Framemaker and RoboHelp are not in the Creative Cloud neither. Both have a bit limited, but very specialized user base. And really, Framemaker has features that InDesign (which is much more promoted by Adobe) has not yet. It does publish directly to different ebook formats, which is still a very cumbersome work flow in InDesign who is the 'flagship', and where defenders mostly tell that FM is EOL. RH has even more formats available as output. Maybe Captiv8r, respected RH expert, can offer more info. Technical Communication Suite is the only suite that remains for the moment, version 5 was released two weeks ago.
    Another possible reason, which doesn't apply to Captivate: Presenter, RoboHelp, Framemaker are not available for Mac (Presenter Express is only a small part of Presenter).
    It is also my opinion, that at least Captivate belongs in the CC and that it 'could' extend the user base, but I'm a very bad marketing person, other people do know better.
    Lieve

  • I'm about to buy a 27" i-Mac. I would like to connect my 30" Cinema Display to it as a second monitor. What will I need to do that? Will this slow down the overal performance?

    I'm about to buy a 27" i-Mac. I would like to connect my 30" Cinema Display to it as a second monitor. What will I need to do that? Will this slow down the overall performance?

    The new iMacs do not come with a MiniDisplayPort, they have Thunderbolt, so unless you are talking about purchasing one of the previous generation iMacs such as this refurbished model in the online Apple store, it won't work. And yes, if you are going to get the full range of video resolutions you will need the Dual-Link version.
    For details see the store's web page on the Dual-Link display adapter.

  • I have a power pc (g5) computer that I will soon be replacing with a current i5 or i7 mini. How do I transfer the Time Machine files from the internal hard drive on the G5 to an external drive that I will later use with the Mini?

    I have a Power PC G5 computer that I will soon be replacing with a current i5 or i7 Mini. How do I transfer the Time Machine files from the internal hard drive on the G5 to an external drive that I will later use with the Mini?

    Hi, likely the easiest is to just poll the drive & get something like this...
    Get MacScan...
    http://www.apple.com/downloads/macosx/networking_security/macscan.html
    http://eshop.macsales.com/item/NewerTech/U3NVSPATA/
    But if you have a good external drive already, just clone it.
    Get carbon copy cloner to make an exact copy of your old HD to the New one...
    http://www.bombich.com/software/ccc.html
    Or SuperDuper...
    http://www.shirt-pocket.com/SuperDuper/

  • When I am sending an email and add a recipient, and then go to add another recipient, my contact book will start at "A". How do I change it so that it will leave me at the place I left off at in my contacts?

    When I am sending an email and add a recipient, and then go to add another recipient, my contact book will start at "A". How do I change it so that it will leave me at the place I left off at in my contacts?

    When I am sending an email and add a recipient, and then go to add another recipient, my contact book will start at "A". How do I change it so that it will leave me at the place I left off at in my contacts?

  • [svn:fx-trunk] 13157: -revert a portion of my previous change so that asdoc will work properly - moved the proprietary automation swcs back into the libs directory .

    Revision: 13157
    Revision: 13157
    Author:   [email protected]
    Date:     2009-12-22 10:15:18 -0800 (Tue, 22 Dec 2009)
    Log Message:
    -revert a portion of my previous change so that asdoc will work properly - moved the proprietary automation swcs back into the libs directory.  the automation projects swcs will still get compiled into the automation directory.
    This should fix the build
    QE notes: make sure packaging is correct
    Doc notes: no
    Bugs: no
    Reviewer:no
    Tests run: checkintests, doc targets run
    Is noteworthy for integration: no
    Modified Paths:
        flex/sdk/trunk/build.xml
        flex/sdk/trunk/frameworks/projects/automation/build.xml
        flex/sdk/trunk/frameworks/projects/automation_air/build.xml
        flex/sdk/trunk/frameworks/projects/automation_dmv/build.xml
        flex/sdk/trunk/frameworks/projects/automation_flashflexkit/build.xml
        flex/sdk/trunk/frameworks/projects/automation_spark/build.xml
    Added Paths:
        flex/sdk/trunk/frameworks/libs/automation_agent.swc
        flex/sdk/trunk/frameworks/libs/qtp.swc
        flex/sdk/trunk/frameworks/libs/qtp_air.swc
    Removed Paths:
        flex/sdk/trunk/frameworks/libs/automation/

    Revision: 13157
    Revision: 13157
    Author:   [email protected]
    Date:     2009-12-22 10:15:18 -0800 (Tue, 22 Dec 2009)
    Log Message:
    -revert a portion of my previous change so that asdoc will work properly - moved the proprietary automation swcs back into the libs directory.  the automation projects swcs will still get compiled into the automation directory.
    This should fix the build
    QE notes: make sure packaging is correct
    Doc notes: no
    Bugs: no
    Reviewer:no
    Tests run: checkintests, doc targets run
    Is noteworthy for integration: no
    Modified Paths:
        flex/sdk/trunk/build.xml
        flex/sdk/trunk/frameworks/projects/automation/build.xml
        flex/sdk/trunk/frameworks/projects/automation_air/build.xml
        flex/sdk/trunk/frameworks/projects/automation_dmv/build.xml
        flex/sdk/trunk/frameworks/projects/automation_flashflexkit/build.xml
        flex/sdk/trunk/frameworks/projects/automation_spark/build.xml
    Added Paths:
        flex/sdk/trunk/frameworks/libs/automation_agent.swc
        flex/sdk/trunk/frameworks/libs/qtp.swc
        flex/sdk/trunk/frameworks/libs/qtp_air.swc
    Removed Paths:
        flex/sdk/trunk/frameworks/libs/automation/

  • I am trying to download to my new computer.  It keeps saying I need to authorize this computer.  Where do I do that?, How do I authorize the new computer to download automatically?

    I am trying to download to my new computer.  It keeps saying I need to authorize this computer.  Where do I do that?, How do I authorize the new computer to download automatically?

    Computer iTunes menu > Store > Authorise This Computer...

  • Did VZW ever say that Gingerbread will be coming to the Droid Charge?

    no... I'm not one of those people who complain that Verizon and/or Samsung is obligated to provide Gingerbread update.
    I do not think they are obligated.
    However....    did VZW ever say that Gingerbread will be coming to the Droid Charge?  (in TV commercials, print ads,
    in-store ads, etc)

    HoustonHeart wrote:
    It's coming.
    CUrrent leak is __1h. Current Beta is 1m. NExt beta is 3C1B and is last planned stages\, the beta leaks are now 4 behind, streamign works, new customizable UI works. Inhanced vid cap features work. More stable network protocols work, newer flash version works. Much better battery manager, vattery life extendded even with fancy weather report features and animations.
    Please no Verizon bull crap preloaded.....
    There is a reason you can't access certain apps in market palce durign testing, they are blocked. THE leaks maintain the blocks, the last beta testers builds have more access and that included with aps needign compatibility testing.
    Thanks for that information.
    Does the Gingerbread update for Samsung Droid Charge come with a spell-checker?

  • I have OSX 10.7.5, my idvd is not working correctly.  Should I re-download this version again , do you think that it will help to improve the idvd operation?

    I have OSX 10.7.5 on my imac, my idvd is not working correctly.  Should I re-download this version again , do you think that it will help to improve the idvd operation?

    First, iDVD is not and never has been part of OS X. If iDVD is not working correctly, then you should investigate possible problems with that application, support files, preferences, or cache.
    Of course you can always reinstall OS X if you wish:
    Reinstalling Lion/Mountain Lion Without Erasing the Drive
    Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu.
    Reinstall Lion/Mountain Lion: Select Reinstall Lion/Mountain Lion and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.

  • Is that possible to get data from the red trace in this BMP file

    I have an instrument, which only export image file. I want use labview to replot it and do some analysis. The image file is like attachment. Is that possible to get data from the red  trace in this BMP file via labview vis?
    Attachments:
    coax312.bmp ‏4741 KB

    I looks to me that 515 pixels represents 200 meters, so multiply the
    x-values by 0.3885 meters/pixel to get the true x-values.  I don't
    have enough information to scale the y-axis.
    Randall Pursley
    Attachments:
    Compute from BMP.vi ‏66 KB

  • Why will finder not remember the window size that I set it to?

    Every time I open finder I have to drag it out to the size I want it. It will not remember the size I put it at. How do I get it to remember. MBA Mid-2011 with Lion installed 10.7.4.
    If I restart it its back to a real small size again and with a 11" MBA that is small.

    I don't think it's a Lion issue, as I have no such problems.  But the way window positions work is a bit hard to grasp, as it can depend as much on how you get a particular window open as on the folder you're choosing to view.
    If you can double-click your hard drive icon on the desktop and get the window position and view to stick, but after a restart it has forgotten that position and view when performing the same action, then you can try deleting the invisible .DS_Store file inside the relevant folder (in this case, at the root of the hard drive).

  • It says to add the shuffle to my devices list..where do I find that I cant find it in the menu

    I can't sync my daughters shuffle to my itunes account..can't find "devices" in the menu..help!

    The devices section appears in the middle of the left hand pane of iTunes when you plug your Shuffle in.
    B-rock

  • WHY do you offer new versions of Firefox without warning that bookmarks will be lost and the last backup was 10 weeks ago???????????

    Just upgraded to 3.6.3 and found that all bookmarks since April 16 (it is now June 25) are missing. I have read instructions for restoring bookmark backups but if possible would like to restore bookmarks between 4/16 and now. Restoring instructions say that I will lose those if I follow the instructions. Why was there no warning of this when the 3.6.3 upgrade was offered???? How can I get back 10 weeks' worth of bookmarks?

    I have found an incompatibility in the older revision JSON files that your bookmarks are stored in to the newer client. It could be that the new client simply can't see them as a result of this incompatibility.
    Please check the following directory for JSON files dated older than the update in May just in case: C:\Users\[YourUsername]\AppData\Roaming\Mozilla\Firefox\Profiles\[generated stuff].default\bookmarkbackups
    If you're unable to see the AppData Folder, please enable Hidden files and folder by clicking on the Organise button from any folder (located top left of window), and then the following:
    Folder & search options > View Tab > Show Hidden Files, Folders and Drives.
    If JSON files are located there, which are dated older than the update and you wish to restore them, please make a copy of this folder on your desktop, and uninstall the current revision of firefox (Temporarily). Reinstall an older revision, import the JSON file of your choosing, then export them as an HTML file, before finally upgrading back to the latest revision of Firefox. Once the latest revision of Firefox is installed again, import the HTML file, and this should restore your bookmarks.
    If an older JSON file is not available, see if there's a shadowcopy of the file by going to Computer, right click your drive, Restore previous versions, click on the date of your shadowcopy and click on open, then navigate to the same location mentioned and copy it onto your current desktop.
    If no shadowcopies are available, you could be out of luck. You could try a system restore point dating to before the update, which should roll back Firefox to the older revision, and may restore your bookmarks too, but at this point hope is sparse.
    I've experienced the same frustration myself just recently. I was able to fix the issue, and I hope the same applies in your situation o_o"

Maybe you are looking for

  • Unable to view photos after adjustments (except in preview mode)

    I upgraded to Aperture 2.0 and would like the program but for an annoying glitch. Each time I open aperture I can make edits to one or two photos without problems, but then photos start to disappear from the viewer window. There is nothing but a blan

  • How to obtain error codes from LDAP exceptions

    Is there a way to obtain the error codes returned by LDAP services. In our application, we want to give more understandable messages and solution to rectify the issues, for the exception thrown while accessing LDAP. The NamingException does not conta

  • Infopath form load rule not working in browser forms but works on Client

    Hi I am working on an Infopath form and there are rules on form load. The form load checks for a value in a list, if the username() matches the one in the list, then the form would change its view. It works when I open it on client, but on the browse

  • Item master - processing lead time vs po_asl_attributes - processing lead time

    hi. would greatly appreaciate if somebody can explain the relationshipship between mtl_system_items.processing_lead_time (item master) vs po_asl_attributes.processing_lead_time (approved suppliers list) which one takes precedence. thanks in advance z

  • Brief Overview of NI Drivers

    I would like a general overview of the NI drivers (i.e. what is the name and extension of the main driver file, does it call functions from a different .dll file, where is the location of the driver files). Right now, I am seeing drivers in different