Specify current directory of file?

hey I'm trying to get a file but the only way it works when i program is if i give the full path, like
ApplicationContext ctx = new FileSystemXmlApplicationContext("C:\\olddata\\Documents and Settings\\Space\\Projects\\Testing\\BeanTest\\src\\context.xml");how do i just tell Eclipse to get context.xml from the current directory?
I tried,
ApplicationContext ctx = new FileSystemXmlApplicationContext(".\\context.xml");
ApplicationContext ctx = new FileSystemXmlApplicationContext("context.xml");but it just gives me FileNotFoundException
Thanks

after a lil trial and error i got it,
ApplicationContext ctx = new FileSystemXmlApplicationContext(".\\src\\context.xml");
.\\context.xml only referred to the project folder so i was forgetting src folder in which
context.xml was located

Similar Messages

  • Specifying current directory in Receiver File Adapter

    Hi Experts,
    I have been configuring a receiver file adapter to place a file onto an FTP server. As per the information provided, as soon as I login to the FTP server, I have to place the file in current logged in directory. In this case, how can I mention this in file adapter as to use the current directory path to place the file? What should I enter in 'Target Directory' in File Access Parameters?
    Thanks,
    Dhawal

    Hi Praveen,
    Since file directory parameter is mandatory, my question is what should I enter in this parameter so that the file adapter will know that the file should be placed in the root directory itself?
    Regards,
    Dhawal

  • How to specify source directory in File sender adpate using (NFS)?

    Hello experts,
    I am doing File-PI-Proxy scenario.
    Input file is available on machine which is within the Network area and FTP is not available on that machine.
    For this reason I am using the NFS Transport Protocol.
    In ID File sender I have specified Source Directory:-
    IP Address\Directory
    I am geeting the Error in RWB as 'Configured source directory '
    IP Address\Directory' does not exist'.
    Please suggest how to specify the Source Directory path.
    Regards,
    Jagesh

    Hi,
    If you want to use NFS protocol, then the file needs to be within the a folder in the XI server and not outside it, In your case if you need to use the file in a different machine which is on a network then try to use the FTP protocol.
    Refer this blog:
    /people/shabarish.vijayakumar/blog/2006/08/01/along-came-a-file-adapter-mr-ftp-and-rest-of-the-gang which shows the details of how you can install a local FTP and use it
    Regards,
    Nithiyanandam
    Edited by: Nithiyanandam A.U. on Mar 18, 2009 10:43 AM

  • How can i specify current directory path of wsusscn2.cab

    SCRIPT:
    How can i set current directory file path of wsusscn2.cab where i placed this vbscript, instead of going to c:\wsusscn2.cab.
    =======================================================================
    Dim fso
    Set wshNetwork = CreateObject("WScript.Network")
    strUser = wshNetwork.Username
    Set fso = WScript.CreateObject("Scripting.Filesystemobject")
    Set f = fso.CreateTextFile(".\Missing Patch Details\" & wshNetwork.ComputerName & "_missing_patches.csv", 2)
    Set UpdateSession = CreateObject("Microsoft.Update.Session")
    Set UpdateServiceManager = CreateObject("Microsoft.Update.ServiceManager")
    Set UpdateService = UpdateServiceManager.AddScanPackageService("Offline Sync Service", "c:\wsusscn2.cab")
    Set UpdateSearcher = UpdateSession.CreateUpdateSearcher()
    WScript.Echo "Searching for updates..." & vbCRLF
    UpdateSearcher.ServerSelection = 3 ' ssOthers
    UpdateSearcher.ServiceID = UpdateService.ServiceID
    Set SearchResult = UpdateSearcher.Search("IsInstalled=0")
    Set Updates = SearchResult.Updates
    If searchResult.Updates.Count = 0 Then
        WScript.Echo "There are no applicable updates."
        WScript.Quit
    End If
    WScript.Echo "List of applicable items on the machine when using wssuscan.cab:" & vbCRLF
    For I = 0 to searchResult.Updates.Count-1
        Set update = searchResult.Updates.Item(I)
    f.WriteLine update.Title
    'WScript.Echo I + 1 & "> " & update.Title
    Next
    WScript.Quit
    ==========================================================================
    prakash

    Just remove the c:\ and it will be looked for in the current directory.
    If you want the script how get the script path and remove the file name or use the shell
    currentFolder = CreateObject("WScript.Shell").CurrentDirectory
    ¯\_(ツ)_/¯

  • How to get the current directory as File object

    Hi guys,
    i want to get the current working directory as a file object.
    plz help me on that if there are any standard methods present for this.

    new File(".");

  • How to create a file in server's current directory

    hi,
    I have a project, but when i will run my program on internet Explorer then
    it will create a folder in server's current directory, but i will not specify
    drive & folder, it will create a folder in server's current directory, after that
    i will read file from that, what will be the solution of this ? Is there
    anyone who can give me solution? PLease help me
    With regards
    Nahar

    ServletContext context = session.getServletContext();
    String realContextPath = context.getRealPath(request.getContextPath());this will give you access to the servlets current directory
    from there you can create a file
    I dont know how much this will help

  • How can I make an applet look to the current directory to read a txt file in?

    I am using a File class passing only the file name as the contructor but forte still looks in "C:\forte_jdk\forte4j\bin\Events.txt" which is not my current directory for the project.
    If leave it and ftp this applet to my web site I get an IOException.

    I always find visual aids helpful. See below for screenshots & discriptions.
    01. The Basics
    When you create a new site & go into design view (in the example below it's the Home page), you'll see the following.
    The white box is your page.
    The grey box outside of that is your browser area.
    The black & white checkered area is the Adobe Muse CC application chrome.
    02. Add Box
    Draw / Add your rectangle or text frame (text tool). I drew a rectangle, gave it a fill color of blue & turned the stroke from 1 to 0.
    03. Extend & Snap to Browser Edge (Left)
    Click, hold  and drag your mouse on the center adorner (adorner is the little squares that you can grab to resize your rectangle) until you resize your rectangle to the browser edge (the dark grey area) until you see a red line. This means you've 'snapped' one of the rectangle's edge to the browser edge.
    04. Extend & Snap to Browser Edge (Right)
    Repeat the process except do this for the right edge. In truth, it doesn't matter in which order you resize your rectangle to snap to the browser edges. The key thing is to be sure to do this for both sides of the rectangle & snap it to the browser edge (see the red line).
    05. You're done! Preview.
    06. Bonus!
    Once again, you can make rectangles or text frames 100% width, BUT you can't do this with placed images.
    However, you can do this with a rectangle or text frame. Then set the Fill of either the rectangle & text frame to be an Image & set the Fitting to 'Scale to Fill.'
    (see below for example - I used a rectangle & changed it's Fill property)
    Now when I preview, the image is 100% width. In truth, it's a 100% width rectangle with a fill of an image.

  • How to create a file in current directory

    hi,
    I want to create a file in a current directory, But when i written following
    code then it cannot create file, How i will create file in current directory?
    Is there anyone who can help me?what will be the solution of this problem?
    Please give me solution
    String dir=application.getRealPath("/");
         int count;
         String filename="sample.txt";
         out.println(dir+filename);
         FileOutputStream fout=new FileOutputStream(filename);
         PrintStream p;
         p=new PrintStream(fout);
         p.print("1");
         p.close();with regards
    Bina

    hi,
    my problem is that my path is ok...but when i open file in this directory then
    it cannot open a file, is there anyone who can do it? When a user save data in server from remote
    area then what will be path of my code? how i will solve it? please give me
    solution.
    with regards
    bina

  • Acrobat Pro "save as" function in the file menu does not show the current directory of the file

    I have installed CC but Acrobat Pro gives me headaches.
    The "save as" function in the file menu does not show the current directory of the file but something I have worked on in the past.
    It forces me to navigates through my hard disk for this very straightforward thing in normal conditions. I precise: Acrobat is the only software reacting like that.
    I use Windows7 professional 64bits.

    I use what seems to be the latest version available on the Cloud:
    To illustrate my point, I open a directory with explorer and double-click on the only PDF in there:
    So here it is, open:
    When I do a "Save as", it takes me to a totally different place on the disk!
    Very annoying...
    Thanks for your time!
    JJ

  • How to read files from current directory for applet

    I have an applet that needs to read some audio files located in its current directory on the server and I just can't seem to figure it out...maybe I am being dumb...any help?

    You can use the ListSorter File Adapter Configuration property to sort based on timestamp. Basically add the following property to the inbound JCA file:
    <property name="ListSorter"
    value="oracle.tip.adapter.file.inbound.listing.TimestampSorterAscending"/>
    <property name="SingleThreadModel" value="true"/>
    More info see section 4.2.6 in http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/adptr_file.htm

  • E-mailing report attempts to write temp file in current directory

    When e-mailing a report from the previewer, Reports 6.0 attempts to write a temporary file in the current NT directory. This file is the actual e-mail attachment, in this case a PDF file.
    Unfortunately the current directory is where the application resides, and therefore users do not have write permission. Is there any way to re-direct where the temporary file is created (i.e. a local drive or the Windows temp directory)?
    Thanks in advance.

    change your registry key entry which says
    REPORTS60_TMP to which ever dir you want

  • Saving file object to current Directory.

    Ok I did a file transfer thing, after I receive the file object, how do I save it to the current directory?
    Thanks.

    This saves an empty file.It's up to you to put data in it. I have no idea where your data is coming from.
    I wanna save the file and the contents to the current
    directory.What contents?
    Any ideas?Look at the OutputStream and Reader interfaces in the API.

  • Delete logs or trace file in current directory

    how to delete before 5 days trace files or alert log in the current directory.

    Syntax
    find /path -name '*.trc' -mtime +days -exec command {} \;
    Example
    find /backup -name '*.log' -mtime +5 -exec ls -ltr {} \;
    find /backup -name '*.trc' -mtime +5 -exec ls -ltr {} \;
    find /backup -name '*.log' -mtime +5 -exec rm -rf {} \;
    find /backup -name '*.trc' -mtime +5 -exec rm -rf {} \;
    Edited by: hitgon on Jun 26, 2012 9:44 AM

  • Ctxload can't find a file in the current directory

    I am trying to load a thesaurus file using ctxload. The file is in the current directory. I can use a text editor to modify it. But ctxload always complains that "file not found." Why?

    I have the latest iTunes version and haven't seen that feature.
    From the iTunes menu bar you will find it at iTunes>Provide iTunes Feedback.
    It is also on the main iPod +iTunes page. Click on the iPod + iTunes tab at the top of this page and look near the bottom, its in small type with a pencil icon next to it.
    Hope this helps.
    bd

  • JFileChooser: changing file type resets current directory

    I create a JFileChooser with multiple file types and set the current directory. It comes up with the first file type and the current directory. If I select another file type, the files shown are not in the current directory, which I set -- they are files in the application default directory. Is there a way to keep my current directory, while changing the file type? Or is this a feature?

    Are you talking about your own CDs imported to iTunes or are you talking about songs purchased from the iTunes Music Store (iTMS)? If the latter, the iTMS, you do not get any choice in the format downloaded. You get protected AAC files and that is all.
    If you want to change how you import files, go to the iTunes preferences for importing and choose the format you want to use from now on.
    Patrick

Maybe you are looking for

  • Doubts concerning External Connection Pool

    A few questions: 1. How can I set up an external connection pool with toplink? or in another words, assuming that I have successfully configured a connection pool (and a datasource) on my weblogic app-server, how do I configure Toplink to use the sam

  • Is there a way to create folders on one iPad and sync the folders to multiple iPads?

    Is there a way to create folders on one iPad and sync the folders to multiple iPads? I have 23 iPads and I want to have all the folders match for easier access for students.

  • Calling an situation-sensetive action in an jsp-file

    Hi all, I have to call an action (kind of: <html:form action="/actions/myInfos/studentListTaskBeurteilungenAction.do" method="POST"> in an jsp file, but I have to give the action two paramters as well I have in this jsp. I tried things like: <c:set v

  • Play/Pause Button in AS3

    I have search the internet, but I cannot find a simple way to create a play/pause button in AS3. All the solutions I find are for older versions when buttons could have actionscript directly applied to them. I created a flash animation and exported i

  • PSE9 not showing thumbnails

    PSE9 has suddenly started to show the hour-glass symbol instead of the photograph in PSE9! Does anyone jnow what I have done to cause this problem, please?