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"

Similar Messages

  • Where does the INI file reside?

    I've seen lots of forum posts on using the Properties class to read an INI file, but nothing on locating the INI file in the file system. Most of the examples use a hard-coded simplistic path (c:\temp\myapp.ini) or just the file name with no path.
    From my meager knowledge of Java, I think the INI file should be deployed in the package directory with rest of the class files for the package. At any rate, the Java class reading the INI file cannot have a hard-coded directory path since the path may vary from install to install.
    What Java statements can be used to identify the path for the run-time package? Where is the best place to place the INI file?
    Thanks,
    Paul

    You put it somewhere in your classpath, as you describe. Then this.getClass().getResourceAsStream("/myapp.ini")gets you an InputStream from which you can read its contents.

  • When I share a file to YouTube, where does the output file live? I want also to make a DVD. And is this a best practice or is there a better way?

    I want also to make a DVD, but can't see where the .mov files are.
    And is this a best practice or is there a better way to do this, such as with a master file?
    thanks,
    /john

    I would export to a file saved on your drive as h.264, same frame size. Then import that into youtube.
    I have never used FCP X to make a DVD but I assume that it will build the needed vob mpeg 2 source material for the disk.
      I used to use Toast & IDVD. Toast is great.
    To "see" the files created by FCP 10.1.1 for YouTube, rt. (control) click on the Library Icon in your Movies/show package contents/"project"/share.

  • Asha 501 - Where does the downloaded file saved?

    Hi,
    I've downloaded couple of files from the browser...I can see the files in the downloaded list of nokia browser..but cannot see the files in the memory card...
    I've downloaded ".jar" and ".jad" extension files..2 files..
    Plz help...

    Hi Singh,
    No they are not there in the downloaded folder. After downloading it prompted me to install it. I selected not to install it. I can see all the other files downloaded there but cannot see these two files.
    I again tried to download them into the browser..but this time it throws me error message 'error" and then exits...
    I guess its behaving like this because I selected the option "no" when it initially prompted me..
    I'm afraid that my phone gets virus if I connect to my system to I'm doing this way...Any other ideas....would be helpful...
    Thanks for your support...

  • I've update my iphone to the latest version thorough my itunes, but when i update my friend's iphone, it starts to redownload the whole thing again, so where does the update file goes after the 1st download?

    It seems that i have to redownload the whole 800+ MB of the update file again when i want to update my friend's iphone through my itunes, I've updated MY iphone to the latest version after very very long hours of download, and i tried updating a 2nd friend's iphone and it was very fast as the file has already been downloaded, but this problem occurs when i want to update a 3rd friend's iphone, can someone help?

    OS X:~/Library/iTunes/iPhone Software Update
    Windows XP: \Documents and Settings\username\Application Data\Apple Computer\iTunes\iPhone Software Updates
    Windows Vista & Windows 7: \Users\username\AppData\Roaming\Apple Computer\iTunes\iPhone Software Updates

  • So Where Does the Scratch Files Go

    I see that, in the events folder, there appear to be render files etc.  They seem very light after playing around with a test edit.  Has anyone observed that FCPX doesn't create as many temp render files?

    It works the same in iTunes 11 as it did in previous releases.  The "Create New Version" process creates a new file in the indicated format, and leaves the original in place.  To find the newly created one you can either look at your Recently Added playlist, or look under the Artist.

  • After ripping a CD, where does the file go?

    After I insert a CD into the drive and click "import music" from the CD diretly into iTunes, where does the actual file go on my computer?
    I use windows XP.
    If I rip a cd in windows media player or something else, the actual file goes to My Music folder, where does the file go when I do it in iTunes?
    HELP!

    Thanks for the help, but that folder only contains music i purchased and downloaded from iTunes, it doesn't include music a import from CDs using iTunes.
    Can anyone help?

  • Where does the resources bundle files need to be

    Hi All,
    Does any of you knows where all the custom resources bundle files that will be used on BCC need to be?
    I have something like this:
    BCC module /src/com/mycompany/resources/WebAppResources.properties
    But when I try to use it
    This happens
    javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute "title" with value "${activity.description}": An error occurred while getting property "description" from an instance of class atg.bizui.activity.GenericActivity (java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key manageLoyaltyProgram.description)
    I am trying to use it on a activity that will be used in the ActivityManager:
    This is what I have
    <resource-bundle>com.mycompany.resources.WebAppResources</resource-bundle>
    Do you know if I am missing somehting or putting the files on a wrong location?
    Regards,
    Obed

    Hi Shaik,
    The title of for the source is added http://i.imgur.com/a6WVxsW.png but when I click on it it throws this exception:
    javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute "value" with value "${activity.displayName}": An error occurred while getting property "displayName" from an instance of class atg.bizui.activity.GenericActivity (java.util.MissingResourceException: Can't find resource for bundle j
    ava.util.PropertyResourceBundle, key emanageLoyaltyProgram.displayName)
    meaning that the properties file is on the classpath, but my genericActivities.xml file is not able to read the properties file.
    Any suggestion?
    Regards,
    Obed

  • Where does the details of the files on usr/sap directories get saved?

    hi,
    when a (.dat) file is created by background job processing in the 'usr/sap/' directories, where does the details like last changed, last modified of these files get saved?
    which table does these detiails get saved?
    thanks,
    swamy

    Hi,
    Transaction AL11 does exactly wat you are looking for,
    it lost list of files present on the server SORTED on date and time.
    and also u can use function module EPS2_GET_DIRECTORY_LISTING which contains a date/time stamp
    Hope it helps u...

  • 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.

  • Where does the Mail cache file reside?

    My email inbox suddenly doesn't show anything newer than April 2011. The last time this happened, Apple Care walked me through deleting an AOL or Mail cache file, but I can't find it now. Where does the archived mail cache hide?

    If you have iTunes set to consolidate your Library, then yes, you have 3 copies of the movie, USB, ITunes library folder, and iPad.
    If not, then iTunes merely adds a pointer to the current location of the file, and then copies it over to the iPad.
    If the USB is removed, the movie is still technically part of the library, but will not be accessible, it will show up grayed out and not be playable.

  • (SOLVED) where does the xorg server gets the Composite file from?

    I'd like to see the list of composite combinations. Seeking on the Internet I understand that the file should be:
    /usr/share/X11/locale/en_US.UTF-8/Compose
    Where en_US.UTF-8 is my locale, but according to that file:
    <Multi_key> <underscore> <o>         : "ō"   U014D # LATIN SMALL LETTER O WITH MACRON
    I should obtain the small letter o with the macro using multi_key underscore and o. Instead I obtain this: º.
    Same problem with the
    <Multi_key> <c> <o>                  : "ǒ"   U01D2 # LATIN SMALL LETTER O WITH CARON
    If I press the keys I obtain: ©, the copyright sign...
    So... Where does the arch xorg got its Compose file? Change I change its behavior?
    Thanks.
    Last edited by ezzetabi (2009-10-10 15:25:02)

    I ignored that is was an application side issue, thanks for explanation. And indeed I was using lxterminal: the terminal emulator of lxde that is based on GTK. Using the xim input system everywhere solved the problem.
    People! Listen! Put this two lines in your .xinitrc :
    . /etc/X11/xinit/xinitrc
    export GTK_IM_MODULE=xim
    export QT_IM_MODULE=xim
    exec whatever you use
    Thanks! Cheers!
    Last edited by ezzetabi (2009-10-10 15:25:25)

  • If you sync with iCloud, where does the file go

    Some of my music is in iCloud.
    If i right click one of those tracks and 'get info' under 'where' it says it is in iCloud.
    I had all of my music on the laptop HDD, but where is it now?
    My understanding was that iCloud was a sync of what in my itunes is available in the cloud, so nothing was uploaded, so where is the original file?

    If you're a former Windows user, there many resources on Apple's web site to get yourself familiar with how Macs and OS X work.
    Here ard a few areas to spend time with
    http://www.apple.com/support/macbasics/
    http://www.apple.com/support/imac/intel/
    http://support.apple.com/videos/
    http://www.apple.com/support/osx/
    For the video tutorials, in the video search box, just type in OS X. You'll get a list of OS X video tutorials to watch  as you learn to use your iMac.
    Start with the Anatomy of a Mac video first, Then the Finder Basics video second. After you have watched and put to use these two videos, you can watch any other OS X video you want in any order.

  • 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.

  • What does the open file dialog do 'under the hood' and is there a way to simulate it

    What does the open file dialog do 'under the hood' and is there a way to simulate it?
    I have a bug in my code (that I've posted about before, here) which I can't fix at the moment, but I do have a workaround.
    Briefly, the bug:
    I call a dll from a function node, to initialise and run a spectrometer. If I start up the PC, LabVIEW and run my vi the code runs without complaint, the first call to the dll to initialise the spectrometer doesn;t return an error but the spectrometer is not detected either.
    I've tried various solutions, see the link above, and none work
    The workaround:
    If, at any time before running the code containing the function node I open an 'open file' dialog window, select the dll and click ok/hit enter then everything is fine. When I run the main code the spectrometer is detected.
    I use an express vi to open the file dialog, I specify the start path and file name as constant inputs and just click ok/hit return when the dialog pops up. I don't do anything with the dialog outputs. In fact the vi that contains the open file dialog can be run before the project containing the bug is even open.
    I have to do this everytime I turn the PC on.
    So, either
    1) Can somewone suggest a fix for the original bug?
    2) What is the easiest way to simulate the enter keypress when the open file dialog pops up
    or
    3) Can someone tell me what the open file dialog does under the hood that somehow causes the dll to work and can it be simulated in straight LabVIEW
    I suspect that the dll itself is dodgy ( I have in the past talked to the supplier but not got very far, and I will try again but I would like a quick, temporary solution too). I'm guessing that the file dialog is making some kind of check on the file, and possibly registering its presence with the OS (winXP). I tried using the file/folder exists vi to see if checking the file like that worked but no luck.
    Any help greatly appreciated.
    Dave

    Hi David
    I am very conscious about thread hijacking but this sounded like my issue so I hope you dont mind me asking about your issue. I am hoping that you have a spectrometer from the same vendor as me and its not just me seeing an Error 1097 issue. My spectrometer is from a company called Stellarnet.
    So far I have unable to get it to work with other VIs. There is one condition where I can get it to work but its no good for me.
    Case 1
    I open the VI in a fresh labview environment with no other VIs in memory. The code runs with no issue.
    Case 2
    Labview is not opened. I double click the spectrometer VI in windows explorer.  The VI opens but it fails to run resulting in Error 1097. Personally, I dont see the difference between this and Case 1 above and yet it fails.
    Case 3
    If I already have other VI's in memory and try to load the spectrometer VI and run it fails with Error 1097. This case is the one that most important to me. I have a test executive that will load test VIs dynamically and I can't get this to work. Same problem Error 1097.
    I wanted to share what I have seen with you and to let you know that maybe somebody else has the same issue. I am convinced its the DLL but the vendor dis-agreed saying it was LabVIEW. I couldn't convince him otherwise.
    Thanks in advance
    David

Maybe you are looking for