Problem with my program looking for the settings file in the wrong folder

I have been writing a simple FTP file uploader, what I want to do is be able to select the files I want to upload in windows explorer and then right click and click the menu item and it launches the program and passes the files paths that I have selected to it.
So I use this in the windows registry "C:\Program Files\Java\jre1.6.0_03\bin\java.exe -jar D:\BenFTP\BenFTP.jar %1"
It launches fine and has no problem finding the files I want to upload. The problem is that it tries to look for the settings file in the same folder that the file I am try to upload is in. Which it's not suppose to do since the settings file is in the same folder that the .jar is in.
Edited by: ColNewman on Feb 5, 2008 6:55 PM

So, you're looking for your settings file in your current working directory. There's no way to set the CWD in your registry entry (is there?) so that isn't a practical thing to do. Presumably you're using a File object or a FileReader or something? Can't do that.
One alternative is to look for the settings file in the classpath. You can get a URL to a file in the classpath like this:URL settings = this.getClass().getResource("/settings.xml");Or you can get an InputStream to read the file by using the getResourceAsStream method. You would have to make sure that your executable jar file contained a Class-Path entry that specified the right directory, because the directory the jar is contained in isn't automatically in an executable jar's classpath.
Another alternative is to ask the user where the settings file is supposed to be, and put an entry in the Preferences (java.util.prefs) to remember that location.

