Property file usage help please !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

hi there
i need some help on using property file, please. i have a package that contains many directories and classes. in one the directory, there is a property file: properties. and some of the classes need to access information in the file. how can i use ResourceBundle or Property objects to read the file? this is my guessing :
//code....................................
ResourceBundle.getBundle("D:\\tomc\\wowExchangeProject\\soaptest\\src\\com\\wowgao\\uddi\\db\\properties.properties").getString("implementation");
and:
//code....................................
File f=new File( configFile );
if( f.exists()) {
Properties props=new Properties();
props.load( new FileInputStream(f));
DBClassName = props.getProperty("implementation");
i must use absolute path for the file. what if i need to distribute the package on other machine that does not have D drive. how can change it so that i can deploy it on any machine? thanks

hi there
i need some help on using property file, please. i
have a package that contains many directories and
classes. in one the directory, there is a property
file: properties. and some of the classes need to
access information in the file. how can i use
ResourceBundle or Property objects to read the file?
this is my guessing :
//code....................................
ResourceBundle.getBundle("D:\\tomc\\wowExchangeProject\
soaptest\\src\\com\\wowgao\\uddi\\db\\properties.proper
ies").getString("implementation");
and:
//code....................................
File f=new File( configFile );
if( f.exists()) {
Properties props=new Properties();
props.load( new FileInputStream(f));
DBClassName =
ame = props.getProperty("implementation");
i must use absolute path for the file. what if i need
to distribute the package on other machine that does
not have D drive. how can change it so that i can
deploy it on any machine? thanksHi!
Let�s say you have the following structure:
- com/props/props.properties
You can use any class inside the classloader that loaded this package to do the following:
InputStrean in = <classname>.class.getResourceAsStream("/com/props/props.properties");
Properties props = new Properties();
props.load(in);
Hope this can help you. Any doubts just ask!
MSB

Similar Messages

  • I can't load raw files from a Leica d-lux 6. Says it's an unsupported file. Help please!

    I cannot load raw files from a Leica d-lux 6.  Aperture says it's an unsupported file.  How do I get it to be a supported file?  Help, please!

    What is your Aperture version? Here is the list of supported raw formats for Aperture 3, see: Apple - Aperture - Technical Specifications - RAW Support
    Your camera is not on the list. Use the software that came with your camera to convert your raw files to dng or tiff images; then you can import the images into Aperture and work with them, while waiting for Apple to release raw support for your camera. Or shoot raw+jpeg pairs and use the jpeg while you are waiting.
    Is Mac OS X (10.5.1) really your current operating system? Then you may need to upgrade, when Apple finally releases raw support for your camera. The newest raw support required Aperture 3.4. to be installed.
    Regards
    Léonie

  • How to fix the download arrow. Won't show me recent downloads even though I would have downloaded a file. Help please.

    I recently downloaded a zip file and when I unzipped the file my arrow stopped showing me recent downloads. It will show the effect of me clicking but won't show any files that I may have recently downloaded. Please help as this is the fastest way for me to do my schooling and work when I am given documents.

    If the list attached to the arrow is cleared, does the link "Show All Downloads" appear and let you view the earlier downloads? The keyboard shortcut for that is Ctrl+j if you are a keyboard person.

  • How to Export a HIGH QUALITY .avi file.  help PLEASE

    Hi, I am trying to export my movie to an avi file, so I can upload it on youtube. I've done some searches online, but have not found any answers that work. I keep getting very low image quality, no matter what settings I choose. I've gone into quicktime preferences and saved the file in "high quality" and that doesn't work. How can I export a movie file with the same image quality as the original project? I'm using Explicit to split the file into two parts, but it can only handle .avi files. Please help!
    zaike

    Ah, I just converted it with the wrong compressor. I used DV/DVCPRO-NTSC prog. scan and it looks beautiful.

  • IMovie wont accept .mov files. Help please.

    I have imported a bunch of movie files from my digital camera. They are now in IPhoto and everything is fine. I would like to import them into IMovie to do some editing but for some reason it will not accept the file. Does anyone know what I am doing wrong? All of the files i am trying to move into IMovie are .mov files. Shouldnt they work? Please help.

    Does anyone know what I am doing wrong? All of the files i am trying to move into IMovie are .mov files. Shouldnt they work?
    Not necessarily. MOV is a generic file container -- not a compression format. It can hold any audio and video compression format combination compatible with the QT structure and currently installed QT components. (Even WMV content can be placed in an MOV container.) Unfortunately, iMovie '08 will only import files containing compression formats that it can edit "natively." Kodak digital cameras, for instance, tend to favor MPEG4/µ-Law compression. And, while the MPEG-4 video is compatible with iMovie '08, the µ-Law 2:1 audio compression is not. To import an MOV file, both audio and video compression must be compatible. In the case of the MPEG4/µ-Law file, only the audio format has to be converted to make the file compatible. One way to do this is to use GarageBand to access the "Movie to MPEG-4" export option and "Pass through" the video which converting the audio to AAC -- mono 64 kbps at 44.1 kHz will work here -- and place both in an MP4 container. Another method is to simply convert both audio and video to compatible formats using a converter of your choice.

  • Why can i not get my files? help please!

    I used to have a macbook, running snow leopard, always up to date etc, and it was full of pictures, movies, music, all of which I backed up onto a shiny new time capsule.
    cut to roughly 6 months later, the hard drive on my macbook dies, but i think it's all ok, i have it all in my time machine. no problem.
    I was wrong.
    I decided it was time to buy me a new laptop, so now have a macbook pro. very nice. however, it seems that I am unable to migrate any files. almost like they are not even there
    what can I do? i live in the UAE and haven't found anyone able to help me. i am in distress. music can be replaced, my iphoto album can not... i'm devastated.

    have you seen these user tips:
    http://web.me.com/pondini/Time_Machine/14.html
    http://web.me.com/pondini/Time_Machine/15.html
    JGG

  • Iweb - Grayed out File menu - Help please!

    Hi, I am traveling away from home on a 3 week trip. I started up iweb on the plane yesterday and it wouldn't let me start a new page, or add anything. It is all grayed out. Is there something I am doing wrong?
    Problem is I don't have my ilife disk if I need to reload the software. Any way to fix this problem with out reloading? Anywhere I can get it online?
    thanks,
    Jess
    PowerBook G4   Mac OS X (10.4.8)   ilife '06 purchased in August

    Hi jessica,
    This could be a problem of not having the iweb 1.1.1 update.
    Which do you have?
    Also if you have the latest 1.1.2 but didn't get the 1.1.1.....welll go back and get 1.1.1
    See if this helps or is even an issue w/ your setup.
    Good luck
    Please report back
    jabberwock

  • Error Code 1120 access of undefined property...help please

    I am fairly new to Flash - I have CS4 and am not sure if I am in the right place to get help.
    I am trying to build a click through gallery with small buttons that you click on and it switches the larger image out as you click through.
    I copied over a gallery I had successfully built with 10 images.  The new gallery has 20 images.
    Basically the movie just runs continuously without being able to click on the thumbnails.
    I am getting the following compiler errors
    Scene1 Layer 'actions', Frame 1, Line 42 1120:Access of undefined property btn11_btn Source - btn11_btn.addEventListener(MouseEvent.CLICK, showimage11);
    I get this for image 11 through 20
    The following is my code
    stop();
    btn1_btn.addEventListener(MouseEvent.MOUSE_OVER, showimage1);
    function showimage1(event:MouseEvent):void {
    gotoAndPlay("label1");
    btn2_btn.addEventListener(MouseEvent.CLICK, showimage2);
    function showimage2(event:MouseEvent):void {
    gotoAndPlay("label2");
    btn3_btn.addEventListener(MouseEvent.CLICK, showimage3);
    function showimage3(event:MouseEvent):void {
    gotoAndPlay("label3");
    btn4_btn.addEventListener(MouseEvent.CLICK, showimage4);
    function showimage4(event:MouseEvent):void {
    gotoAndPlay("label4");
    btn5_btn.addEventListener(MouseEvent.CLICK, showimage5);
    function showimage5(event:MouseEvent):void {
    gotoAndPlay("label5");
    btn6_btn.addEventListener(MouseEvent.CLICK, showimage6);
    function showimage6(event:MouseEvent):void {
    gotoAndPlay("label6");
    btn7_btn.addEventListener(MouseEvent.CLICK, showimage7);
    function showimage7(event:MouseEvent):void {
    gotoAndPlay("label7");
    btn8_btn.addEventListener(MouseEvent.CLICK, showimage8);
    function showimage8(event:MouseEvent):void {
    gotoAndPlay("label8");
    btn9_btn.addEventListener(MouseEvent.CLICK, showimage9);
    function showimage9(event:MouseEvent):void {
    gotoAndPlay("label9");
    btn10_btn.addEventListener(MouseEvent.CLICK, showimage10);
    function showimage10(event:MouseEvent):void {
    gotoAndPlay("label10");
    btn11_btn.addEventListener(MouseEvent.CLICK, showimage11);
    function showimage11(event:MouseEvent):void {
    gotoAndPlay("label11");
    btn12_btn.addEventListener(MouseEvent.CLICK, showimage12);
    function showimage12(event:MouseEvent):void {
    gotoAndPlay("label12");
    btn13_btn.addEventListener(MouseEvent.CLICK, showimage13);
    function showimage13(event:MouseEvent):void {
    gotoAndPlay("label31");
    btn14_btn.addEventListener(MouseEvent.CLICK, showimage14);
    function showimage14(event:MouseEvent):void {
    gotoAndPlay("label14");
    btn15_btn.addEventListener(MouseEvent.CLICK, showimage15);
    function showimage15(event:MouseEvent):void {
    gotoAndPlay("label15");
    btn16_btn.addEventListener(MouseEvent.CLICK, showimage16);
    function showimage16(event:MouseEvent):void {
    gotoAndPlay("label16");
    btn17_btn.addEventListener(MouseEvent.CLICK, showimage17);
    function showimage17(event:MouseEvent):void {
    gotoAndPlay("label17");
    btn18_btn.addEventListener(MouseEvent.CLICK, showimage18);
    function showimage18(event:MouseEvent):void {
    gotoAndPlay("label18");
    btn19_btn.addEventListener(MouseEvent.CLICK, showimage19);
    function showimage19(event:MouseEvent):void {
    gotoAndPlay("label19");
    btn20_btn.addEventListener(MouseEvent.CLICK, showimage20);
    function showimage20(event:MouseEvent):void {
    gotoAndPlay("label20");
    Any advice would be great
    I dont know if I have to start from scratch - which would be a pain for sure
    Thanks

    I feel foolish - I solved my own problem!
    I figured out that I had not given buttons 11 - 20 an instance name
    Once I did that - voila problem solved
    Sorry for bothering you all.

  • Need iPhoto/Elements file system help please

    I have over 8000 photos in various albums in iPhoto 9.
    Some photos show up in multiple albums. I assume the various album pics are linked to the one actual picture file on the hard drive.
    If I export one album at a time to Elements, will It actually save multiple copies of the same file on the hard drive?
    Thanks for your help!
    Len

    iPhoto'09 allows you to import the albums/events selectively. However iPhoto'011 does not allow that from Elements Organizer.
    In iPhoto'09. if you have organized your photos without selecting the preference of copying files in iPhoto library during import, which means, your iPhoto library keeps the references of the images. In such case if you import from iPhoto into Elements Organizer, organizer does not create separate copies.
    But yeah in case of iPhoto'011, it does.
    ~V

  • Im unable to remove songs by swiping left from right or deleting the usage. help please?

    I updated my phone to ios7 a while back and manage to fix majority/most of the bugs. Now the music is messed up. i've already tried the swipe thing and deleting the usage and nothing has work. Some of the songs wont come off my phone and i dont know how else i could remove it. Help?

    my phone started playing a song randomly while it was tucked away in my bag and I was in a crowded elevator. It was very embarrassing.
    Yes, that Barry Manilow elevator music is a bit embarrassing (sorry, just couldn't resist that).
    Have you tried resetting your iPhone in iTunes and then restore just those items you want back?

  • Program not executing in jar file. Help please.

    I went through the tutorial about jars on the sun website and i created a jar file with a hello world program like this:
    "cd E:\Batch
    jar cfm test.jar m.txt test.class
    PAUSE"
    My m.txt contains this text:
    "Main-Class: test.class"
    The jar file is created. No errors.
    Then i try and run the jar with this:
    "cd E:\Batch
    java -jar test.jar
    PAUSE"
    I get "NoClassDefFoundError: test/class"
    All the dos command are run form batch files and everything is in the same directory.
    I've searched around google and this website for answers but i have failed to find anything.
    Does anyone have any suggestions i can try to fix this? I've ran out of ideas.

    Ah thats what the problem was. That was driving me
    mad thanks. So whatever you put in a jar file must be
    in a package or you can't run it.
    Message was edited by:
    JahvahNo. You can also not put it in a package, but when you specify the main-class attribute in the manifest file, be sure that you don't tell it that it is in a package.

  • When Firefox last automatically updated, it suggested that Adobe reader needed updating, now, with Adobe Reader 8, I can no longer print from the internet, only to file. Help please.

    When Mozilla Firefox last automatically updated, it suggested that Adobe Reader needed updating. After updating to Adobe Reader 8, I can no longer print from the internet, only to a file. I know the printer and its interface must be OK because Word prints normally.

    Problem solved, it was my oversight, I had not removed the check from the Print to File box in the print set up.

  • PARSING HTML ELEMNETS IN XML FILE?,Help please very urgent

    I am getting the input in this form
    <ul>
    <li>Strategies</li>
    <li>Planning</li>
    <li>Value</li>
    <li>Total Investment</li>
    </ul>
    I want to convert it into below format so that ContentHandler parse the HTML tages.The HTML elements are dynamic,
    contentHandler.startElement("", "ul", "ul", attrs);
    contentHandler.startElement("", "li", "li", attrs);
    contentHandler.characters(value.toCharArray(), 0, value.length());
    contentHandler.startElement("", "li", "li", attrs);
    contentHandler.startElement("", "li", "li", attrs);
    contentHandler.characters(value.toCharArray(), 0, value.length());
    contentHandler.startElement("", "li", "li", attrs);
    contentHandler.startElement("", "li", "li", attrs);
    contentHandler.characters(value.toCharArray(), 0, value.length());
    contentHandler.startElement("", "li", "li", attrs);
    contentHandler.startElement("", "li", "li", attrs);
    contentHandler.characters(value.toCharArray(), 0, value.length());
    contentHandler.startElement("", "li", "li", attrs);
    contentHandler.endElement("", "ul", "ul");
    Is their any library through which we can convert HTML tags into ContentHandler elements.
    Thanks in Advance
    Thanks
    Lakhi

    Actually i am parsing XML file,but i have HTML elements inside XML elements:
    <section id='2'><header><line>Agenda( Slide2 )</line></header>
    <line>
    <h3>Agenda</h3>
    <ol>
    <li>Overview of ABC Company inc.</li>
    <li>Defining and Measuring Employee Engagement</li>
    <li>Foresight's Survey Methodology</li>
    <li>Online Tools</li>
    <li>Standard and Custom Reporting Capabilities</li>
    <li>Action Planning and Best Practices</li>
    </ol></line></section>
    And i am using Contenthandler interface to parse,
              attrs.addCDATAAttribute("id",""+i);
                   contentHandler.startElement("", "section", "section", attrs);
                   attrs.clear();
                   contentHandler.startElement("", "header", "header", attrs);
                   contentHandler.startElement("", "line", "line", attrs);
                   contentHandler.characters(key.toCharArray(), 0, key.length());
                   contentHandler.endElement("", "line", "line");
                   contentHandler.endElement("", "header", "header");
                   contentHandler.startElement("", "line", "line", attrs);
    /*HERE I need to Generate java instruction for HTML elements as i mailed before.for elements like <li>Overview of ABC Company inc.</li>
    <li>Defining and Measuring Employee Engagement</li>...................</ol>
                   contentHandler.characters(value.toCharArray(), 0, value.length());
                   contentHandler.endElement("", "line", "line");
                   contentHandler.endElement("", "section", "section");

  • I don't know how to zip a file. Help please.

    I am trying to send an attachment with an email. The attachment is too big and my email program won't send it. I want to zip the attachment to make it smaller. How do I do this? Thanks very much.

    Be aware if you try to compress media files or images then you probably won't be able to reduce the size much as such files do not compress very well.
    In such a case it is better to upload the file to one of the many available file hosting sites and send the links instead.
    * https://www.yousendit.com/
    * http://www.snapdrive.net/
    * http://www.imageshack.us/

  • Moved user - files missing - help please

    My hard drive is about full so I installed a second, much bigger drive. I want to keep the small drive as the boot drive and use the new drive for data. So..... I moved the user files to the new drive. Now lots of file, most importantly some pictures, are missing. How do I tell the system where to look?
    Thank You

    I have not continued to use the computer at all. I shut it down when I discovered the problem and have been using a different computer to access these boards.
    How did I end up with empty folders? I don't know, doesn't make sense to me. All I can tell you is what I did.
    First I moved the entire user folder from the small drive to the large drive. Then I spot checked folders and files inside the user folder hierarchy on the large drive.
    When everything appeard to be there, I deleted the user folder on the small drive and shut down the computer.
    Later, I discovered the empty folders on the large drive.
    So, after attempting data recovery, I probably will reinstall the system. That brings me to a whole new set of questions.
    How do I change where Safari, or FireFox writes the cache?
    How do I change where the OS X diskUtility save data in preparation to burn a disk?
    How do I install the system so that the system files and possibly the applications and utilites are on the small drive, but all data files, including the user folders and all cacheing files, are on the large drive?
    What data recovery and/or disk maintenance software do you recommend? ( I can't see the link you mentioned.)
    I'm familiar with Unix, but forget it underlies OS X. Else I might not have tried to just move the user folder.
    Thanks
    Thanks

Maybe you are looking for

  • In iOS 7, how do you clear the "Missed" section of the Notification Center?

    The "Missed" seciton doesn't have the Clear button like the "Recent" seciton does, and I can't seem to get rid of the missed calls in that list. I even went as far as to erase all my missed and recent phone calls in the Phone list, but the notificati

  • EJB classpath problem when refering a DAO in library jar file

    Hi When I tried to deploy an EJB jar file in 10g which references the DAO for getting database[SQL Server2000] query results.Its not retriving data nor throwing any exceptions.Other DAO business methods which do not access database are working well.

  • DVD plays on one TV DVD player, but not on another

    I made a video for a client's 50th b-day party, and burned it with DVDSP 3. I am using Verbatim, DatalifePlus 16x media. It plays fine on my G5 and my TV's DVD player, as well as on my clients computer, but not on his TV's DVD player. I am not sure w

  • Group Vote only one group

    Hi, I'm designing a human task where there needs to be a group vote of the users of only one group. If I select Group Vote, group -> "Name of the Group", the task is sent to the users of the group. One of them claims it and answers for the all group.

  • Conversion from 1/2 Case to full case

    Hi, I have a reporting requirement where I need to provide user with flexibility to report on 2 different levels. For example there is a material with 12 packs. The actual unit of measurement is 24packs for a case.So 12 packs form 1/2 case. If there