File Problem with path

File anxmlfile = new File("TheXmlFile.xml");This throws filenotfoundexception while this
File ko = new File("D:/Test/TheXmlFile.xml");
          works..
the class that opens the file is in the same folder as the xml file.
What do i put in the constructor so that it looks in the current directory of the class?

File anxmlfile = new File("TheXmlFile.xml");This throws filenotfoundexception while this
File ko = new File("D:/Test/TheXmlFile.xml");
works..
the class that opens the file is in the same folder
as the xml file.
What do i put in the constructor so that it looks in
the current directory of the class?is your class in a package? if so, that's your problem. don't put the file in the directory where your class lives, put it in the root of your package hierarchy

Similar Messages

  • [bash] How to uniq files in a file list with paths?

    Hi folks,
    I know I can get rid of duplicate entries in a list by sorting and uniqing:
    sort file | uniq
    But how can I uniq filenames in a file list with paths?
    /foo/abc.bar
    /foo/def.bar
    /foo/bar/def.bar
    /foo/ghi.bar
    Is it necessary to write my own comparison routine like “output thisline if basename(thisline) != basename(lastline)” (would require a basename-sorted input list)?

    arith wrote:
    Hi folks,
    I know I can get rid of duplicate entries in a list by sorting and uniqing:
    sort file | uniq
    Or 'sort -u':
    $ cat test
    a
    e
    b
    d
    c
    a
    d
    $ sort -u test
    a
    b
    c
    d
    e
    arith wrote:
    But how can I uniq filenames in a file list with paths?
    /foo/abc.bar
    /foo/def.bar
    /foo/bar/def.bar
    /foo/ghi.bar
    Is it necessary to write my own comparison routine like “output thisline if basename(thisline) != basename(lastline)” (would require a basename-sorted input list)?
    I came up with
    $ cat test
    /home/karol/test/test0
    /home/karol/test/test/test0
    /home/karol/test/foo/test00
    /home/karol/test/foo/bar/test0
    /home/karol/test/foo/bar/test1
    /home/karol/test1
    $ awk -F/ '{print $F" "$NF}' test | sort -k2 | uniq --skip-fields=1 | awk '{print $1}'
    /home/karol/test/foo/bar/test0
    /home/karol/test/foo/test00
    /home/karol/test/foo/bar/test1
    but I think there's a better way to do it ;P

  • Anyone know if the long standing duplicate files problem with File History has been fixed yet?

    There are loads of public threads about the duplicate files problem
    with Windows 8/8.1 File History backup system.
    From all the threads I've looked at, there seems to be no solution,
    and no acknowledgement from MS that they can even repro the problem
    (which surprises me considerably as there are so many people who
    notice the problem).
    Is anyone aware of whether MS (may) have fixed this for Win10?
    Are MS aware of the problem and if they're able to fix it?
    Dave - with many GB of duplicated files in File History :)

    Hmm, is that the attitude MS would recommend? :)
    Why would I care what Microsoft would recommend?
    Clearly you don't, and you appear to have missed my smiley. Calm down
    Noel, many of us are as annoyed by aspects of modern Windows as you
    are. :)
    I'm all about making Windows actually WORK/./
    Aren't we all? Windows is software I use too many hours every day, I
    along with many millions of others need it to work really well. You
    are not alone.
    When they implement something that doesn't work, and even if it did work doesn't do what's needed - and/beyond that/ they remove features people DO need (such as the GUI for Windows Backup), I see no wrong in advising people of the way things
    really are.
    File History essentially does work - it's saved me a couple of times
    in the past couple of weeks. It just has a highly annoying habit of
    creating 100% duplicates of some files for no apparent reason. If MS
    have fixed that I won't have any known complaints about it.
    If you don't like it, you don't have to use it. I generally like it, I
    just want to see that its fixed.
    Dave

  • FM for getting teh file name with path

    Hi guys,
    Is there an fm getting the file name with path given the physical path and file name? Thanks!

    Hi Mark,
    Function Module WS_FILENAME_GET is obsolete, dont use it.
    Use the Method file_open_dialog of  class cl_gui_frontend_services as given below.
    DATA:
        lt_filetable TYPE filetable,
        lf_rc        TYPE i,
        lv_filename(50) TYPE c,
        lv_fileext(3) TYPE c,
        ls_file TYPE file_table,
        lv_file TYPE localfile,
        lv_title TYPE string.
      lv_title = sy-title.
      lv_progname = sy-cprog.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = lv_title
          file_filter             = '*.txt'
          multiselection          = abap_false
        CHANGING
          file_table              = lt_filetable
          rc                      = lf_rc
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          not_supported_by_gui    = 4
          OTHERS                  = 5.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                   DISPLAY LIKE 'E'
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        EXIT.
      ENDIF.
    * Number of selected filed must be equal to one.
      CHECK lf_rc = 1.
    * Access selected file
      READ TABLE lt_filetable INTO ls_file INDEX 1.
      CHECK sy-subrc = 0.
      lv_file = ls_file-filename.
      SPLIT lv_file AT '.' INTO lv_filename lv_fileext.
    Revert back if you need clarifications.
    Regards
    Karthik D

  • Bat file problems with 5.2(3)

    I'm having bat file problems with CCM 4.2(3) with bat version 5.2(3). When adding phone/users getting an error number -2146828279 with this message "Description -Subscript Out of range".

    Hi Denis,
    Just wanted to know if the description contained a comma? There was a bug in a previous BAT version that would affect phone/user inserts if there was a comma.
    CSCsb61425 Bug Details
    Headline BAT insert fails if phone description contains comma
    This was in BAT 5.1.4
    Hope this helps!
    Rob

  • With conversion to Leopard, file problems with networked Windows computer

    Last night I did an Archive & Install from Tiger to Leopard on my Intel MacBook Pro. Today, I had trouble finding the other computers at my office. Once I finally got them to show up, I opened a Word file found on another computer, made some changes, and when I tried to save it, I got this message: "This is not a valid file name. Try one or more of the following: *Check the path to make sure it was typed correctly. *Select a file from the list of files and folders." Since this file already existed and I wasn't changing the name, I thought this was odd, but I changed the name from "Seating Chart 3-8-08" to "SeatingChart3-8-08" in case Leopard didn't like spaces when talking to Windows, but I got the same error message. Finally I gave up, not knowing what to do, then discovered that it had in fact saved my file. Still, every time I try to save ANY Word document from the shared folder of the Windows computer, I get the same error message endlessly until I choose "Don't Save."
    When I try to open an Excel file from that computer, it won't even open; it says " 'File Name.xls' cannot be accessed. This file may be Read-Only, or you may be trying to access a Read-Only location. Or, the server the document is stored on may not be responding." As with the Word file problem above, I did not have any problem accessing the files until I converted to Leopard.
    The Windows machine is Windows XP using Microsoft Office 2003; I have Microsoft Office 2004 on my machine.

    See if this Link, by Pondini, offers any insight to your issue...
    Transfer from Old  to New
    http://pondini.org/OSX/Setup.html
    Also, See here if you haven't already...
    http://www.apple.com/support/switch101/     Switching from PC

  • File problem with accent / CS4 Mac

    Hi
    I"m using CS4 on MAC OSX 10.5.7
    I have problem with filename containing accents like 'é'
    For example : I browse for a file called 'testé.xml' using kOpenFileDialogBoss, and then get the resulting IDFile. From this IDFile I get the path in a PMString with the function FileUtils::SysFileToPMString.
    My problem is that character 'é' has a strange representation, instead of having the correct path I get 'teste<0301>.xml' and if I want to use this path with a fopen function or even to show it into a TextEditBoxWidget it'll fail.
    I've look into SnpChooseFile sample and the problem is the same. In the log I also get that strange representation.
    Have you encountered this problem?
    Thanks for your help

    Have a look at FileUtils::DecomposeUnicode and NormalizeUnComposedUnicodeChars. Use the first to convert before using i.e. FileUtils::PMStringToSysFile() and the later afetr i.e. FileUtils::IDFileToPMString().
    HTH

  • Problem with path length when using oracle drive

    Hello!
    Does anybody else experience this problem with Oracle Drive?
    When I create a deep or nested hierarchy in which the path length is longer than 250 (the limit might be 255) characters, I cannot access the deeper subpages.
    Example:"X:\INET\START1\pfadlaengentest\das istein langer ordnername mit etwa 50 zeichen\and this is another veryveryvery long\and this is another veryveryvery lon2\and this is another veryveryvery lon3\and this is another veryveryvery lon4\and this is another veryveryvery lon5".
    I can access the page "and this is another veryveryvery lon4" but not "and this is another veryveryvery lon5"
    Is this problem due to WebDAV?
    What can I do - I think it is a critical error / bug?
    Regards Joerg.

    I opened a service request and oracle support could help me.
    The problem is the windows file system: the path length cannot be longer than 256 chars.
    There's a workaround with MS-Webfolders.
    More information is available via metalink: watch out for SR-Number 5659267.992.
    PS: Thanks to Bert
    bye :-j (joerg)

  • Locked file problem with WebDAV

    I am using DreamWeaver CS3 on my Macintosh at home and on a
    PC at work. I am connecting to my website via WebDAV, and for some
    reason Dreamweaver cannot edit the files on the site. When I try to
    check out any file I get an error stating: "file.html is locked and
    can be viewed but not edited" I then have the option to check it
    out or view or cancel. Regardless of what I do, if I continue and
    open the file and make changes the file will not get updated on the
    remote server even though Dreamweaver reports a successful "put" or
    "check in" command in the log file. This happens on both the
    Macintosh and the Windows PC. Both are also updated to the latest
    versions of Dreamweaver.
    The strange thing is, if I mount the WebDAV server as a
    filesystem on my macintosh and authenticate with the same
    login/password that entered in Dreamweaver's WebDAV settings, I can
    edit the html files using a text editor and they save perfectly
    fine. Additionally, while the web server is mounted on the desktop,
    if I change Dreamweaver's site settings to "local/network" and
    enter the locally mounted WebDAV share path instead of using
    Dreamweaver's built-in WebDAV client, then everything works
    properly in Dreamweaver. Reverting back to using WebDAV in
    dreamweaver (as opposed to through the OS) brings about the same
    "locked file" problem as before.
    There appears to be a problem with Dreamweaver's WebDAV
    access to the site, and I'm wondering if there's an easy fix or if
    this has been experienced by others?
    Thanks,
    -Topher

    Have a look at FileUtils::DecomposeUnicode and NormalizeUnComposedUnicodeChars. Use the first to convert before using i.e. FileUtils::PMStringToSysFile() and the later afetr i.e. FileUtils::IDFileToPMString().
    HTH

  • Airport Extreme, Airdisk, and Vista - large file problem with a twist

    Hi all,
    I'm having a problem moving large-ish files to an external drive attached to my Airport Extreme SOMETIMES. Let me explain.
    My system - Macbook Pro, 4gb ram, 10gb free HD space on macbook, running latest updates for mac and vista, external hard drive on AE is an internal WD in an enclosure w/ 25gb free (its formatted for pc, but I've used it directly connected to multiple computers, mac and pc, without fail), AE is using firmware 7.3.2, and im only allowing 802.11n. The problem occurs on the Vista side - havent checked the mac side yet.
    The Good - I have bit torrents set up, using utorrent, to automatically copy files over to my airdisk once they've completed. This works flawlessly. If i connect the hard drive directly to my laptop (macbook running bootcamp w/ vista, all updates applied), large files copy over without a hitch as well.
    The Bad - For the past couple weeks (could be longer, but I've just noticed it recently being a problem - is that a firmware problem clue?) If i download the files to my Vista desktop and copy them over manually, the copy just sits for a while and eventually fails with a "try again" error. If i try to copy any file over 300mb, the same error occurs.
    What I've tried - well, not a lot. The first thing i did was to make sure my hard drive was error free, and worked when physically connected - it is and it did. I've read a few posts about formatting the drive for mac, but this really isnt a good option for me since all of my music is on this drive, and itunes pulls from it (which also works without a problem). I do however get the hang in itunes if i try to import large files (movies). I've also read about trying to go back to an earlier AE firmware, but the posts were outdated. I can try the mac side and see if large files move over, but again, i prefer to do this in windows vista.
    this is my first post, so im sure im leaving out vital info. If anyone wants to take a stab at helping, I'd love to discuss. Thanks in advance.

    Hello,
    Just noticed the other day that I am having the same problem. I have two Vista machines attached to TC w/ a Western Digital 500 gig USB'd. I can write to the TC (any file size) with no problem, however I cannot write larger files to my attached WD drive. I can write smaller folders of music and such, but I cannot back up larger video files. Yet, if I directly attach the drive to my laptop I can copy over the files, no problem. I could not find any setting in the Airport Utility with regards to file size limits or anything of the like. Any help on this would be much appreciated.

  • Problem with Path Managed property in alternate zones - also we have identified problem with Product catalog in alt zones

    Hi All,
    I'll start "one step back". Note we have resolved this issue but it is worth mentioning:
    Yesterday we set up the product catalog. We were having a lot of inexplicable problems with it initially. After much troubleshooting, we found that it was because we were browsing the SharePoint site via the "Internet Zone" rather than the "Default
    Zone" when we "Connected" our site to the product catalog. Issues experienced:
    1) "Catalog Item URL Format" displayed error "Properties <Managed Property> specified by the shared catalog could not be found in the search schema" when attempting to connect to the catalog, despite that managed property being
    configured correctly. The catalog would connect despite the error, and the navigation worked fine.
    2) The search Result Source for the catalog would not return any results. Configuring the query and selecting "Advanced Mode" would show SPSiteURL:http://externalURL.domain.com. Changing SPSiteURL manually to
    http://InternalURL resulted in results being returned as expected.
    After much troubleshooting, we found that if were browsing SharePoint using the default zone (http://InternalURL) when we connected the Product Catalog, the result source then worked properly (internally and externally).
    Ok, so now onto our current problem:
    The Product Catalog appeared to be working properly (internally and externally) after figuring out that we needed to connect it from the Default Zone. However, we have found a remaining glitch, which doesn't appear to be Product-Catalog-specific. Consider
    the following scenario:
    1) We click a category in our Product Catalog, such as Electronics
    2) A list of our electronic devices are presented via the "Category" display page
    3) If we click on a specific item, a different URL is returned internally vs externally. We only get the friendly managed navigation URL when browsing via the Default zone. And of course totally different pages load based on which URL you get.
    Internal (when browsing via Default zone):
    http://InternalURL/catalog/PRODUCT-CATEGORY/PRODUCT-NAME
    External (when browsing via Internet zone):
    http://ExternalURL.domain.com/catalog/Lists/Products/DispForm.aspx?ID=1
    We have reviewed the display template, and the "Path" managed property is simply being used to render the link. Furthermore, we have configured the Content Search web part's "Property Mappings" to show the "Path" MP, and it
    displays the same (wrong) result externally.
    This tells us that the Path MP is not correctly rendering "Friendly URLs" when using managed navigation.
    Any help/ideas?
    Our environment:
    SharePoint Version: 15.0.4667.1000
    Default Zone: http://InternalURL
    Internet Zone: http://ExternalURL.domain.com
    We are NOT using host named site collections
    We ARE crawling the Default zone URL in our content source
    Thanks,
    Tommy

    Hi,
    We have now also observed the same issue with a Managed Property of type “Hyperlink/Picture”. The picture returns the wrong URL externally.
    This post describes the same issue, however the poster found that setting UseAAMMapping=True doesn’t work in 2013:
    http://sharepoint.stackexchange.com/questions/104806/set-the-useaammapping-property-of-a-managedproperty-object-map-an-url-of-a-h
    We checked, and our Picture MP had UseAAMMapping=False. We set it to True, did a full crawl, and see no change in behavior. Path already had UseAAMMapping=True.
    More info:
    http://macslui.blogspot.com/2013/02/sharepoint-2010-problem-in-image-result.html
    https://camerondwyer.wordpress.com/2014/08/04/beware-sharepoint-2013-search-results-and-the-listurl-property/#comment-2606
    Thanks,
    Tommy

  • RAW Files problems with 5DMarkIII

    I recently started shooting RAW in my new 5DMarkIII but everytime I try to transfer those files to Aperture 3 it crashes and no file can be transfered to my computer. I have the app up to date and the firmware of the camera is the last one. I have no problems with the JPG files, but the RAW files crashes Aperture and I cant get them on my computer!

    Thanks! and I apologize if my english is not good enough.
    No problem your english is probably better than mine!
    Update: In the last two hours Aperture could transfer a couple of files but I had to do it one by one. Then, I attempted to transfer a whole group of files, it crashed again.
    This looks like just one of your images on the card is defective. Try to import without rendering previews: Turn off the Preference: "Previews > new Projects automatically generate previews" before importing.
    Then create the previews one by one after import. Probably Aperture will crash when you try to render a preview for the defective  image, but then you will know which image to remove.
    Regards
    Léonie

  • Selecting Multiple File Types With Path Control

    My application uses a file path control for the user to specify an output file.  This output file can have two different formats (.csv or .mbf) which is unknown until the user specifies it through the file dialogue.  However, when the user inputs a file name with a .mbf extension (test.mbf, for example), the file path control automatically appends the typed-in name with a .csv extension (test.mbf.csv).  Given that the Pattern field on the control is written like this: *.csv; *.mbf., it seems that the control is simply taking the first file pattern listed and appending it to whatever is typed into the File Name field in the file dialogue box.  Selection Mode is set to "Files" and "New or existing".
    Anyone know a way to smarten up the file control to recognize the appropriate file type?
    Using LabVIEW 8.6.1.
    Thanks!
    Andrew
    Solved!
    Go to Solution.

    Instead of using the file path control, try using the Fial Dialog Express VI. This will bring up the same dialog box but will allow you much more flexibility. Replace your file path control with a button ("Specify Path" in my example code):

  • H.264 .mov files problem with 2-pass vbr in DVD SP4

    I have converted some VHS tapes by connecting the VCR to my camcorder (as a AC/DC bridge) and the camcorder to my macbook pro via firewire, and record using FCP into .mov files.
    However, these files are huge (13 GB for an hour), and so I shrinked them down by exporting them (using QT pro) into .mov file via h.264 codec.
    However, when I try to convert these already shrinked .mov files into mpeg2 files via compressor 2 (so that I can made a DVD in DVD SP), the files become corrupt when I use 2-pass vbr. (Frame freezes on play back in DVD SP and QT pro). It's OK with 1 pass vbr though.
    If I convert those huge .mov files via mpeg4 in QT pro rather than h.264, there is not problem with 2-pass vbr.
    So my delemma is: shall I store the files using mpeg4, or h.264?
    I am under the impression that h.264 gives a better quality for the same file size than mpeg4, but 2-pass vbr will give a better quality than 1-pass vbr if I want to burn it on a DVD.
    Thanks in advance.

    In general recompressing from VHS to your computer to H.264 (or MPEG 4) then to m2v is going to hurt quality, so if you are able to get extra Hard Drives and store that way, or even a inexpensive camera with a firewire in/out you are probably better off (though with VHS it may be hard to tell regardless)
    Also if you at least go straight the first time to m2v and check to make sure it looks okay to you, you may want to make sure to do that first
    That being said, H.264 and One-Pass should in all likelihood (I have not tried recently, did it a while ago just to test things) will be better than MPEG-4 2-Pass, depends on the settings. Also if you try 1-Pass H.264 it seems to work with Compressor.

  • Olympus E-500 raw file problem with long exposures

    Hi,
    This topic has come up before, but wasn't resolved. Maybe its somewhere else, but I can't find it.
    http://discussions.apple.com/thread.jspa?messageID=4994383&#4994383
    Raw files from my Olympus E-500 with exposures over 3.2s come up with overexposed looking previews in Aperture. I think there is some automatic noise reduction (dark frame) info in these files, since they are 16.68Mb instead of the normal 13.47Mb. Apparently Aperture doesn't know what to do with these larger files.
    Is there a known way around this within Aperture? The files open fine within Olympus Master 2 and Raw Photo Processor.
    I've pasted a screen shot here with some links to raw files:
    http://www.mso.anu.edu.au/~grant/wp/2007/10/raw-problems-with-aperture/
    cheers
    Grant

    Yea, I've had that issue also and figured out the DNG workaround. Filed a bugreport with Apple on Nov 2nd, 2006. It sat with what looked like no attention right up until I got an e-mail on Oct 26th, 2007 (notice the date) saying that the issue was fixed in 10.5. I had already preordered Leopard so was hoping this was right. It wasn't. It's still borked. Logged notes back into the issue saying it wasn't.
    Perhaps if more E-500 users report this it'll get more attention.
    http://bugreport.apple.com

