Set to program path to user desired

hi all,
in my assignment i had hardcode File f = new File("a:\\reservations.txt");the flepath for my output file. now i chnage to c:\windows\desktop but when i compile it .
there is an error "illegal escape character".
how do i debug it ?
thanks in advance.

Can You Give sample coding for my view....or you can
check in your program whether the following kinds of
char or occur..
har a = '\c';
char b = '\r'; 
char c = '\"'; 
char d = '\b'; 
char e = '\''; 
here is my code import java.io.*;
import java.util.*;
public class PassengerSystem{
private Map arrPassenger = new HashMap();
public Map getArrPassenger(){
return arrPassenger;
//Load the text file records.
public void loadFile()throws IOException{
boolean a=true;
     //File f = new File("a:\\reservations.txt");
File f = new File("C:\\windows\desktop\desktop\150906\reservations.txt");
BufferedReader BR = new BufferedReader(new FileReader (f));
boolean moredata = true;
Passenger newapplication;
while(moredata){
newapplication = new Passenger();
moredata = newapplication.readfile(BR);
if (moredata){
getArrPassenger().put(newapplication.getName(),newapplication);
BR.close();
//Save the records to the text file
public void save() throws IOException{
PrintWriter passengerFile = new PrintWriter(new FileWriter("a:\\reservations.txt"));
Passenger aPassenger = new Passenger();
Iterator a = getArrPassenger().values().iterator();
while(a.hasNext()){
aPassenger=(Passenger)a.next();
passengerFile.println(aPassenger.getSeatNo());
passengerFile.println(aPassenger.getName());
passengerFile.println(aPassenger.getAge());
passengerFile.println(aPassenger.getGender());
passengerFile.close();
thanks in advance.

Similar Messages

  • How do you set default programs for all users when deploying Windows 8.1?

    I have my Windows 8.1 image set up the way I want including the start screen, theme, etc. But how can I set the default programs for all users. Most of out computers are non-touch and I want the desktop apps (e.g. Windows Photo Viewer), not the store apps
    to be the default for opening pictures, videos, etc. Can that be done?

    Great question, this has been bugging me too!
    So, I did some research by using "Set Default Programs" app in Windows 8. Then I ran the super ProcMon.exe tool from Sysinternals.com <Thanks Mark!>
    After filtering out the junk, I could see some *interesting* writes to the registry:
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg\UserChoice]
    "Hash"="57y87/ogggU="
    "ProgId"="PhotoViewer.FileAssoc.Jpeg"
    But the "Hash" part had me concerned. I did some internet searching for the hash, and came across a post and a pointer to a blog with some answers.  This is both good news and bad.
    Background:
    One of the problems with Windows XP is that any program can come in and party on the entire system. No, I don't want you to put a shortcut on the desktop, install a crappy IE Toolbar, and change the default file association for *.jpg files to your app, I
    just wanted to play a stupid game. Since Windows 7, Microsoft has been attempting to block that functionality from the stupid applications, and give them back to the user. Take note of the last line in the ITaskbarList3 interface:
       Applications cannot programmatically pin themselves to the taskbar. That functionality is reserved strictly for the user.
    Of course that sucks for us IT Pros who may wish to create *default* working environments for corporate images, but there are some tricks we can do.
    Solution:
    This blog appears to have the answer:
    http://blogs.technet.com/b/mrmlcgn/archive/2013/02/26/windows-8-associate-a-file-type-or-protocol-with-a-specific-app-using-a-gpo-e-g-default-mail-client-for-mailto-protocol.aspx
    New for Windows 8 is a dism command: /Get-DefaultAppAssociations that allows you to export a control case from a known good computer. Microsoft the supports importing the exported xml file via GPO. For example, before I changed the file association, .AVI
    was pointing to the Modern App, after the change the /export-DefaultAppAssociations shows change to the new app:
    From:
    <Association Identifier=".avi" ProgId="AppXhjhjmgrfm2d7rd026az898dy2p1pcsyt" ApplicationName="Video" />
    To:
    <Association Identifier=".avi" ProgId="VLC.avi" ApplicationName="VLC media player" />
    I am still doing some investigation to see if a GPO is required, or if you can inject the association into a local user account. Also, if you do have some Modern Windows 8 Touch Tablets, it would recomend keeping most of the Modern App defaults in place,
    perhaps seperate GPO's for Desktops/Laptops vs Tablets?
    -k
    Keith Garner - keithga.wordpress.com

  • Can't make a selection of my pathes even if i have set a program change number for each one.Why is that happening?

    Hi everybody!
    I send program change messages from my midi controller and the messages are accepted by mainstage 3 as shown in the midi message window,but i can't make a selection of my pathes even if i have set a program change number for each patch.Why is that happening?
    I use a novation SL mki or a KORG Triton Le or a m-audio axiom 49 as midi controllers.The program change messages are transmitted by all the devices i mentioned above and shown as received in the midi messages window of mainstage 3.
    Has anyone the same experience?

    Hi
    Have you selected the correct device as the Program Change device and MIDI channel in the Concert Inspector?
    CCT

  • [svn] 4793: Fix bug SDK-17734 Path with width and height set different than path data has incorrect bounds

    Revision: 4793
    Author: [email protected]
    Date: 2009-02-02 11:20:06 -0800 (Mon, 02 Feb 2009)
    Log Message:
    Fix bug SDK-17734 Path with width and height set different than path data has incorrect bounds
    Fix: When calculating the bounds position we should take into account the implicit scaling factor actualSize/naturalSize. Also did some refactoring, getting rid of the protected method calculateTopLeft.
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-17734
    Reviewer: Ryan
    tests: mustella gumbo/layout/GraphicElement
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17734
    http://bugs.adobe.com/jira/browse/SDK-17734
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/Ellipse.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/Path.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.a s

    Thank you so much for replying.
    Yes I have removed and reinstalled WMP.
    I had good results with the PD6 application installed on the default path onto the C: drive with the one exception that if the application was launched by accident and the user data path was not available, the PD6 application would blow away my custom user path registry settings. Now that I know what they are I have made a .reg file to repair my registry to my desired user data paths.
    Installing the application on the removable drive appeared to help prevent me from launching the application by accident and overwriting my registry with default user paths.
    So which is the less of the two evils?
    If the application directory is not available, windows media player still tries to launch the .msi for installing PD6.
    If I install the application to the C: drive but the user data to the removable drive, launching the PD6 application without the user data drive will still corrupt my registry settings for a user data path.
    Both these issues seem like a logical (if not easy) fix that should be done in the PD6 application and installation package. I mean really, cannot anyone tell me why windows media player is checking the PD6 application directory? Why in PD4 did we have an option control for setting the user data path from the PD4 application? Why is this option not in the PD6 application, just the installer?
    I am given a choice during installation to move the user data to another non default location. Why else would this be provided if not to accommodate my kind of request to store the user data into an alternate location other than “My Document”. Certainly Palm is not trying to force the users on how to protect and store their personal data?
    Post relates to: Centro (Verizon)

  • Simple question about environment variables and setting the class path???

    ok I have been trying for a few months now ontrying to set the class path..
    I work with windows vista..
    on the environment variables user variables,
    I have the name of the variable as class
    and the value as C:\Program Files\Java\jdk1.6.0_04\bin;.
    where javac is...
    on the system variables I have
    its name as class
    and the value as C:\Program Files\Java\jdk1.6.0_04\bin;.
    why is this not reading javac

    The PATH environment variable should have as an entry the directory containing your javac executable. The CLASSPATH should have have entries which define your library directories and entries which are your jar file libraries. In the early days, probably the only CLATHPATH entry you will need will be a '.' to indicate the current directory.
    The Java tutorial covers ALL of this.

  • How to set the File Path to run a javascript using Plugin Code?

    Hi All,
    Im new to Indesign Plugin Development.Can any one help me out with my problem.
    What i want to do is to run a javascript using Plugin Code.When i went through this forum i was able to find out that i should use the IscriptRunner Class to automate this.I could also figure out that the Member Function to use is "CanHandleFile" &"RunFile".
    The first parameter in CanHandleFile & RunFile Member Function is to specify the path of the JavaScript File i suppose!I could also find out that IDFile has to used to set the file path Information.
    But im clueless how to set the Javascript FilePath using IDFile.Can any one help me how to do this?Any Code Snippets Please?
    Waiting for reply.
    Thanks
    myRiaz

    Hi,  Andreas<br /><br />  Can you explain this in detail? I found it in your post before.<br /><br />  The content of elements are returned through the Characters callback function:<br /><br />From ISaxContentHandler.h:<br /><br />/**<br />        Receives character data<br /><br />The parser will call this method to report each chunk of<br />        character data. SAX parsers may return all contiguous<br />        character data in a single chunk, or they may split it into<br />        several chunks. But all characters in any single<br />        event must come from the same external entity so the<br />        Locator provides useful information.<br /><br />Note some parsers will report whitespace using the<br />        IgnorableWhitespace() method rather than this one (validating<br />        parsers must do so).<br /><br />@param Chars The characters from the XML document.<br />        */<br />virtual void Characters(const PMString& chars) = 0; <br /><br />  What i have done is implement my own SAXContentHandlerServiceBoss, and in my file XXXSAXContentHandler.cpp, I override the fonctions StartElement, EndElement, and Characters() like below: I add the PMString xmlData to collect the file content:<br /><br />class XXXSAXContentHandler : public CSAXContentHandler<br />{<br />void XXXSAXContentHandler::Characters(const WideString& chars)<br />{<br />xmlData.Append(chars);<br />}<br /><br />void XXXSAXContentHandler::StartElement(const WideString& uri, const WideString& localname, const WideString& qname, ISAXAttributes* attrs)<br />{<br />xmlData.Append("<"); xmlData.Append(localname); xmlData.Append(">");<br />}<br />void XXXSAXContentHandler::EndElement(const WideString& uri, const WideString& localname, const WideString& qname)<br />{<br />xmlData.Append("</"); xmlData.Append(localname); xmlData.Append(">");<br />}<br /><br />}<br /><br />and in my program, I use the code below to call the fonction I overrided, but I dont know how I can get the String xmlData I defined in the XXXSAXContentHandler.cpp<br /><br />InterfacePtr<IK2ServiceRegistry> serviceRegistry(gSession, UseDefaultIID());<br /><br />InterfacePtr<IK2ServiceProvider> xmlProvider(serviceRegistry->QueryServiceProviderByClassID(kXMLParserService, kXMLParserServiceBoss));<br /><br />InterfacePtr<ISAXServices> saxServices(xmlProvider, UseDefaultIID());<br />InterfacePtr<ISAXContentHandler> saxHandler(::CreateObject2<ISAXContentHandler>(kXXXSAXContentHandlerServiceBoss));<br />saxHandler->Register(saxServices);<br />bool16 parseFailed = saxServices->ParseStream(readStream, saxHandler);<br /><br />Can you give me any help?<br /><br />Thanks and regards!

  • How to set the file path dynamically based on sytem, username, and date

    Hi All,
    My requirement is upload the data into one  structure like xyz that is related to t.code MCSZ.
    file will be in  UNIx SERVER .
    PATH IS: /sapif
    file name is xy789 load .txt
    I have  to write code in one user-exit
    how can i set the file path for this.
    shall i put hard code file path?
    because i have to writecode in user-exit.
    plz tell me how to set the file path based ons syetem, username, date
    Thanks in advance
    Ram.A

    Concatenate the field SY-SYSID, SY-UNAME and SY-DATUM for the file path

  • How to set Internet limits to particular user by gpo ?

    How to set Internet limits to particular user by gpo ?
    Thanks & Regards, Amol . Amol Dhaygude

    Hi,
    >>How to set Internet limits to particular user by gpo ?
    What Internet limits do you want to set for specific users? Group Policy user settings can be configured to apply to specific users, like via security filtering or GPP item-level targeting. The path for Internet Explorer policy settings under User Configuration
    is: User Configuration\Policies\Administrative Templates\Windows Components\Internet Explorer.
    You can also use GPP Internet Settings extension to manage IE settings and use GPP ILT to apply the settings to specific users. However, GPP settings can be edited by standard users after getting applied.
    Regarding GPP Internet Settings extension, the following article can be referred to for more information.
    Internet Settings Extension
    http://technet.microsoft.com/en-us/library/cc754649.aspxBest regards,
    Best regards,
    Frank Shen

  • RFC - Calling Function Module in a local Windows Program (.exe) on user PC

    Hi Gurus !
    Has anyone ever tried to call a local program on the user side through RFC ? Actually, this programme should allow the use of function module from ABAP programs.
    Indeed we want to use some device locally installed, here a device to pay using Credit Cards.
    However, we've almost successfully filled our requirements if the destination RFC is activated as a Registered Program. But a user B tries to access device of a user A if the code and destination are the same. So we need to create as many RFC destination as users.
    So, we'd like the frontGUI to call the local EXE. This EXE would be coded in VB btw. But we can't figure out how to set the program to register on SM59, using "Start on Front-End Station" option.
    Has anyone any clue on how the program should look like ?
    Thx in advance,
    N H

    Hi MxG,
    I guess we're close to the solution.
    So, using the .Net Connector, and declaring inside our program the Host and Server Class, we've managed to use it, as a registered Server Program. Actually our Registered Program is a Windows Service running on the local computer that the RFC Function Module refers to.
    While testing this it's appeared that user B was trying to use device on User A, event thought devices and services were installed on both computers.
    I guess there's something we're misunderstanding or missing when we try to convert our solution to a Front-End solution. The program is obviously incomplete, something is missing. But I can't find any example or start-up for that program. Even in SAPHelp, there's only something saying that "you can do your own program for front-end and RFC"...   :/
    Well, I've just realized I've reformulated my issue, but since it's confusing for me, it's actually not easy to describe and make sure it's understandable !
    Regards,
    N H

  • Set default directory/path for SaveAs Dialog using WPG_DOCLOAD

    Hi, im trying to set the default directory/path for the SaveAs Dialog called by wpg_docload.download_file.
    I'm not able to find where I can specify the default path.
    Is it something like "htp.p('Content-Disposition: attachment; path=:PX_OUTPUT_DIR" ?
    Thx for your help !
    Here's a part of my code
    owa_util.mime_header( NVL(mime,'application/octet'), FALSE );
    htp.p('Content-length: ' || length);
    htp.p('Content-Disposition: attachment; filename="'||substr(fileName,INSTR(fileName,'/')+1)|| '"');
    owa_util.http_header_close;
    wpg_docload.download_file( lobLoc );
    /*********************/

    I don't believe you're allowed to set the directory path in the Content-Disposition (or any other) header. More accurately, you can set path in the filename, but browsers don't pay any attention to that, they only look at only the terminal filename.
    <p>According to RFC 2183, browsers are supposed to ignore any path information sent with the filename. Even though it's dated 1997, I believe this RFC is still in effect.
    <p>This was done as a security precaution against malicious web apps that might try to download into a system directory or other dangerous place. Also, browsers (usually) allow users to specify their own default download directories. Further, even if you could specify the path, you'd have to do it for any and all filesystems (Linux, Mac HFS, Mac OSX, Windows, etc etc).

  • How to set a program into backgroud job

    hi experts,i want to set a program into backgroud job.
    the original code like this:
    ...some statements...
    PERFORM FRM_SEND_MAIL USING WA_YA_LX.
    ...some statements...
    i want to set 'PERFORM FRM_SEND_MAIL USING WA_YA_LX.' into background job.
    is that code like this?
      CALL FUNCTION 'JOB_OPEN'
         EXPORTING
           JOBNAME  = WA_TBTCJOB-JOBNAME
           JOBCLASS = 'A'
         IMPORTING
           JOBCOUNT = WA_TBTCJOB-JOBCOUNT.
    PERFORM FRM_SEND_MAIL USING WA_YA_LX.
      CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          JOBCOUNT                          = WA_TBTCJOB-JOBCOUNT
          JOBNAME                           = WA_TBTCJOB-JOBNAME
          SDLSTRTDT                         = SY-DATUM
          SDLSTRTTM                         = WA_TBTCJOB-SDLSTRTTM  .
    hunger for you advice,thanks a lot.

    See the following simple prog to schedule in background.
    You cannot schedule the subroutine i.e perform to run in background job. Instead write the subroutine in another program.
    to pass any value to that program, declare selection screen parameter and pass the value from the first one using submit.
    Job open
    call function 'JOB_OPEN'
    exporting
    delanfrep = ' '
    jobgroup = ' '
    jobname = jobname
    *sdlstrtdt = sy-datum
    *sdlstrttm = sy-uzeit
    importing
    jobcount = jobcount
    exceptions
    cant_create_job = 01
    invalid_job_data = 02
    jobname_missing = 03.
    if sy-subrc ne 0.
    write:/ 'error in opening a job'.
    endif.
    Insert process into job
    SUBMIT ZSDQ_BCK_TEST
    and return
    with p_type = 'F'   "Selection screen Parameter
    user sy-uname
    via job jobname
    number jobcount.
    if sy-subrc > 0.
      WRITE:/ 'ERROR PROCESSING JOB'.
    endif.
    Close job
    call function 'JOB_CLOSE'
    exporting
    *event_id = starttime-eventid
    *event_param = starttime-eventparm
    *event_periodic = starttime-periodic
    jobcount = jobcount
    jobname = jobname
    *laststrtdt = starttime-laststrtdt
    *laststrttm = starttime-laststrttm
    *prddays = 1
    *prdhours = 0
    *prdmins = 0
    *prdmonths = 0
    *prdweeks = 0
    *sdlstrtdt = sdlstrtdt
    *sdlstrttm = sdlstrttm
    strtimmed = 'X'
    *targetsystem = host
    RECIPIENT_OBJ = RECIPIENT_OBJ
    exceptions
    cant_start_immediate = 01
    invalid_startdate = 02
    jobname_missing = 03
    job_close_failed = 04
    job_nosteps = 05
    job_notex = 06
    lock_failed = 07
    others = 99.
    ***This is the second program which will run in background
    REPORT ZSDQ_BCK_TEST .
    TYPES: BEGIN OF TY_ADRC,
            HOUSE_NUM1 LIKE ADRC-HOUSE_NUM1,
            NAME3 LIKE ADRC-NAME3,
            NAME4 LIKE ADRC-NAME4,
            LOCATION LIKE ADRC-LOCATION,
          END OF TY_ADRC.
    DATA: IT_ADRC TYPE STANDARD TABLE OF TY_ADRC WITH HEADER LINE.
    Parameters: p_type type c.
    START-OF-SELECTION.
    SELECT HOUSE_NUM1
            NAME3
            NAME4
            LOCATION
           UP TO 40000 rows
            FROM ADRC
            INTO TABLE IT_ADRC.
           WHERE ADDRNUMBER = '0000022423'.
    IF SY-SUBRC = 0.
       LOOP AT IT_ADRC.
         WRITE:/ IT_ADRC-HOUSE_NUM1, IT_ADRC-NAME3.
       ENDLOOP.
       write:/ p_type.
    ENDIF.

  • Setting java.library.path property in java code

    Hi,
    i'd like to set java.library.path property in java code to load a dll-library. I know that a funtional way is to run JVM with parameter -Djava.library.path=c:\tmp, but I need it do it IN CODE.
    I'v tried this:
    System.setProperty("java.library.path", "c:\\tmp");
    System.loadLibrary("libapr");The library 'libapr.dll' is situated really in 'c:\tmp' directory, but I get 'java.lang.UnsatisfiedLinkError: no libapr in java.library.path' exception.
    It seems like the already running java program doesn't use actual java.library.path set in previous step.
    Is there any possibility to set java.library.path property in java code?
    Thanx
    Brny

    I think the following code should work:
    // Reset the "sys_paths" field of the ClassLoader to null.
              Class clazz = ClassLoader.class;
              Field field = clazz.getDeclaredField("sys_paths");
              boolean accessible = field.isAccessible();
              if (!accessible)
                   field.setAccessible(true);
              Object original = field.get(clazz);
              // Reset it to null so that whenever "System.loadLibrary" is called, it will be reconstructed with the changed value.
              field.set(clazz, null);
              try {
                   // Change the value and load the library.
                   System.setProperty("java.library.path", "c:\\tmp");
                   System.loadLibrary("libapr");
              finally {
                   //Revert back the changes.
                   field.set(clazz, original);
                   field.setAccessible(accessible);
    The idea is to make the static field "sys_paths" null so that it would construct the paths from the changed value.

  • Set a permanent PATH

    Hi all,
    I am under Sun Solaris 11 (Express 6/05), and I want to set a permanent PATH, for all user of the computer (When I reboot the computer, I wan't to have these path already set).
    But I don't know what is the file where I can set that.
    I wan't to add these path:
    /opt/csw/bin -> to $PATH
    /opt/csw/man -> to $MANPATH
    Thanks.

    Hi Folk,
    I am a newbie in Sun Solaris 10 x86. Recently I installed gcc and tried to add the global path in /etc/profile. But it shows me the some sort of error message as below
    # . /etc/profile
    Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
    PATH=/usr/sbin:/usr/bin:/usr/sfw/bin: is not an identifierMay I know how do I solve this problem? Please advise....

  • Setting a directory path

    I'm finding that I can only edit all the files within a directory that the program runs in. Is there a way of setting a directory path and being able to play with the files within.
    I've set the path with the "." before, but could not change anyything, not unless the program resides in the directory.
    I saw setdirectory(), method but couldn't get it to work, is this only for File chooser.
    File directory = new File(".");
    File[] files = directory.listFiles();
    for(int x = 0; x < files.length; x++)
                     if(files[x].isFile()) dim.addElement(files[x].getName());;
            }

    Java doesn't have anything like chdir command. You can use relative paths from the default path or you can use an absolute path in a File object.
    For example:
    new File("c:\\windows\\system32\\cmd.exe").rename("c:\\windows\\system32\\newname.exe");

  • Setting my program as default

    How can I set my program as default for .mp3 files?

    You should not do that programmatically. That is the task of the users themselves. Setting it by you can be seen as hacking and is in most countries forbidden.
    However, there are ways to set the file associations using the registry. 
    http://www.codeproject.com/Articles/18594/File-Association-in-VB-NET
    If it is only for you, then simply use file explorer and set it.
    Be aware what I wrote above, most users simply uninstall programs which does this automatically because it makes those ancient. 
    Success
    Cor

Maybe you are looking for

  • HELP!!!!  File name / document title metadata question

    Is there any way to have the file name and the document title carry over to one another? I am doing a huge selection of images for our stock agency and have figured out how to add a simple bit of information to our in-house file names for example 111

  • Export large TIFF scans to JPEG results in distorted "banding" effect

    built-in JPEG converter, when used to send TIFF files to a .Mac screensaver or when used to export TIFF files to JPEG, results in distorted images on certain kinds of TIFF files, resulting in portions of the image displayed in vertical stripes across

  • Cannot Start Tomcat 1.1.18

    HI I have install tomcat 1.1.18(light) edition. when I try start the tomcat, the window just pop up and disappear. The tomcat could not be start. After editing the startup.bat to view the error, below is the error. I am currently using JDK1.4. Does a

  • FLVPlayback erratic behavior

    In testing I am have a problem getting the playback portion of an swf to work. It works fine from my computer but from others it either Skips, plays the audio and jumps around with the video, or just stops. I have extracted the video portion of the c

  • Where are the newer posts??

    All the posts are up to 2011... where are the rest of it? This info incomplete is not so usefull... Please fix it as it was before. Regards.