Where to place .ini file?

Hello All,
I have a file "trap.ini"
now where i should this file so that
properties.load(new FileInputStream("trap.ini")); should be able to read it.
m i making any mistake?

my trap.ini is at location C:\trap\config\trap.ini
and this is included in my classpath...
still its giving me error... I am using JBOSS as application server.. I am running my servlet on JBOSS and my servlet needs to read "trap.ini"
is thr any way in which i can provide that file to JBOSS server in eclipse..?
Thank you for helping me

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.

  • Where are the *.ini files located?

    I remember a discussion about deleting some of the *.ini files (or whatever they are called) but I can't find the link, don't remember the filenames and can't find their location.
    I'm having the same problem with Media Encoder where it only goes partway through an encode and then returns an error message. The last time I experienced that, I deleted the startup files and things worked fine. I think that there was a link from Dennis Draeke about some config files and their location.
    All help gratefully accepted!
    TIA,

    After experiencing the situation where a codec (LEAD MJPG) that had worked previously suddenly would not export through AME again, I tracked down the preferences files as outlined above and removed the following files:
    Adobe Premiere Pro Prefs,
    Adobe Premiere Pro Prefs~2
    AMEPrefs.xml
    And once again I could export with any codec settings I chose with no problems.
    I'm working with 1280x720, 30P, square pixels, 44.1kHz, 16-bit stereo material.
    When not working, the encode would proceed about 1/2- to 2/3 of the way through and then stop and return the message:
    - Preset Used: 1280x720P TX-1 Settings - LEAD Codec
    - Video: 1280x720, 30 [fps], Progressive, Quality 90
    - Audio: 44100 Hz, Stereo, 16 bit
    - Bitrate:
    - Encoding Time: 00:15:27
    4/10/2010 2:56:50 PM : Encoding Failed
    Error compiling movie.
    Codec compression error.
    This codec may be unable to support the requested frame size, or there may be a hardware or memory problem.
    After removing those three files, encoding would finish properly and return the message:
      - Preset Used: 1280x720P TX-1 Settings - LEAD Codec
    - Video: 1280x720, 30 [fps], Progressive, Quality 90
    - Audio: 44100 Hz, Stereo, 16 bit
    - Bitrate:
    - Encoding Time: 00:03:09
    4/11/2010 1:39:31 PM : File Successfully Encoded
    4/11/2010 1:39:31 PM : Queue Stopped
    Thought I'd post the results in case it might help help someone solve a problem.

  • Where to place HTMl files in  tomcat while executing Servlets examples ?

    Hi,
    I'm learning servelets (HttpServlets). in that input is given through html files.now i dont know where to place that html file in apache tomcat server
    This is my Directry Structure
    Java's ---- C:\Program Files\Java\jdk1.5.0\bin
    Tomcat's--C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ThreeParams extends HttpServlet
    public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException, IOException
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String title = "Reading Three Request Parameters";
    String docType ="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +"Transitional//EN\">\n";
    out.println(docType +"<HTML>\n" +"<HEAD><TITLE>" + title + "</TITLE></HEAD>\n" +"<BODY BGCOLOR=\"#FDF5E6\">\n" +"<H1 ALIGN=\"CENTER\">" + title + "</H1>\n" +"<UL>\n" +" <LI><B>param1</B>: "+ request.getParameter("param1") + "\n" +" <LI><B>param2</B>: "+ request.getParameter("param2") + "\n" +" <LI><B>param3</B>: "+ request.getParameter("param3") + "\n" +"</UL>\n" +"</BODY></HTML>");
    }HTML code ---
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD><TITLE>Collecting Three Parameters</TITLE></HEAD>
    <BODY BGCOLOR="#FDF5E6">
    <H1 ALIGN="CENTER">Collecting Three Parameters</H1>
    <FORM ACTION="ACTION="C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\root\WEB-INF\classes.ThreeParams">
    First Parameter: <INPUT TYPE="TEXT" NAME="param1"><BR>
    Second Parameter: <INPUT TYPE="TEXT" NAME="param2"><BR>
    Third Parameter: <INPUT TYPE="TEXT" NAME="param3"><BR>
    <CENTER><INPUT TYPE="SUBMIT"></CENTER>
    </FORM>
    </BODY></HTML>
    {code}
    servlet code is compiling without any errors, now where should i place the class file and html file in tomcat to execute this program..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    webapps\yourapplicationname\WEB-INF\

  • Where to place    text file in  Jdeveloper9irc  to read from Java program

    For ex.
    package mypackage;
    import java.io.*;
    public class ReadData
    public ReadData()
    public static void main(String[] args)
    new ReadData();
    try{
    File fin = new File("test.txt");
    if (fin.canRead())
    System.out.println("Can read file");
    I am geting a error message of file not found. Please advise
    in which directory should I place the text file "test.txt" so that the java program can read from it.
    Thanks,
    agsp

    The test.txt file should be in the 'Run Directory" of your Project. Select Project.jpr and invoke Project settings dialog.
    Click on the Runner. You will see the "Run Directory" edit field.
    For ex.
    package mypackage;
    import java.io.*;
    public class ReadData
    public ReadData()
    public static void main(String[] args)
    new ReadData();
    try{
    File fin = new File("test.txt");
    if (fin.canRead())
    System.out.println("Can read file");
    I am geting a error message of file not found. Please advise
    in which directory should I place the text file "test.txt" so that the java program can read from it.
    Thanks,
    agsp

  • Where to place lib files so my task adapter can find it?

    I am currently getting the error": java.lang.NoClassDefFoundError:". I would like to add my lib files so my java adapter code can find it. Thanks

    If they are jar files that wont ever change, you can put them in your ThirdParty folder and use the upload jar utility. If that doesn't work, you will need to add them to your oim server startup parameters so it knows about the jar.
    -Kevin

  • Where to put javascript files.

    I am working in Apex 4.0.
    I have found javascript code titled accounting.js. It is available at http://josscrowcroft.github.com/accounting.js/
    The instruction on use of the code are as follows:
    "Download the script and put it somewhere, then do this:
    <script src="path/to/accounting.js"></script>
    <script type="text/javascript">
         // You can do this now:
         accounting.formatMoney(5318008);
    </script>"
    The accounting.js file is over 30,000 characters. Where do I put it so that I can reference it from any page in my application?
    Then what do I need to do on a page where I want to use it?

    You have two options. Both involve modifying your page template to include the file, but you have options on where to place the file.
    1) Place it in the images folder in your application server, and refer to it using the IMAGE_PREFIX substitution string
    <script src="#IMAGE_PREFIX#accounting.js" type="text/javascript"></script>2) Upload it into your Apex repository as a workspace file (Shared Components -> Static Files) and access it from the database.
    <script src="#WORKSPACE_IMAGES#accounting.js" type="text/javascript"></script>Scott

  • Where Can the Preference Settings to place in the .INI File Found

    I can not find a lot of the settings that are found on the drop down list under the Menu item Edit - Preferences. Specifically I am looking for the setting to stop Acrobat asking clients to update. I know it can be done manually. I deliver Acrobat over the company network to thousands of clients of which my helpdesk cannot go to everyone of them. Where is the setting found. In the .ini file or in the registry and what is the actual code to be placed in the .ini file or the HKey in the registry?

    Here's how to find various registry keys:
    1. Open RegEdit. Navigate to HKCU and Export The Adobe Acrobat hive under the Software/Adobe key. Close regedit
    2. Launch Acrobat and make your preference change.
    3. Open Regedit again and export the Adobe Acrobat hive again. Us a program that can compare text and find the change thats was made.

  • Where to place files and folder in shared disk over WAN

    Hello, I have a new Airport Time Capsule 3TB and I want to share my disk over WAN for remote accessing.
    When I log to the server with my MacBook or iPhone, I see "Data" folder, and inside it I see my Time Machine backups.
    My question is: where, -in the Time Capsule disk-, do I have to place the files / folders that I want to share over WAN. I am afraid to damage or corrupt my Time Capsule backups.
    Thank you in advance.

    It is not possible to partition the Time Capsule drive.....unless you.....
    Pull the drive from the Time Capsule case....(voids the warranty)
    Install the drive in a separate enclosure or caddy
    Connect the enclosure directly to your Mac
    Use Disk Utility to partition the drive
    Reinstall the drive back in the Time Capsule
    This is a lot of work....and should best be left to a technician.
    All things considered, it would be better if you dedicated the Time Capsule for Time Machine backups only...and added another drive for your shared file needs, but few users seem willing to do this.

  • Where are settings stored (foldeer/ini file/Registry)? Backup settings poss

    Where are the settings of SQL Developer stored?
    Is this a folder, an *.ini file or the Registry?
    If it is a folder: Can I change the location of the folder?
    If yes: Where exactly?
    How can I otherwise export/save settings otherwise?
    Peter

    In your home directory will be created a path like ...\SQL Developer\system1.5.4.59.40
    There SQL developer stores the local data.
    You can change this path (here ...my_options/system) with th following line in the sqldeveloper.conf, located in path ...\sqldeveloper\sqldeveloper\bin:
    # This is to enforce storing of configuration information in the "/my_options/system"
    # subfolder I have created in the SQL-Developer installation directory (instead
    # of in the "C:\Documents and Settings\<user>\Application Data\SQL Developer"),
    # so that SQL-Developer installation directory can be just copied to another
    # location (e.g. a stick) and along with the configuration information.
    AddVMOption -Dide.user.dir=../../my_options/system
    Thanks to Juri W. for this solution!
    Before changing the path you should save your connection and custom report - settings via right click -> export in the connection and custom report view, I had to reimport these settings after movimg my directory.
    Gerhard

  • Where can I find tools for manipulati​ng .INI files?

    Doesn't LabVIEW have some VIs somewhere for manipulating .INI files?
    Or is that another add-on toolset where NI nickles and dimes you for it?

    bmihura wrote:
    Doesn't LabVIEW have some VIs somewhere for manipulating .INI files?
    Yes.  Functions>File IO>Configuration File VIs.
    Openg's toolkit has some useful additions (and for << a nickel).
    http://www.openg.org/content/section/4/41/
    =====================================================
    Fading out. " ... J. Arthur Rank on gong."

  • Where to place an xml file that is read by  java class file  dir structure

    Hello all,
    I have an xml file that I am using in lieu of a database to track conference rooms . This is a small file. I need to read this file from my java class file which is used by a jsp. Currently I have an absolute path C://logger/conference.xml. All works fine but I need to deploy to a different machine soon and so I need to place this file somewhere in the project directory structure (created by netbeans) so that it will be included in the war file and can be read by the java class file.
    Also what would be the relative path to this suggested directory.
    TIA!!!

    public class DOMconference {
        /** Creates a new instance of DOMconference */
        public DOMconference() { }
        //private final static String XML_FILE_NAME = "/opt/conference.xml";//set the output file and location
        public String XML_FILE_NAME = "";
        private final static String FIRST_CONF_ID = "8200";//set the initial conference number
        static Document document;
        public void getFilePath(String path)
            XML_FILE_NAME = path.replaceAll("\\\\","/");
            System.out.println("XML==============="+XML_FILE_NAME);
        File file = new File(XML_FILE_NAME);
        *generic method that returns a Document object
       public Document getDocument() throws SAXException, ParserConfigurationException,
               IOException
           DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
           factory.setIgnoringComments(true);
           factory.setCoalescing(true);
           factory.setNamespaceAware(false);
           factory.setValidating(false);
           DocumentBuilder builder = factory.newDocumentBuilder();
           document = builder.parse(file);   //HERE IS WHERE THE ERROR POINT S TO
           return document;
       }Here is the complete error:
    INFO: Server startup in 1282 ms
    XML===============C:/Documents and Settings/gforte/agi/build/web/WEB-INF/conference.xml
    [Fatal Error] bin:1:1: Content is not allowed in prolog.
    org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:264)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:172)
    at agi.DOMconference.getDocument(DOMconference.java:91)
    at agi.DOMconference.getLdapConferences(DOMconference.java:466)
    at agi.Ldap.getConferences(Ldap.java:243)
    at org.apache.jsp.test_jsp._jspService(test_jsp.java:111)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)
    [Fatal Error] bin:1:1: Content is not allowed in prolog.
    NotifyUtil::java.net.SocketException: Software caused connection abort: recv failed
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:313)
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:606)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:554)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:571)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:936)
    at org.netbeans.modules.web.monitor.server.NotifyUtil$RecordSender.run(NotifyUtil.java:248)
    So if I change my code to this (note that all I change is how the constant XML_FILE_NAME is set and I copy and paste the path that is derived from getFilePath after the String.replaceAll call.):
    public class DOMconference {
        /** Creates a new instance of DOMconference */
        public DOMconference() { }
        private final static String XML_FILE_NAME = "C:/Documents and Settings/gforte/agi/build/web/WEB-INF/conference.xml";//set the output file and location
        //public String XML_FILE_NAME = "";
        private final static String FIRST_CONF_ID = "8200";//set the initial conference number
        static Document document;
        public void getFilePath(String path)
            //XML_FILE_NAME = path;//.replaceAll("\\\\","/");
            System.out.println("XML==============="+XML_FILE_NAME);
        File file = new File(XML_FILE_NAME);
        *generic method that returns a Document object
       public Document getDocument() throws SAXException, ParserConfigurationException,
               IOException
           DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
           factory.setIgnoringComments(true);
           factory.setCoalescing(true);
           factory.setNamespaceAware(false);
           factory.setValidating(false);
           DocumentBuilder builder = factory.newDocumentBuilder();
           document = builder.parse(file);
           return document;
       }All is fine..
    Just in case, here is my xml file contents copy and paste from notepad.
    <?xml version="1.0"?><conf_rooms><conf_room><conf_id>8200</conf_id><conf_name>Conference room 1</conf_name></conf_room><conf_room><conf_id>8201</conf_id><conf_name>Conference Room 2</conf_name></conf_room><conf_room><conf_id>8202</conf_id><conf_name>dufus</conf_name></conf_room></conf_rooms>Thanks for hanging in there with me on this.
    Graham

  • A cleaning utility deleted my browsing history! My fault! I want to re-open the old pages and tabs. The info may be in an old "sessionstore.js" or "places.sqlite" file but these are huge and some URLS are written backwards. Where do I start please?

    I have copied "places.sqlite" and given it a .txt extension, then opened in Wordpad - but it's huge - I don't know what order it's in and many of the URLS are written backwards - like "moc.smooretal.www" instead of "www.laterooms.com."
    Similarly there are several numbered versions of sessionstore.js in the profile and these can be opened with a text editor too. But if I simply substitute the current sessionstore.js file with an older (numbered) one in the profile, Firefox seems to ignore it.
    So:
    1. Is there a method of re-installing the "history" sites list or "previously opened pages and tabs" from the 'places.sqlite' file, or from a previous sessionstore.js file (and if so how do I go about it ?)
    2. If not, is there an alternative source of browsing history back-up which I can use or
    3. If not that either, is there at least a way of reversing the backwards text so I can read the URLs and copy/paste them?
    All knowledgeable help much appreciated.
    Thank you in advance,
    Peter

    Firefox has other backups it makes automatically, unfortunately your cleaning utility may have wiped them.
    #First step backup manually whatever you have
    #*''' edit''' <s>[[backing up and restoring backups]]</s><br/> [[backing up and restoring bookmarks]]
    #Second step find and copy all of your profile folder and all the sub files and sub folders
    ## easiest method of finding it is <br> Help -> Troubleshooting Information -> Profile [Open containing folder] <br/>The places.sqlite is a database that contains all your bookmarks and history, if this exists and is not corrupt then your bookmarks library should work and allow you to create backups.
    ##*see [[backing up your information]]
    ## put it somewhere safe your Windows desktop will do
    .JSON files are the backup files, either created manually or by firefox
    sessionstore.js files probably are of little use to you, containing only the tabs & windows from recent close downs, not the full history and bookarks.
    Now that any existing files are safe try to see if any backups exist that firefox created automatically
    * these would be in a folder within the profile
    * they can most easily be used by opening the bookmarks library, as explained in the article linked above.
    You may be interested in
    * http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox {Locked or damaged places.sqlite]
    There are sqlite editors available, including some as add-ons for firefox.

  • Where should I place graphic files?

    Setting up a new machine with external Sonnet drives. Should I place non time code files such as graphics, Motion files, music, etc. on the external drives? Or is it OK to place these files on an internal drive? Also, best place for render files, auto save, and thumbnail folders? Really appreciate any input.
    Thanks again,
    Tom

    There is no single correct answer to this. I store graphics files on a non-boot internal drive volume, inside a folder at the top level named, imaginatively Graphics, sub-foldered by project names.
    Likewise, at the same level, I have a folder named Music Cuts, and, also arranged in folders by project names, individual folders with the music inside. I also have a folder named Audio, which contains, inside project folders, VOs and SFX.
    I hope that makes sense.
    Periodically, I will drag the Graphics, Music, and Audio folders to a CD (or DVD, when the folders get too large for a CD), along with the FCP Projects folder from the boot volume. (As with the others, project files are organized in folders named with the project names), and burn the disc for archival purposes. I label the disc with the date and the names of the top level folders.
    From time to time, I will delete all aged files and folders that haven't seen any use in a good long while. By that time, I have several copies of them on several discs.
    Many years ago, I did the same thing, but back then I was saving to a 3.5" floppy. That's how old my practice is.

  • Placing of properties.ini file

    Hi
    where should i place my properties.ini file inside an EAR, so a simple class can read it ?
    I tried put it in the package of the class who read it but I get an FileNotFoundException.
    thanks

    Hi
    where should i place my properties.ini file inside an
    EAR, so a simple class can read it ?"properties.ini"? Why not "xyz.properties" like everyone else uses?
    Anyway, store it in any of your application JARs.
    I tried put it in the package of the class who read
    it but I get an FileNotFoundException.You're not supposed to use direct File IO in J2EE. Use Class.getResourceAsStream(), together with Properties.load().

Maybe you are looking for