Help explain Properties object

Hi,
can someone explain properties objects, or link me to a tutorial? I wanna understand what to do with one when i get it, etc....
i mean if i get a properties object, should i put it into another data structure (enumeration , hashtable?)??
thanks.

than can you help me here:
http://forum.java.sun.com/thread.jsp?forum=31&thread=501776
Thanks.

Similar Messages

  • Properties object help

    Hi,
    I have a properties object which has two keys. Those keys values are properties objects.
    I need to put all those values into a hashtable...is there any good way of rolling through a properties object to get the values of other properties?
    Thanks
    Craig

    A Properties object is a Hashtable. So if you have a method that takes a Hashtable, just give it the Properties object directly.
    If you want to copy the values, there is a propertyNames() method that returns an Enumeration.

  • Need help for finding objects impacted by size change for an infoobject

    hi all,
    need help for finding objects impacted by size change
    for xxx infoobject, due to some requirements, the size to be changed from
    char(4) to char(10), in the source database tables as well as adjustment
    to be done in BI side.
    this infoobject xxx is nav attribute of YYY as well as for WWW
    infoobjects. and xxx is loaded from infopkg for www infoobject load.
    now that i have to prepare an impact analysis doc for BI side.
    pls help me with what all could be impacted and what to be done as a
    solution to implement the size change.
    FYI:
    where used list for xxx infoobject - relveals these object types :
    infocubes,
    infosources,
    tranfer rules,
    DSO.
    attribute of characteristic,
    nav attribute,
    ref infoobject,
    in queries,
    in variables

    Hi Swetha,
    You will have to manually make the table adjustments in all the systems using SE14 trans since the changes done using SE14 cannot be collected in any TR.
    How to adjust tables :
    Enter the table name in SE14. For ex for any Z master data(Say ZABCD), master data table name would be /BIC/PZABCD, text table would be /BIC/TZABCD. Similarly any DSO(say ZXYZ) table name would be /BIC/AZXYZ00 etc.
    Just enter the table name in SE14 trans --> Edit --> Select the radio button "Save Data" --> Click on Activate & adjust database table.
    NOTE : Be very careful in using SE14 trans since there is possibility that the backend table could be deleted.
    How to collect the changes in TR:
    You can collect only the changes made to the IO --> When you activate, it will ask you for the TR --> Enter the correct package name & create a new TR. If it doesn't prompt you for TR, just goto Extras --> Write transport request from the IO properties Menu screen. Once these IO changes are moved successfully, then the above proceduce can be followed using SE14 trans.
    Hope it helps!
    Regards,
    Pavan

  • Problem loading PipedInputStream in Properties object

    Hi there!
    Well, I'm having some problems trying to load a PipedInputStream into a Properties object.
    First of all I read a file with FileInputStream and BufferReader and every time I find a special token it's opened a new Thread to save this piece of the whole file into a PipedInputStream/PipedOutputStream. The thing is once I have the PipedInputStream I want to load this stream into a Properties object (Properites.load(PipedInputStream pis))
    I mean....
    I have a file like this
    OBJECT = CLIENT
    NAME = JOE
    EMAIL = [email protected]
    END OBJECT = CLIENT
    END
    OBJECT = CLIENT
    NAME = ANGELINA
    EMAIL = [email protected]
    END OBJECT = CLIENT
    END
    and I want to save each CLIENT OBJECT into a Properties object. That's why every time I find the token "END" I open a new Thread and write to an PipedOutPutStream. The problem is that once the PipedInputStream is available I try to load it into the Properties but it doesn't load anything at all.I dont get any Exception, when I debug, after loading the PipedInputStream the Properties object still remain void but when I echo the stream to the console It works fine so it might not be a problem of the PipedInputStream but of Propreties.load()
    Thanks for your help!!!!!
    Here it is my code
    * DictionaryReader.java
    * Created on October 21, 2002, 5:02 PM
    import java.io.*;
    import java.util.Properties;
    import java.util.Enumeration;
    * @author
    public class DictionaryReader {
    String _filePath = null;   
    private final String _TOKEN = "END";
    /** Creates a new instance of DictionaryReader */
    public DictionaryReader(String path) {
    this._filePath = path;
    public static void main(String[] args){
    if(args.length != 1){
    System.err.println("Usage java <file path>");
    DictionaryReader dr = new DictionaryReader(args[0]);
    dr.readFile();
    private void readFile() {
    String line_ = null;
    try{
    FileInputStream in_ = new FileInputStream(_filePath);
    BufferedReader readIn_ = new BufferedReader(
    new InputStreamReader(in_));
    PipedOutputStream pout_ = new PipedOutputStream();
    PipedInputStream pin_ = new PipedInputStream(pout_);
    ReadDictionary readDictionary_ = new ReadDictionary(pin_);
    Thread t = new Thread(readDictionary_);
    t.start();
    while((line_ = readIn_.readLine()) != null){
    if(line_.trim().equals(_TOKEN)){
    pout_.close();
    pout_= new PipedOutputStream();
    pin_ = new PipedInputStream(pout_);
    readDictionary_ = new ReadDictionary(pin_);
    t = new Thread(readDictionary_);
    t.start();
    } else {
    line_ += "\n";
    pout_.write(line_.getBytes());
    System.exit(1);
    } catch (FileNotFoundException e){
    System.err.println(e.getMessage());
    } catch (IOException ioEx){
    ioEx.printStackTrace();
    * ReadDictionary.java
    * Created on October 22, 2002, 11:08 AM
    import java.io.*;
    import java.util.Properties;
    import java.util.Enumeration;
    * @author
    public class ReadDictionary implements Runnable {
    private PipedInputStream _pin;
    Properties _propFile = null;
    /** Creates a new instance of ReadDictionary */
    public ReadDictionary(PipedInputStream pin) throws IOException {
    this._pin = pin;
    public void run() {
    try {
    // Making sure that the PipedInputStream
    // has some content inside
    String line = null;
    BufferedReader read = new BufferedReader(new InputStreamReader(_pin));
    while((line=read.readLine()) != null){
    System.out.println(line);
    //Here it is the problem
    Properties prop_ = new Properties();
    prop_.load(_pin);
    Enumeration enum = prop_.elements();
    while(enum.hasMoreElements()){
    String element = (String)enum.nextElement();
    System.out.println(element);
    } catch(Exception e) {
    e.printStackTrace();
    Thanks for your help!!!!!
    Cheers,
    I�aki

    Comment out these lines of code and see what happens:// Making sure that the PipedInputStream
    // has some content inside
        String line = null;
        BufferedReader read = new BufferedReader(new InputStreamReader(_pin));
        while((line=read.readLine()) != null){
            System.out.println(line);
        }Streams tend to be readable only once and by using the reader you have read through to the end of the stream so that there is nothing left for the properties object to read. Some streams will support 'mark' so that you can 'rewind' but you're not using that here.

  • Properties object from GET

    I don't know which MQ component is requesting these three files. Are they intended for public use?
    com/sun/messaging/Destination_defaults.properties
    " Destination_types.properties
    " Destination_labels.properties
    Most importantly, how does one build a Properties object from a file fetched with GET??
    Thanks.

    Some classes look for certain property files for defaults
    and if they are not there, then some built in hard coded
    defaults are used instead.
    I'm not sure what 'features' you are adding to the mqapplet
    demo but any MQ developer (ie programmers at large) do
    not need to dissect imq.jar in the manner you appear to be
    doing - unless I am misunderstanding what you are trying to
    do.
    MQ developers only need to include the jar files that we
    distribute as part of the product in CLASSPATH (the docs should
    point out which ones are relevant). The various files inside these
    jars and their dependencies should not be a concern of the
    MQ developer. For example, the fact that various defaults/labels
    are kept in some .properties files in imq.jar is something that
    you don't need to know or care about to make your application
    work.
    hope this helps,
    -isa
    http://wwws.sun.com/software/products/message_queue

  • Persisting a properties object across the whole of my program.

    Hello all,
    As per usual, sorry for any idiocy on my part and thanks for any guidance.
    I have written a wrapper class for the Properties class.
    I have an MDI which creates a properties object and loads it at start up, and I have tried to use the same object again (to save any property changes) when the app terminates. However, I get a nullPointerException when I try and use it when the program closes. Below is what I hope are the relevant pieces of code. I don't include it all as it a couple of hundred lines long - but can easily do so if you think it will help. Many thanks once again:
    Here is the load properties method:
    private void yLoadProperties(){
            String workingDirectory = System.getProperty("user.dir");
            File yFile = new File(workingDirectory + "\\KTProperties.ini");
            YPorperties yProperties = new YPorperties(yFile);
            yProperties.yLoadProperties();
            // Retrieve application name - no conversion required
            yApplicationName = yProperties.yGetProperty("ApplicationName");
    }and here is the exit program method with the call the the save properties method
    private void yExitApplication(){
            // Save properties back to disk
            yProperties.ySaveProperties();
            // Exit
            System.exit(0);
        }I have also declared the yProperties variable thus:
    private YPorperties yProperties;
    I was hoping to use the yProperties object anywhere within my program to adjust properties as required. Any help, gratefully received.
    Steve

    That's just the way Java works. I'm sure someone is able to quote chapter and verse of the Java Language Specification that spells it out, but the basic distinction is this:
    A variable declaration has the form: <Type> <variableName> [= <value expression>];.
    A variable assignment (which assigns a value to an existing variable) has the form: <variableName> = <value expression>;
    When you specify the type of a variable, Java assumes you are declaring a new variable in the current scope, regardless of whether the name of the variable already existing in a enveloping scope. When you don't specify the type, Java will look for an existing variable with that name in the current scope and any enveloping scopes.
    In my mind, when I explicitly declared yProperties, thus:> private YPorperties yProperties;> I was making it available to the whole program.With that line you declared a member variable of type YPorperties (shouldn't that be YProperties, by the way?), which means a separate yProperties variable is available as a member of each instance of your class. Note that you already specify the type of the variable yProperties in that line, so there is no need to specify that type again when using the variable further on in your application.
    But yes, you are correct in saying that this variable would be available anywhere inside that one instance of your class. However, it is possible in Java to declare a variable with the same name in a different, narrower scope (as you have seen).
    Java looks for variables from the narrowest scope outward, so in this case it sees the local variable yProperties before it sees the member variable yProperties.
    (BTW for future reference, note that a class or an instance of a class is not a "program" as such. So declaring a private member variable does not make it available to your "program", it makes it available to an instance of a class. The fact that you use that class to start your application is irrelevant)

  • Custom component  - how to store java Properties object in ucm environment

    Hi Experts,
    I am developing a custom component.
    my custom component code is reading a properties file and load in Properties object. Everytime this custom Service is called, properties file is read from file system and new Properties Object is created.
    Is there any way to load the Properties object once and store somewhere in UCM context ? (just like we do in JSP using application object"
    thanks!!
    Edited by: user4884609 on Jul 12, 2010 3:01 PM

    I'd say there are quite a few ways how to do it, but many of them have nothing in common with UCM.
    - I'd opt for the only "UCM" way I' aware of: as a part of custom component you can create your own properties file (it's also called environment variables) as a part of your custom component. You can, then, easily read (and write?) properties from/to the file.
    - The first option could have disadvantage, if there are too many properties. In this case you could use Java serialization - it should be UCM independent
    - Another option is to create your properties in the database - it is a bit similar to the first option, but it's more robust. Plus, you may use features of the database if you want to have some additional logic in you properties.
    - Note that you can also create a static object, which could be initialized e.g during class load

  • Hot to convert a properties object to a InputStream object?

    hot to convert a properties object to a InputStream object?

    peter321 wrote:
    The two property files need further process and filter out some values. The two configuration files come from different application. I want to use java.util.logging.LogManager.readConfigure(InputStream).For the last time, you've made it clear how you want to solve some as-of-yet undescribed problem. What you haven't made clear is what problem you're trying to solve. From the class you mention, it sounds like you want to read in two logging configurations (since that's what a LogManager is for) from separate applications and "filter out some values". Those are mysterious requirements at best, and if you're intending to use LogManager to process some arbitrary properties files, you're headed down the wrong path entirely. There are [much better solutions readily available|http://commons.apache.org/configuration/].
    ~

  • BI JDBC - How to configure Helper.jdbc.properties?

    Hi,
    I am little bit confused regarding where to configure
    Helpers.jdbc.properties.
    In a new project I have placed the Helpers.java and
    exported it as a par.And from the .PAR i extracted the 
    jar file and included it in my JDBC project.
    Pl. suggest how to configure the Helper.jdbc.properties.
    regards
    Mrutyunjay

    Friends,
    Would be thankful for any hints.
    Thanks & Regards
    Mrutyunjay

  • How to save a properties object to a file / how to create a properties file

    hi,
    i am writing an application in which all the database and user information is stored in a properties object and is later retreived from it when a database connection or login etc is required.
    i wanna know how can i save this object / write it to a file i.e. how do i create a properties file.
    so that every time the application is run to create a new dbase etc the entire info regarding that will be stored in a new property file.

    Load:
    Properties p = new Properties();
    FileInputStream in = new FileInputStream("db.properties");
    p.load(p);
    String username = p.getProperty("username");
    String password = p.getProperty("password");
    // ...Save:
    String username = "user";
    String password = "pw";
    Properties p = new Properties();
    p.setProperty("username", username);
    p.setProperty("password", password);
    FileOutputStream out = new FileOutputStream("db.properties");
    p.store(out, null); // null or a String header as second argumentThe file will look something like
    username=user
    password=pw

  • Help Regarding Properties Class

    Hi folks,
    The problem is . . .
    I need to send a Properties Object over the network. I do this using DatagramPacket and DatagramSocket Utilities.
              Properties p=new Properties();
              String z=p.toString();
              byte b[]=new byte[1024];
              b=z.getBytes();
              InetAddress ia=InetAddress.getHostName("172.16.1.0");
              DatagramPacket=new DatagramPacket(b,b.length,ia,8000);
              DatagramSocket ds=new DatagramSocket();
              ds.send(dp);But the problem is at the recieving end how do I convert the string recieved into an identifiyable Property.

    I DO feel like a search engine

  • Basic actionscript help, tracing properties of my class object

    Hi all,I'm just starting to learn about classes in actionscript, I am following along with Moocks book Actionscript for Flash MX and are trying to execute a trace on the properties of my ballclass but all I get is undefined. He is what I have in my actions panel.
    function Ball () {
        this.radius = 10;
        this.color = 0xFF0000;
        this.xPosition = 59;
        this.yPosition = 15;
    var boucyBall = new Ball();
    trace (bouncyBall.radius);
    trace (bouncyBall.color);
    trace (bouncyBall.xPosition);
    trace (bouncyBall.yPosition);
    Any help would be great

    Since you are learning about classes, you might want to use one to help you:
    class Util{
    public function Util(){
    // empty constructor because you don't need one for this kind of class
    public static function traceProps(obj:Object,label:String):Void{
    if(label != undefined){
    trace(Properties for "+label+":");
    for(var a in obj){
    trace("   "+a+": "+obj[a]);
    trace(newline);
    Then place that class file somewhere in your class path so it will always be available to you. And then you can always add these lines.
    import com.complexity.Utils;
    If the file is in your class path you don't really need the above line, but it will help you remember that you are using it. Also I'm just making up what your class path might be based upon your screen name. You would need to use whatever actual path you had. And then...
    Utils.traceProps(bouncyBall,"trouble maker here");
    Of course don't use it with an 10,000 element array, unless you really like to suffer.....
    or just
    Utils.traceProps(bouncyBall);

  • Help! Smart object resolution question

    I just upgraded from CS2 to CS4. In CS2, when I placed (as a smart object) a 72 dpi image into a 300 dpi image, often it would come in enlarged to the full size of my document. But after accepting the placement and then selecting 'Transform,' the info bar at the top would tell me it was enlarged 200% (or whatever percentage it was), thus indicating the true resolution of my new smart object image. I would then scale it down so I could use it at an acceptable size.
    In CS4, it acts differently. If I place a 72 dpi smart object image into my 300 dpi image, once again it imports it blown up to the size of my window. But after placing it and hitting Transform, the percentage may say 100%, or even 60%... when I know that the smart object should be much much smaller. So what it seems is that smart objects are coming in to match physical size - and interpolating as they are placed - rather than staying true to their original resolution. I can drag the 72dpi image into the 300 dpi image and the 72 dpi image will come in physically smaller, at it's native resolution. I can then convert it to a smart object, but that's a time consuming workaround.
    Is there a preference setting I'm missing? I haven't found this problem in the forums or in help. I have tried going into my General prefs and turning off 'Resize image During Paste/Place' but all that does is bring my 72 dpi image in at it's full physical size, blown up and interpolated to a fuzzy mess. Hitting transform shows it at 100%... so no help from that.
    Hope I've explained it clearly - thanks for the help.

    > I can then convert it to a smart object, but that's a time consuming workaround.
    it's only one click on a menu.... or you could make a keyboard shortcut? it seems like much less work than changing the ppi.
    smart objects are the best feature in the suite.

  • Help explaining Code

    INSERT INTO TABLE (SELECT c.consists_of
    FROM programme_tab c WHERE programme# = 'P111')
    (SELECT REF(m) FROM module_tab m WHERE module# = 'a111' OR module# = 'a112');
    Can someone help me explain this code in plain English , it is for revision reasons

    Thanks for the help guys
    a bit more code
    create TYPE module_m;/
    CREATE TYPE programme_p;/
    CREATE OR REPLACE TYPE "ADDRESS2_T" as object(
    street varchar2(200),
    town varchar2(200),
    county char(20),
    postcode varchar2(20)
    CREATE OR REPLACE TYPE MODULE_LIST_T AS TABLE OF REF module_t;
    CREATE OR REPLACE TYPE MODULE_T as object (
    module_id char(4),
    module_title varchar2(20),
    no_credits number(2),
    is_part_of REF programme_p
    CREATE OR REPLACE TYPE "PERSON2_T" as object(
    person_id char(4),
    pname varchar2(200),
    address address2_t,
    DOB date,
    )NOT FINAL;
    CREATE OR REPLACE TYPE PROGRAMME_P AS OBJECT(
    programme_id char(4),
    programme_title varchar2(20),
    dept_id varchar2(20),
    consists_of module_list_t,
    contains student_list_t,
    MEMBER FUNCTION
    number_of_students RETURN NUMBER);
    CREATE OR REPLACE TYPE BODY PROGRAMME_P AS
    MEMBER FUNCTION number_of_students RETURN NUMBER IS
    Value NUMBER;
    BEGIN
    Value:=SELF.consists_of.count;
    RETURN value;
    END;
    END;
    CREATE OR REPLACE TYPE STUDENT_LIST_T AS TABLE OF REF student_t;
    CREATE OR REPLACE TYPE STUDENT_T UNDER person2_t (
    is_enrolled_on REF programme_p,
    MEMBER FUNCTION
    age RETURN NUMBER
    )FINAL;
    CREATE OR REPLACE TYPE BODY STUDENT_T AS
    MEMBER FUNCTION age RETURN NUMBER IS
    Value NUMBER;
    BEGIN
    Value := (SYSDATE -self.dob)/365;
    RETURN value;
    END;
    END;
    CREATE TABLE MODULE_TAB OF MODULE_T
    (     SCOPE FOR ("IS_PART_OF") IS "PROGRAMME_TAB" ,
         PRIMARY KEY ("MODULE_ID") ENABLE
    CREATE TABLE PERSON2_TAB OF PERSON2_T
    ( pname PRIMARY KEY);
    CREATE TABLE PROGRAMME_TAB OF PROGRAMME_P
    (PRIMARY KEY programme_id)
    NESTED TABLE CONSISTS_OF STORE AS MODULE_NEST_TAB;
    CREATE TABLE PROGRAMME_TAB OF PROGRAMME_P
    (PRIMARY KEY programme_id)
    NESTED TABLE CONTAINS STORE AS STUDENT_NEST_TAB;
    yes its using nested tables, I have a pdf that explains to a degree but am looking for a real idiots (not dummies) guide to object orientated approach to database within oracle
    the code works to a degree using sqlplus but if i try the graphical interface ,shows no table data
    regards

  • I just upgraded to CP 5. Need help with drawing objects.

    I am trying to put a simple drawing object around a word.  Like a square.  I can't figure out how to not have any fill, just the outline of the box.  Any suggestions?  I was able to do this in CP 4.

    Hi there
    Personally, I'd use a Highlight Box to accomplish this. But that's just me.
    Here are the steps for a square drawing object. I'll assume you have already inserted the object and placed it and all you want are instructions for dealing with the fill.
    Look inside the properties inspector at the Fill & Stroke section. Click the Fill color and configure Alpha to 0%.
    Cheers... Rick
    Helpful and Handy Links
    Begin learning Captivate 5 moments from now! $29.95
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcererStone Blog
    Captivate eBooks

Maybe you are looking for