Similar Messages

  • I am having problem with me Iphone4, looks like the mic of my phone is not working. no one can hear me if I make a call to them

    Can any one please help me I am having problem with me Iphone4, looks like the mic of my phone is not working. no one can hear me if I make a call to them. I have tried all restoring options but no use. please help me

    The mic on my iPhone4 has just quit also. Similar symptoms to yours in that people I'm talking to hear only static or my voice very faintly. The voice/memo recorder also only really records static.
    It happened suddenly and seemed to get better after a day or two but then went completely after another day.
    I'm returning it to Vodafone New Zealand shortly but will have to wait 5-10 days for a replacement. There are NO Apple accredited means to speed this procedure up in NZ.
    We don't even have a single physical Apple Store where you could walk in and talk to a Genius.

  • Hi! having problem with aam program launch for downloading

    hi can you help me having problems downloading app I can't drag and drop and if I try to install using download link it tells me to choose the aam program I want to use.  I have successfully downloaded other apps before and dont know where to find this program really need some help with this. Thanks!

    Thanks
    for quick response
    I can access the aam now that I know what it stands for by opening the application seperately from the desktop and download. What I cant do is download from the cloud site where it is unable to locate and open the aam from there. As long as I can download I dont have a problem with it Im guessing it may well be a windows or browser issue. I will try from chrome if I it doesnt work I will let the firum know I would be interested to know whether its something Im doing or its a common issue.
    Cheers
    Helen

  • Problem with 'LS' command syntax for generating 'recursive' files list

    I'm having trouble getting a recursive (-R) directory listing of the contents of a flash drive --
    -- i.e., when I run the 'ls' command with the -R switch (in Terminal), I get either a recursive directory of what appears to be 'all volumes' (i.e., a very large file) or a zero-byte (empty) file.
    Terminal also keeps reporting "No such file or directory" but I don't know what it's referring to (it reports it with both the 'zero byte' listing and the 'large file' listing).
    Obviously, I'm making some 'syntax error' but I don't know what it is.
    Assuming the following . . .
    User = MK
    Flash drive = NO NAME
    . . . what is the correct command syntax to list only the contents of the flash drive (not 'all volumes')?
    My last try (it doesn't work) was:
    *ls -RTlp /Users/MK/Volumes/NO\ NAME > /Users/MK/Documents/flashdrive.dir*
    Thanks.

    Re: the original post, I should clarify that what I'm looking for is the syntax that will generate the recursive list of the flash drive's files +without first logging the flash drive+ (NO\ NAME) +as the working folder+.
    If I do the latter, I can get the recursive listing easily enough.
    What I haven't been able to do is generate the listing without first logging NO\ NAME as the working folder.
    Thanks.

  • HT5622 hi is there a problem with down loading apps for the i phone 4s

    having a problem tring to down load apps is any bady having the same problem

    Hello rooster1969,
    I found an article with steps you can take when you are not able to connect to the iTunes Store.  I recommend following the steps in the section titled "Troubleshooting on an iPhone, iPad, or iPod touch" in this article:
    Can't connect to the iTunes Store
    http://support.apple.com/kb/ts1368
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Having Problem with logon & logoff Triggers for the SCHEMA

    hi,
    I have created triggers "LOGOFF_TRIG" & "LOGON_TRIG" . This triggers fires each time the user SCOTT logings and logoff from the database and stores the info in table log_trig_table. Below the code of the trigger
    LOGOFF_TRIG
    CREATE OR REPLACE TRIGGER logoff_trig
    BEFORE LOGOFF ON SCHEMA
    BEGIN
         INSERT INTO log_trig_table(user_id, log_date, action)
         VALUES (USER, SYSDATE, ’Logging off’);
    END;LOGON_TRIG
    CREATE OR REPLACE TRIGGER logon_trig
    AFTER LOGON ON SCHEMA
    BEGIN
         INSERT INTO log_trig_table(user_id, log_date, action)
         VALUES (USER, SYSDATE, ’Logging on’);
    END;But whenever i m loggin off or on using the user SCOTT there seems to be nothing being updated on table log_trig_table. Why ?

    i tried the new code provided it is telling not sufficeint priviledge. But i have all the priviledges for user SCOTT.
    Also i tried putting the commit in the below code. Tried disconnect command from theSQL* Plus. this time i didnt got any ERROR but still there were no data in table log_trig_table
    CREATE OR REPLACE TRIGGER logoff_trig
       BEFORE LOGOFF
       ON SCOTT.SCHEMA
    BEGIN
       INSERT INTO log_trig_table (user_id, log_date, action)
         VALUES   (USER, SYSDATE, 'Logging off');
          commit;
    END;Below is what my requirement
    1) Create a trigger on Schema SCOTT for logon and logoff
    2) Whenever user scott is connect or disconnect the respective trigger should fire and stores the result in table log_trig_table which is in schema SCOTT

  • Problem with encoding and charset for downloading a file

    Hi guys, I have a problem and I beg for your help, I am 1000% frustrated at this point.
    I have a servlet which have to do something and give a file log to the final user. Coding the logic for that took me about 5 minutes, the problem is that the given file doesnt shows properly in notepad (Default app to open txt files). I have tried every way I have read over the internet and absolutely nothing works.
    After trying about 20 different ways fo doing this without success, this is my actual code:
    Charset def=Charset.defaultCharset();
    OutputStreamWriter out = new OutputStreamWriter(servletOutputStream,def);
    for (String registry:regList) {
    out.write(registry+"\n");
    out.close();
    the page gives the file to the user, I can download or open it, when I open it this is the result
    registry1registry2registry3registry4registry5registry6registry7...
    and I am expecting:
    registry1
    registry2
    registry3
    registry4
    registry5
    If I open it with wordpad or notepad++ the file looks fine, but I cant achieve that notepad reads it correctly. I have spent about 10 hours on this and at this point I just dont know what to do, i have tried Windows-1252, UTF-8, UTF-16, the Default one. I have tried to set this enconding on the response header with no luck. Any help will be very appreciated.
    Thanks in advance.

    >
    I have a servlet which have to do something and give a file log to the final user. Coding the logic for that took me about 5 minutes, the problem is that the given file doesnt shows properly in notepad (Default app to open txt files). I have tried every way I have read over the internet and absolutely nothing works.
    If I open it with wordpad or notepad++ the file looks fine, but I cant achieve that notepad reads it correctly. I have spent about 10 hours on this and at this point I just dont know what to do, i have tried Windows-1252, UTF-8, UTF-16, the Default one. I have tried to set this enconding on the response header with no luck. Any help will be very appreciated.
    >
    Your file likely uses *nix style line endings and use a single LF (0x0A) as the end of each line.
    Notepad doesn't recognize a single LF as the end of line; it expects CRLF (0x0D0A). The encoding isn't the issue.
    If you have to use Notepad you will need to add code to find all of the LF characters and insert a CR character in front of them.

  • Just put my i-tunes library on a 2nd hard drive, how do I easily change the location where the program looks for current songs from the C:/ drive to the new drive without going thru each song individually in the "get info" tab

    I just installed a new hard drive and transfered my i-tunes library to the new drive.  How can I make a bulk change of the location the program looks for the current songs.  I know you can do it song by song from the "get info" tab but I need to do it for all 4500 songs.  I have already changed the location that new files are stored to the new hard drive.

    The pop-up lets you connect to the library file, iTunes Library.itl, on the external drive. This will, in turn, automatically update the preference for the iTunes Media folder to be the iTunes Media or iTunes Music folder inside the iTunes folder on the external drive and it will update the locations of all the content inside the media folder so that it uses the version on the external drive.
    This works seamlessly if all iTunes content was inside the iTunes Media (or iTunes Music) folder (which was itself inside the iTunes library folder) before you moved/copied the iTunes folder. For content outside the iTunes Media folder iTunes should remain connected to the original location. These files should be consolidated (before or after the move/copy) and in addition, if available the library should be upgraded to the newer layout which places iPod Games and Mobile Applications inside the media folder instead of the library folder. (File > Library > Organize Library...)
    For split libraries there are methods to rejoin them before moving (preferred) or repairing after the fact (e.g. my script) which I can go into if needed.
    tt2

  • Downloaded the latest itunes and when i go to install it i get a message saying there is a problem with this windows installer package a program required for the install to complete could not be run, contact your support personnal or package vendor

    When `ve downloaded the latest itunes and then i go to install it i get a message saying there is a problem with this windows installer package a program required for the install to complete could not be run, contact your support personnal or package vendor any ideas anyone ? thanks

    Try the following user tip:
    "There is a problem with this Windows Installer package ..." error messages when installing iTunes for Windows

  • I have a problem with elements 8. When ever I start a new project, the program searches for the old, latest used filmmaterial, I have used before. That means, if I use a different DVD, it take so much time, until the program starts. So how can I stopp the

    I have a problem with elements 8. When ever I start a new project, the program searches for the old, latest used filmmaterial, I have used before. That means, if I use a different DVD, it take so much time, until the program starts. So how can I stopp the automatically uploading of old material?
    Thanks

    You have 2 unreachable statements in this method.
    public static int eval(String s2, String op, String s3) {
    return lookup(s2);
    return lookup(op);
    return lookup(s3);
    } You're missing a } at the end of this method:
    public static int lookup(String s) {
        for(int k = 0; k < symbols.length; k++){
            String symbol = symbols[k];
            if(s.equals(symbol))
                return k;
        }You have some loose } and ; at the end of the file:
    public static void main(String args[])
    commandline();
    }

  • Getting error and cannot download itunes.  says there is a problem with the windows installer package. a program required for the install to be complete could not be run.  any ideas?

    getting an error downloading itunes 64bit for windows 7.  says there is a problem with the windows installer package.  a program required for the install to be complete could not be run.  any ideas?  i uninstalled it last night when it would not open.

    Just in case, let's try a standalone AppleSoftwareUpdate.msi install.
    Download and save a copy of the iTunesSetup.exe (or iTunes64setup.exe) installer file to your hard drive:
    http://www.apple.com/itunes/download/
    Download and install the free trial version of WinRAR:
    http://www.rarlab.com/
    Right-click the iTunesSetup.exe, and select "Extract to iTunesSetup". WinRAR will expand the contents of the file into a folder called "iTunesSetup".
    Go into the folder and doubleclick the AppleSoftwareUpdate.msi to do a standalone ASU install.
    (If it offers you the choice to remove or repair, choose "Remove", and if the uninstall goes through successfully, see if you can reinstall by doubleclicking the AppleSoftwareUpdate.msi again.)
    Does it install (or uninstall and then reinstall) properly for you? If not, what error message do you get? (Precise text, please.)

  • TS3212 I'm runing IE9 & I'm unable to download iTunes.  I receive this error each time: There is a problem with this windows installer package.  A program required for the program to complete could not be found.  Contact your support personnel or package

    I'm running IE 9 & windows 7.  I'm unable to download iTunes.  I receive this error each time: There is a problem with this windows installer package.  A program required for the program to complete could not be found.  Contact your support personnel or package vendor.

    There is a problem with this windows installer package.  A program required for the program to complete could not be found.  Contact your support personnel or package vendor.
    Let's try the following user tip with that one:
    "There is a problem with this Windows Installer package ..." error messages when installing iTunes for Windows

  • I can't print two-sided with my macbook air. i've tried to look for the driver in the settings of printer and faxes but there is none, my printer is able to print for that kind of option. please help

    Canon MP280 Series

    When you select print you should see a menu option labeled Printer Settings (or Printer Options). This may be hidden in 2 different ways. First, the program may have minimized the print dialog box. Look for a button labeled Show Details. If you see it you'll need to click on the button to see all the printer options that are available. Having done this you'll see more options. Typically you'd look for the Printer Settings under a popup menu labeled Layout but sometimes something else is showing. For example, below you'll see that Safari hides it under Safari.

  • I have problem with firefox , it wont loud , the dose not come up , and it frizzes ? i even re-install the program but it wont work:( any suggestion would be helpful , thanks

    i have problem with firefox , it wont loud , the dose not come up , and it frizzes ? i even re-install the program but it wont work:( any suggestion would be helpful , thanks
    i cant login anywhere as all my passwords are saved in firefox, i cant even access teh firefox preference to get my password, it's so sad

    You likley have a corrupted Firefox preference or other support file in your User/Library folder.
    Programs load these files from the user account to adjust to user specifications, instead of having multiple copies of the same program on the machine.
    So when you reinstalled Firefox, it reinstalled the progrma only and the user support files remained from before.
    To prove this point, use System Preferences to create another Admin account and log into it, Firefox should run like a charm.
    To remove the Firefox support files from the problem user account your going to need to locate these files and delete them one at a time and try FF again and again.
    The first one you shoull try is your FF .plist file located in your User/Library folder.
    Clicm on the Finder and use the Go > Go to Folder and paste this
    ~/Library/Preferences
    and press Go.
    Now scroll down until you see the Firefox or Mozilla .plist file and Trash it, quit and restart Firefox, it will recreate the preference file with default settings you will have to reset it.
    Next run through the list of fixes #1-13 here before proceeding.
    https://discussions.apple.com/docs/DOC-3353
    If you need help deleting other FF files, download the free Easy Find from MacUpdate.com and search for anything "Mozilla" or "Firefox" in your User account only and take your chances you hopefully won't delete your password file in the process.
    You should have site passwords written down someplace and locked up tightin case you need them, a computer isn't totally safe and reliable.

  • On my iPod touch it says on the settings I have wifi but when I look for the 3 bars there is no wifi please help

    On my iPod touch it says on the settings i am connected to my home wifi but when I look for the 3. Bars beside the time they are not there this therefore stops me from using internet please help

    Does the iOS device connect to other networks?
    Does the iOS device see the network?
    Any error messages?
    Do other devices now connect?
    Did the iOS device connect before?
    Try the following to rule out a software problem:                 
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears. already suggested
    - Power off and then back on the router
    - Reset network settings: Settings>General>Reset>Reset Network Settings
    - iOS: Troubleshooting Wi-Fi networks and connections
    - Wi-Fi: Unable to connect to an 802.11n Wi-Fi network
    - iOS: Recommended settings for Wi-Fi routers and access points
    - Restore from backup. See:
    iOS: How to back up
    - Restore to factory settings/new iOS device.
    If still problem make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar

Maybe you are looking for

  • What is the Benefit of EJB2.0 CMP when using BC4J?

    I see much being made of the ability to use BC4J in conjunction with EJB2.0 CMP, but I am unclear of the benefits of doing so as I had understood that BC4J can effectively take care of persistance? There must be more to it no?

  • Regarding screen fields include in purchase order transaction

    Hai guys,     I need to add new field in purchase order transaction ( me21n, me22n, me23n ) . i have added the new field in screen painter. when i was creating the field and then i made the field to refer from dictionary , when i refer from dictionar

  • Creating Sales Employee Report in Business One 8.82

    Hi, Can someone provide me the query to create a Sales Report sorted by Sales Employee and Business Partner. The report contains the following columns: Sales Employee, Business Partner Name and Acct Number, Sale for Current Month (or month provide in

  • Newfs on large filesystem

    I'm trying to build a filesystem on a 420GB disk. (Actually it's a hardware RAID 5 device consisting of 4 x 146G disks in a Storedge 3510). When I run newfs to create the fs I get this... # newfs -N -f 4096 /dev/dsk/c4t40d3s0 Warning: cylinder groups

  • Scrollbar on JTabbedPane

    Hello friends, Below is the code which i created in NetBeans. I want to make this page scrollable since its text are too big. but scroll bars are not coming. need ur guidance. * PDV_GUI.java package pdv_gui; * @author Rehmatullah public class PDV_GUI