Maybe you are looking for

  • How to I get flash to work after trying to download silver lights

    I was getting ready to start a video on Amazon Prime and Amazon said for faster streaming download Silverlight.  I download it but it still didn't work.  So I deleted it and how the Flash Player won't work.  I just want my Flash to work and forget ab

  • Help!!! : Complex mysql query in dreamweaver

    Ok Guys: I need this query executed on a client's website. I know it's working well in phpmyadmin, but in dreamweaver I cannot put it to work. The point is that the mysql_query funcion in PHP can only execute one query, So I cannot set the initial va

  • Library total song count different than available "Entire music library" number for mobile devices?

    If I go to my iTune library and display the song count I see I have 3094 separate songs. However when I connect my iPhone or iPad and I choose "Sync Music" with the option "Entire music library" it shows 2963 songs. I have 10GB+ of available space on

  • How to truncate fact tables using wb_truncate_table

    Hi, I've got a sequence of mappings that load various staging tables, dimensions and fact tables. At present, I truncate the fact tables manually before loading the dimensions (to avoid foreigh key errors), but would like to write mappings to do the

  • Address book don't respond

    Hello, On my iMac I have few thousands of contacts and for the last week or so when I try to search on a contact nothing happen ! However my contacts still seems to synchronize with iCloud. I also can't creat a new contact . Did this has to do with m