How to access the values of the properties file

Hello

I use Jdeveloper 11.1.2.2

I need to get some of the values of the properties file to use in a java class.

How can I access the .properties file and the values in them.

Thank you
Nigel.

Nigel,
If you are using FileReader, you must specify the actual path where the file is located. In your sample, the file must be in "/ foundation/model/am/view/Test.propeties". I guess that you don't have this access path on your system as it look like the path to your source folder.

I use the ResourceAsStream like this:
Create a file de.hahn.testproxy.backingbeans.test.properties with the following content:

Test=hallo
Test2=world

the path is relative my source in the test project path.

Then, I implemented a listener like:

    private static ADFLogger _logger =
        ADFLogger.createADFLogger(XxyyzzBean.class);
    public void propertiesTestListner(ActionEvent actionEvent) {
        // instead of using the de.hahn.testproxy.backingbeans.test.properties you have to use de/hahn/testproxy/backingbeans/test.properties
        InputStream asStream =
            this.getClass().getClassLoader().getResourceAsStream("de/hahn/testproxy/backingbeans/test.properties");
        if (asStream == null) {
            // file not found
            _logger.info("file not found");
            return;
        }
        Properties p = new Properties();
        try {
            p.load(asStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
        if (!p.isEmpty()) {
            _logger.info("Properties: " + p.toString());
        }
    }

and get the result if I bind the listener to a button in the user interface:

Properties: {Test = hallo, Test2 = world}

And make sure that the Test.properties file is copied to the output directory.

Timo

Tags: Java

Similar Questions

  • How to access the textedit files in Icloud on time machine

    Hi all

    Bad, I need your help! I'm trying to access all my text edit files, which I had saved on ICloud.
    My laptop does not run successfully. I was proposed to restore and re - install the op system. So I run a Machine back up full time and I restored my laptop. I should all have backed up, right?
    Problem is: I'm trying to get all my work on Tex Edit, but I can't find it on Time Machine. Does anyone know how can I recover these files? I have two important years of drafting work there!
    It would be good to have your suggestion.

    Thanks in advance for your help

    Did you you save the files in the correct format - OS X Server: how to modify the configuration files - Apple support?

  • How to access the photo files in the Finder?

    I just updated my system to the picture and I can't access my images in the Finder - the show in Finder option file is not available. What should I do?

    The new Photos.app does not reveal the photos managed in the Finder, like iPhoto does.

    You can only reveal image referenced in the Finder, you manage yourself and have not been copied to the photo library.

    If you want to access the original image files that you have imported, use "file > export" save a copy on your desktop.

    The management of the files of origin in the Photos is much more complicated than in iPhoto, so it make much sense to reveal the originals. Photos can simultaneously have several copies of them--in the masters, in iCloud folder or in a folder with temporary items. And if you use "Optimize Mac Storage", there may be no files to reveal to all, because the only copy will be in iCloud and not on your Mac.

  • How to access the CSS files for the plugin Enkitec-database file directory navigation bar

    Apex 4.2.3.00.08

    Enkitec-NavBar-1-2-0-for-4-2

    Hi I am faced with the same question that: https://community.oracle.com/thread/2563229

    Enkitec vertical list Navbar appears momentarily until it is formatted by CSS and it seems OK.

    It is really annoying and makes pages look stupid. This problem is identified as a performance problem and can be solved by putting the support of Plugin files in directories of files instead of the database.

    I created a directory on the database server: D:\102175\Kav\Plugin

    I created a Directory pointing to the file directory database:

    CREATE or REPLACE directory PLUGIN AS "D:\102175\Kav\Plugin".

    GRANT READ THE PLUGIN DIRECTORY TO THE PUBLIC;

    GRANT READ THE PLUGIN DIRECTORY TO ANONYMOUS.

    GRANT READ THE PLUGIN DIRECTORY FOR UTVIKLING.

    I also copied the CSS etc support plugin files in the files directory.

    In the Apex plugin I changed the prefix 'file' #PLUGIN_PREFIX # D:\102175\Kav\Plugin

    Now all the Navbar formatting disappeared and now the navigation bar appears only in form of vertical list.

    I also tried to use the PLUGIN as 'File prefix' same thing.

    I'm not Apex or Web expert so I'm sure there is something that I misunderstood.

    Hope some of you are able to help out me.

    Sincerely

    Arild

    Hmmm, well it does not matter if you do the mapping. The embedded PL/SQL gateway is well integrated in the database in PL/SQL.  All your resources (images, CSS, javascript, etc.) are still be extracted from the base in order to be served to the client. Those in the file system are not in use after installation.

    This is going to be heavy.

    I think you may still be able to make some optimizations by moving the assets of plugin for a name that is mapped by the gateway.

    In your apex installation, take a look at apxldimg.sql see how records and assets are added.  You can then add the plugin files.

    See if that helps.

    In addition, you can follow the comments of Patrick on the post you are referencing and move the inclusion of files to the top of the page AND change the plugin so it does ' t add any more files.  Now in theory, you can skip the download folder and the image and add the plugin assets as standard apex post and reference them with #WORKSPACE_IMAGES # #APP_IMAGES, or # (if you add specifically for an application). But you still want to include them at the top of the page.

    Sorry... I know it's a lot of things to take and much heavier than expected.

    Thank you

    -Jorge

  • How to access the properties of the ListItemComponent Page in QML

    Hello

    I'm new to BB10 development. I need help for the problem mentioned (in red) below

    {Page}

    ID: page

    property storage storage / / this is a C++ class that is registered for access from pages QML

    {Of container

    {To ListView

    listItemComponents: {ListItemComponent}

    {CustomListItem}

    ImageButton {}

    text: "Save."

    onClicked: {}

    Storage.Save)

    I am not able to get the reference of the storage property defined in the Page. It is always [NULL], I get the mention very well outside the ListView

    }}}}}}

    PS: I only provided the necessary code

    I found the solution

    added CustomListItem id as

    ID: customCell

    now

    customCell.ListView.view.parent.parent.storage

  • How to access the PHP files

    Need to access PHP (.ctp) files with Dreamweaver and SEO attributes.  For example, wanting to "Insert" Meta Keywords.  The files accesses I have these fields 'greyed out', they are not available.  Is there a particular configuration in Dreamweaver to access download to a Web site with shirts programmed into the cake (.) PHP)


    Using DreamWeaver on Mac OSX 10.9.4

    You do not have my point. Dreamweaver can work with PHP, but files not files of CAKE.

  • How to access the files from google docs?

    Hello

    can someone tell me how to access the mp3 files saved on google docs.

    as I am able to recover google docs docs files.

               connection = (HttpConnection) Connector.open("http://docs.google.com/feeds/documents/private/full/-/document");
                connection.setRequestMethod(HttpConnection.GET);
                connection.setRequestProperty("Authorization", auth);
                connection.setRequestProperty("Content-type","application/atom+xml");
    

    but the mp3 files do not appear in the xml only doc files are listed?

    any idea how to get mp3 files?

    Thankx

    @Sannyo: agree with you.

    I also saw that. This is only the docs.

    ------------------------------------------------------------------------------------
    Kudo press to say thank you to the developer.
    Also, press accept it as a button when you got the Solution.

  • How to access the value of the point of application in javascript

    How to access the value of the point of application in javascript?

    Hello

    A way

    var myVariable = '&MY_APP_ITEM.';
    

    BR, Jari

  • To access the properties of the controls from other mxml components

    Yet to learn Flex and if this question seems trival please bear with me.

    What I have to do is access the properties of a control in the file main mxlm, but the control is in a separate mxml file.

    The scenerio is that I have a checkbox in the chkbox.mxml file. I need to know the value of the selected property, so that it is accessible to me in the main mxml file where I use this property to determine how to navigate the application.

    Thank you

    Hmmm

    something like

    If (parentApplication.myCheckbox.selected == true) {}
    to do this
    }

    or even

    If (application. Application.myCheckbox.selected == true) {}
    to do this
    }

    does it work?

  • How to access the sbRIO DIO pin

    Hello

    How to access the pin the sbRIO DIO.

    I enclose the code. According to the code of the indicator DIO2 is supposed to blink, but it is not happenning. Can someone please review the issue and let me know (ASAP) where I was wrong?

    P.S Its URGENT!

    Your FPGA code is more complex that it should be.  Something like this will do what you want.

    Now your RT code... You are simply flashing the fater LED that you can see.  While some expected between your output setting.  I would also use a shift register to store the current value and then just reverse.  In this way, that you have only 1 entry per loop.

  • Multiple column trees: how to access the data in columns? There is a bug?

    Hello

    I have a strange problem. I use tree column multi like this:

    In this case, I have the tree column and two other custom columns.

    Now, how to access the data in the SECOND column?

    We can write all the data in a row thanks the EditElementTree:AddElement:ChildText, because it is an array of strings.

    However, when I want to read the data, I use ActiveCelltring, meaning that a SINGLE string and not a string table oO (so I only have the value of the first column and never others.

    So, I can do what I want? Is this a bug?

    Thank you very much

    R0b1n

    OK, I have the solution.

    We play with the ActiveColumnNumber attribute, to read the values of different...

    I left the message, it may be useful for later someboby

    R0b1n

  • How to access the url of the page referred by using script Idoc?

    How to access the url of the page mentioned by using Idoc script...

    For example

    If the following url (http://myhost/mysite) is called by the end-user, it redirects to the UCM login page.

    The page of connection, so I want to get their hands on the referring here (http://myhost/mysite). To do this, I followed the following documentation.

    I put IdcAuthExtraRequestParams = referer in

    /base_domain/UCM/CS/bin/intradoc.cfg and

    /base_domain/UCM/CS/config/config.cfg

    UCM server restarted and Http server.

    Used < $HTTP_REFERER$ > in my htm file. It does not display anything.

    Can I know what went wrong? Is there an alternative way to get this?

    @Jon, I saw some variables such as ssOrignialUrl have the information in the console, but they are lost when its consultation: in page.

    I pulled out the tracedump to the page itself, which gave me a new variable<$AUTH_TARGET_URL$> that contains this value.

    Thanks Jon at made me think so

  • How to use the properties bar to select the highlight color options?

    I saw on a forum how to open the properties bar that provides easier access to switch between the different colors of highlighting.  I managed to do it once, but now the property bar just says no: "no current selection.  How to pull up the other highlighting options?

    I use Adobe Acrobat Reader DC

    2015 release Version 2015.009.20077

    Hi Travis,

    Try opening the pdf again once-> select highlight text and press "CTRL + E" to open the properties bar.

    This helps?

    Kind regards

    Rahul Tyagi

  • How to access the attributes of VO through binding...

    I have a lookup table that has 2 columns namely encode and attrib.

    I created a ViewObject with SQL like:

    SELECT THE CODE, REFER TO THE STUDY_TYPE_CODES

    And he stated in an Application Module.

    Now I want to post it to the end-user as part of a selection
    that should show REFER to but returns the value CODE.

    I want to iterate the elements and generating the choices myself.
    So I tried this on my page:

    < af:selectOneChoice label = "Test" required = "true" >

    < af:forEach elements = "#{bindings." Var StudyTypeCodesVVO1.allRowsInRange}"="row">

    "< af:selectItem value =" #{row.code} "label =" #{row.describ} "id ="si3"/ >

    < / af:forEach >

    < / af:selectOneChoice >

    It gives an error. Looks like how I use
    "#{row.code}" or "#{row.describ} ' is false.  If I ' # {line} "then
    It's OK, and I could see that the line is a

    ViewRow [oracle.job.Key []]

    But I do not know how to access attributes by name 'Code' and ' means ".". " I also tried
    "#{rank." Code}"with the capital and it does not work.

    How to access the attributes 'code' and 'describe' of each line?

    Kindly help.

    Thank you.

    Check the RangeSize property on the iterator to pageDef.

    Dario

  • How to access the elements in main.mxml file ActionScript?

    I'm having problems creating a panel using the Extension Builder SDK. It seems that all the examples explain how a CS5 document using a control panel, but I found no examples of how to control the items in the Panel via ActionScript code.   Furthermore, we use CS Extension Builder SDK with Flash Builder 4.  Here's a simple example of were I'm stuck.

    I create a project Extension generator for a panel of PS named: 'CSExtensionTest '.  In the main.mxml file create a button with id = "btnPSCode".

    ****************************************************************************************** *****************************************

    File:

    hand. MXML

    ****************************************************************************************** *****************************************

    <? XML version = "1.0" encoding = "utf-8"? >

    < mx:Application

    ' xmlns:mx = ' http://www.Adobe.com/2006/MXML " " layout ="absolute" historyManagementEnabled = "false""">

    < mx:Script >

    <! [CDATA]

    [

    Bindable ]

    private var hostName:String = HostObject.mainExtension;

    []] >

    < / mx:Script >

    "" < mx:VBox height = "100%" width ="100%" verticalAlign = "middle" horizontalAlign ="center">

    " < mx:Button id ="btnPSCode"label ="PS code run"click ="CSExtensionTestPhotoshop.run ()"enabled =" hostName.indexOf{('photoshop') >-1}"/ >

    " < mx:Button id ="btnJSXCode"label ="code JSX run"click ="CSExtensionTestJSX.run ()"/ > "

    < / mx:VBox >

    < / mx:Application >

    ****************************************************************************************** *****************************************

    How can I access the properties of this element in the CSExtensionTesJSX.as file?

    ****************************************************************************************** *****************************************

    File:

    CSExtensionTesJSX.as

    ****************************************************************************************** *****************************************

    package

    {

    Import com.adobe.csxs.core.CSXSInterface;

    Import com.adobe.csxs.core.csxs_internal;

    Import com.adobe.csxs.types.SyncRequestResult;

    Import mx.binding.utils.BindingUtils;

    Import mx.core.ButtonAsset;

    Import mx.core.mx_internal;

    Import MX.utils.object_proxy;

    public class CSExtensionTestJSX

    {

    public static function run():Sub

    {

    var myCSXS:CSXSInterface = CSXSInterface.getInstance ();

    var result: SyncRequestResult = CSXSInterface.instance.evalScript ('jsxFunction');

    btnPSCode.enabled = false;

    }

    }

    }

    ****************************************************************************************** *****************************************

    I get this error:

    image001.png

    I had initially written a panel using a Flex project and was able to access the properties of the items in the file main.mxml directly.  It seems that I can't do that.  Did I miss something in the code?  Am I missing some kind of library?  I'm sorry, I'm not very experienced in the development of Adobe, but we are trying to become more involved in the development of plugins and extensions for CS5.  Any help will be greatly appreciated.

    You must pass a reference to your object main mxml in the run method. For example:

    hand. MXML:


    http://www.Adobe.com/2006/mxml"layout ="absolute"historyManagementEnabled ="false">
       
           

    [Bindable]
    private var hostName:String = HostObject.mainExtension;
               
    ]]>
       
       
           
       

    testJSX.as:

    package
    {
    import com.adobe.csxs.core.CSXSInterface;
    import com.adobe.csxs.types.SyncRequestResult;
       
    Import mx.controls.Button;

    public class testJSX
    {
    public static void run(m:main):void
    {
    var result: SyncRequestResult = CSXSInterface.instance.evalScript ("jsxFunction");
    var b:Button = m.myButton;
    }
    }
    }

    HTH.

Maybe you are looking for

  • Presario CQ60: Presario CQ60 BIOS password reset

    Hello I forgot my bios password, and after 3 failed attempts, he gave me this code 59219873, please help me!

  • IRobot and Bluetooth adapter

    I continued working on my IRobot Bluetooth project. I used the HC-06 to create a Bluetooth for IRobot jumping on the connector adapter mini din. My code Labview outputs through to a Comm port UART, but my computer has no built in Bluetooth. If I had

  • books and music together - I do have a reason?

    There is so much rich info in this community but almost too much.  I have this q and r is there already, I apologize and hope that someone could tell me. I have a new Clip + I want to use for books and music.  I have two load via drag / move (MSC mod

  • HPE 500f broken Front USB Ports. Need hardware

    I broke all my front USB ports. Does anyone know where to find replacemnts? I can't find parts in the manual or on the website of HP. Thank you.

  • Pins for bbm BBM problem

    I took an old Blackberry curve 9300 3 of my friend that I wanted to use bbm on it. I have a confusion that my friend has been using bbm on the phone. So I did the full wipe to avoid any problems. So I wanted to know if the pin of the blackberry devic