Convertion of the properties file

Hi,
Does any one knows, how to convert the WLS 5.1 properties file to WLS 6.0 version. i cannot see the convert link on the default console that comes up.
Thanks,

Something to that effect at least. :) Don't have the code in front of me, but figured you would get the idea, as obviously there is more to code, especially if you want to put getting of resource items in a separate class like I did.
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class PropertyParser {
     public static final String VERSION = "1.0";
     PropertyParser() {
          super();
      * @param res     Properties file name
      * @param key     Property key
      * @return string value of the requested property
     public static String getString(String res, String key) {
          try {
               return ResourceBundle.getBundle(res.trim()).getString(key.trim());
          } catch (MissingResourceException e) {
               return '!' + key + '!';
}Just took the auto generated class when you externalize strings to .properties file and customized a bit.
This way I can use one call to get any property from any file I have in classpath (e.g. PropertyParser.getString("file1","key") or PropertyParser.getString("file2","key")).
Hope that helps.

Similar Messages

  • I have Adobe Photoshop Elements 10 plus I create PDF files for work some are scan pdf docs. When I install Photoshop Elements 10 it DOES convert all the PDF files to Photoshop Elements-10 Docs. it even changes and shows the PSE-10 Icon. So I am alway inst

    I have Adobe Photoshop Elements 10 plus I create PDF files for work some are scan pdf docs. When I install Photoshop Elements 10 it DOES convert all the PDF files to Photoshop Elements-10 Docs. it even changes and shows the PSE-10 Icon. So I am alway installing PSE-10 or uninstalling it. If I send the  PDF file that has been automatically converted to a PSE-10 the person I send the file to can not open it because they do not have PSE-10. What can I do to stop PSE-10 from converting my PDF files? Don't tell me to upgrade PSE-10 I tried their on-line program and  it is too advance for a hobby photographer like myself and their Help Desk is impossible to reach.

    Hi,
    Can you please share the logs?
    You can use the Adobe  Log Collector tool (Log Collector Tool) and share the corresponding zip file @ [email protected]
    Thanks,
    Shikha

  • How to read the properties file available in Server File structure in webdy

    hi all,
    I have developed one webdynpro application. In this application i need to access mdm server to continue. For getting the connection i need to pass the IP addresses.
    Can i have code  how to read the properties file which is residing in the server file. with out included along with the application. keeping some where in the file structure in the server. I want to read that properties file by  maintain the iP addresses and users in  properties file based on the key i want to read like below.
    servername="abcServer"
    username="john"
    password="test123"
    Please send me the code how to read this properties file from the file structure and how to read this values by key  in webdynpro application
    Regards
    Vijay

    Hi Vijay,
    You can try this piece of code too:
    Properties props = new Properties();
    //try retrieve data from file
    //catch exception in case properties file does not exist
    try {
             props.load(new FileInputStream("c:\property\Test.properties")); //File location
             String serverName = props.getProperty("servername"); //Similarly, you can access the other properties
             if(serverName==null)
               //....do appropriate handling
         }     catch(IOException e)
                   e.printStackTrace();
    Regards,
    Alka.

  • Problem storing special characters (\, \n etc.) in the Properties file

    Hello,
    I am trying to store a string that contains special characters like \, \n, which are normally escaped using a \ character. If I try to save the Properties object into a file (using the store() method call), it doesn't store these escape characters as they are. The following is what I am trying to do:
    Properties p = new Properties();
    String samp = "This string will have a \\ and a newline \ncharacter";
    p.setProperty( "sample", samp );
    p.store( new FileOutputStream( "/path/to/my/file" ) );I am trying to achieve the following result:
    sample=This string will have a \ and a newline
    characterBut, instead, I get this:
    sample=This string will have a \\ and a newline \\\ncharacterCan somebody help me with this problem?
    Thanks,

    Thanks for your replies and efforts to help me out. I
    guess there is no solution to my unique problem.
    Basically I need this because one of my values (for a
    key) is a multi-line value. It will probably load
    fine when I use the \ character to delimit multiple
    lines, but when I want to write back the same value
    as multiple lines (using \ and \n characters), I am
    unable to do that. I don't follow, or else if you're saying what I think you are, I disagree.
    Let's say you have a String in your program that contains some \n characters, so if you print that string, say with println, on a Unix terminal, you'll see it on separate lines.
    Now you write that string out to a properties file with store().
    Forget how it looks in the props file. Consider that opaque, a black box.
    Now you use load() to get it back from the properties file. It will be re-created in its original form, so if you print it out on a unix terminal, you'll again see multiple lines. The fact that it's all on one line in the .properties file doesn't affect that.
    Now, if you want it to appear on multiple lines in the props file, then we're back to my previous post--you're breaking the format that load expects.
    At least, that's my understanding of how it works. I might be mistaken, but I think I've tested this very thing in the not-too-distant past.

  • How can i locate the properties files within a ejb container?

    when i develop servlet+javabean structure application,in order to imploement decoupling,i
    would like to write the config information in the properties files(key-value pair),in
    servlet,i use "getResourceAsStream(String relativePath)" method to retrieve the
    configuration information from the properties files(i even write the SQL clause
    in the files),it alwsys works well.
    now,i want to implement such function within the ejb container,that is to read
    a properties file from session bean,but i don't know how can i locate the file
    within the ejb container by using relative path,i wonder if there is the same
    method within ejb container as "getResourceAsStream(.......)" method within servlet
    container?
    thanks for any helps!
    the code snippet is appreciated!

    In general, you should look at using environment entries (variables) in the
    deployment descriptors (both the war and EJB jar rather than properties
    files for configuring J2EE applications. The reasons for this are many:
    1. This is the official way to do it according to the spec. Properties
    files are the J2SE way of doing things
    2. As you note, that it's not obvious how you would (legally) read a
    properties file inside an EJB.
    3. It's consistent between the web and EJB part of your code
    4. the weblogic console and tools have good capabilities to edit these
    fields.
    Kent
    "zhebincong" <[email protected]> wrote in message
    news:[email protected]..
    >
    when i develop servlet+javabean structure application,in order toimploement decoupling,i
    would like to write the config information in the propertiesfiles(key-value pair),in
    servlet,i use "getResourceAsStream(String relativePath)" method toretrieve the
    configuration information from the properties files(i even write the SQLclause
    in the files),it alwsys works well.
    now,i want to implement such function within the ejb container,that is toread
    a properties file from session bean,but i don't know how can i locate thefile
    within the ejb container by using relative path,i wonder if there is thesame
    method within ejb container as "getResourceAsStream(.......)" methodwithin servlet
    container?
    thanks for any helps!
    the code snippet is appreciated!

  • Externalizing the Properties file in JSF

    Hi,
    I want to access a properties file located in "C:\" drive in JSF.
    In case if i move the file to some "D:\" location, only changing its path
    should work for me. Is there anyway of externalizing the properties file
    rather than keeping it in WEB-INF?
    Thanks in advance

    It depends on how the code is written.
    I assume you're calling the files using the ResourceBundle.getResourceBundle method: if you do this during the initialization (server startup) you need just to restart the ejb module to make it re-read the files.
    I'm quite in a similar situation (WAS4, lots of .properties)and every time I make some changes to my files I need to restart the applications in order to make them read such modifications.
    In no case you should redeploy the ejb module (if this is the case, there must be something wrong somewhere else...)
    bye

  • Where does the properties file go?

    Hi Folks!
    I'm trying to load a system properties file (myproperties.txt) using the example in java.sun.com. I just want to know where the properties file goes.
    The example is as follows:
    =========================
    import java.io.FileInputStream;
    import java.util.Properties;
    public class PropertiesTest {
    public static void main(String[] args) throws Exception {
    // set up new properties object
         // from file "myProperties.txt"
    FileInputStream propFile = new FileInputStream("myProperties.txt");
    Properties p = new Properties(System.getProperties());
    p.load(propFile);
    // set the system properties
    System.setProperties(p);
         // display new properties
    System.getProperties().list(System.out);
    =======================
    Could someone tell me where the file should physically reside (C:\..\..\).
    Also, is it possible to get the path dynamically by using getRealPath() instead of hard coding the file path in the code..
    Thanks for your assistance!
    Dranim

    The properties file goes where you want it to go. Just make sure you give it the full path.
    To make it dynamic, just make it a parameter.
    java myProg "c:\\temp\\MyProp.txt"

  • Where to put the properties file

    I am a new user of NetBeans6.0, I am making a simple application for user registration. I have coded everything but when I run project I get error caused by the dao.properties file load problem.
    I have put the dao.properties file inside the classes directory(where all java class files are build after running the project) of my web application directory( I didn't create this directory though, it is automatically created by IDE), I think there is a problem with its path.
    where should I put the dao.properties file so that when I run the project the Tomcat automatically find it and also, what the settings I should do?
    actually, I have referred to BalusC'd  DAO tutorial: the data layer but that comes in use when we are working off the IDEs, In my case since I am using Netbeans so it may be different from that one.
    if someone already done that then please let me know

    ok, but will it work if I upload the project in a remote host?
    lets talk besides IDE, as in your DAO tutorial you have instructed to put the properties file somewhere in root of the classpaths. ok, it will work on a local computer cause there is classpath setting but since remote host doesn't know about that property file and we cant set classpath at remote host(I am not sure though if we can) then how will it work at remote host.
    how the server at remote host comes to know about that property file?
    In my case since I have made the project using IDE and everything regarding classpaths have been set automatically(IDE done itself), but at remote host these sort of settings are not done then how the project will run?
    if I have described my problem incorrectly then please consider it as it is supposed to be.

  • Itunes plays purchased HD videos fine, but constantly stalls while trying to play home created videos converted to the same file format and bit rate?

    Itunes plays purchased HD videos fine, but constantly stalls while trying to play home created videos converted to the same file format and bit rate.
    System specs
    Win 7pro x64
    ATI 5830
    Phenom x6 1055t
    8gigs ram
    1tb 7200rpm sata hdd
    500 gig 5400 rpm sata hdd

    Itunes plays purchased HD videos fine, but constantly stalls while trying to play home created videos converted to the same file format and bit rate.
    System specs
    Win 7pro x64
    ATI 5830
    Phenom x6 1055t
    8gigs ram
    1tb 7200rpm sata hdd
    500 gig 5400 rpm sata hdd

  • Text editor used to type the contents of the properties file

    ******To all those (expect iainsinclair) who view this message - Sorry for using this forum for my personal contacts **********
    Hi iainsinclair
    Thanx for explaining ur experience to me for my previous posted topic . U did mentioned a text editor called NETBEANS PROPERTY TEXT EDITOR .
    * Can u please explain more about this editor . Is this editor specific to some encodings ....
    * U said that as u enter the Japanese characters in ur keyboard the editor saves the characters in the unicode format. Are the characters displayed in their glyphs or as \u????.
    * Can u give me a list of languages f or which this text editor can be used . Bcoz u had suggested that it can be used for chinese also .
    * I need more info about a Japanese Computer and keyboard. I think we both are in the same level in this topic I18N . Iam working for I18N project in my company. This is my official mail ID- [email protected] .Can u send me ur mail Id so that we make sure that this forum members are not disturbed by our discussion .

    Hi, I'm happy if I can help.
    * Can u please explain more about this editor . Is this editor specific to some encodings ....
    It's the netbeans IDE from www.netbeans.org it's a free integrated development environment for java. It includes many editors, for .java files, .properties files and many others. It is designed to accept text in the non-ascii format and convert it for use in properties files.
    * U said that as u enter the Japanese characters in ur keyboard the editor saves the characters in the unicode format. Are the characters displayed in their glyphs or as \u????.
    They are saved as ascii characters, not glyphs. For example, I entered MSGothic (MS&#12468;&#12471;&#12483;&#12463;) in japanese using net beans and it looks like this when I use a normal text editor: MS\u30B4\u30B7\u30C3\u30AF
    * Can u give me a list of languages f or which this text editor can be used . Bcoz u had suggested that it can be used for chinese also .
    It should work for any language that your windows/linux system has support for (need the right fonts for a start). My system is native japanese, so I have all the required japanese fonts installed. If you want to use (for example) Chinese on an English system, you'll have to get the fonts and probably you will need to modify the jre/lib/font.properties file.
    * I need more info about a Japanese Computer and keyboard. I think we both are in the same level in this topic I18N . Iam working for I18N project in my company. This is my official mail ID- [email protected] .Can u send me ur mail Id so that we make sure that this forum members are not disturbed by our discussion .
    I don't think it's disturbing anyone. Forums are all about sharing information, and there is a lack of experience of I18N in the broader comminity, I feel. This isn't a busy forum... ;-)
    Don't forget to look for the article written by John O'Conner called 'Displaying Text' I don't have the URL handy but it was posted on this forum recently. It's required reading.

  • ITUnes converted all the wav files on my computer to m4a. How do I recover them?

    iTunes took it upon itself to convert all of the .wav music files on my computer to .m4a, a much lower-quality format. How can I get the .wav files back?

    Hi someonefromminnesota,
    Depending on how the tracks were imported/converted, the original .wav files may still be located in their original location, and an .m4a copy may have been added to the iTunes Library. You may find the following article helpful:
    iTunes 11 for Windows: Import music and video already on your computer
    http://support.apple.com/kb/PH12493
    iTunes: How to convert a song to a different file format
    http://support.apple.com/kb/HT1550
    Regards,
    - Brenden

  • To Read the contents of the properties file which is located in webserver

    Hi,
    I have one requirement where I have to read the contents of a property file which is located in some path in server. Say for example, when you click on link abcd then contents of abcd.properties file should be displayed in one text view in webdynpro . I am trying to implement this in webdynpro for java. The main thing is like I am not able to retrieve the server path of the file and hence not getting the file contents. I tried using methods like  getApplicationPath() or getRealPath() but its not working. So can you guys please help me on to how to read the server file contents.
    Thanks and regards,
    Sai

    Hi Romano,
    Thanks a lot for your reply. However, I forgot to mention one thing in my question. Its like the path will be different everytime. Say, we have systems like development, acceptance, production. So when the user clicks on the link abcd, it should take the path of development system and similarly when the user clicks on the link in acceptance or production, the path will be different. say for example, in development the path will be
    usr/cluster/dev/abcd.properties but it acceptance it will be usr/cluster/acc/abcd.properties. So just want to know whether this will work? Anyway, I will give this a try.
    Thanks once again,
    Sai

  • Weblogic Classpath setting error not able to pick the properties file

    Hi All,
    We are using a third party jar and create a java Web service on the top of that jar. This jar file need two configuration file .properties and .xml when we deploy war for the application into weblogic server it will give file not found error. Though this file already exists inside the .war but from the application it is not able to pick the files.
    We find that these file need to be put in weblogic domain home and we put it there and application works.
    I decompile the jar and found that inside java class they use FileReader("allXXX.xml") path and when I Google it and found that it will pick the file from weblogic domain directory.
    The issue is that we need to put properties file in specific weblogic folder like /3party/config by setting the class path inside startWebLogic.cmd. Please let us know solution for same
    Thanks in advance
    Edited by: sb**** on Mar 19, 2012 9:08 AM

    Hi , I am also facing the similer issue. I am deploying war file of my Spring MVC application , but its not picking resource bundle .properties files from one of the configuration file.
    <bean id="PropertiesRepository"
              class="LanguageBasedPropertiesRepository">
              <property name="propertiesFiles">
                   <map>
                        <entry key="en" value="classpath:/exceptionMessages.properties" />
                        <entry key="es" value="classpath:/exceptionMessages_es.properties" />
                        <entry key="default" value="classpath:/exceptionMessages.properties" />
                   </map>
              </property>
         </bean>
    Please let me know how we can modify this to make it work.
    thanks .

  • How do I convert all the video files in Aperture to M4V?

    Hi,
          I have alot of video files stored in my Aperture Library in various formats i.e. vob, avi, mpg etc which I would like to batch encode to the standard MP4 format used by iPad/iphone. How do I do this with the new file replacing the existing file so that I don't have to import it again into its various events which will be next to impossible.
    Thanking you,
    rgowani

    Afaik, you cannot.  I did this with one Library with several hundred videos.  I set up a system of exporting and converting and importing into the proper Project(s) and deleting the originals.  I don't remember how I did it -- sorry -- I may have exported into Finder Folders based on Projects, then batch converted the files recursively.  I know I couldn't automate parts of the process, so for some things there was nothing to do but labor through the process file by file (or Project by Project).  I suspect I used Name Mangler along the way -- an excellent (and to me invaluable) utility.  I think the whole process, including design, took about 8 person-hours.  Video conversion was over the course of several nights.  Strongly suggest mapping your tasks, and doing a dry run.  As with all digital files, never even open one with a verified back-up.
    How many movies in Aperture?  How many Projects?

  • Have been lost, all the properties files in the CM repository (FSDB mode)

    Hi,
    I encountered the following problem: lost all descriptions to folders and files in the CM repository, which is connected to the FSDB mode. This happened as follows. At desired time connection to the server where the repository was broken, after some time the link was restored, but the repository was not available. After this portal has been restarted, and the repository to work, but lost all completed file properties, including the description.
    How do I return all the description files?

    Hi Stanislav,
    Has this issue been resolved?
    If not then the only way to restore this lost metadata would be a be restore, see sap notes 900571 and 737877 for more details.
    Regards,
    Lorcan.

Maybe you are looking for