Can't get file from resource in jar.

hi,
I'm using the folowing mechanism to get a configuration file from my classes jar file.
URL configUrl = Config.class.getResource("/resources/"+fileName);
File ressourceFile = new File(configUrl.toURI());while this is working perfectly when i run my app in stand-alone it fails in JavaWebStart. it gives me the folowing error :
java.lang.IllegalArgumentException: URI is not hierarchical
     at java.io.File.<init>(Unknown Source)
     at line 2 aboveafter some investigation it seems that the first line doesn't return a valid URL. I'm getting something like :
jar:file:C:/Documents%20and%20Settings/Patrice/Application%20Data/Sun/Java/Deployment/cache/javaws/http/Dfiona/P80/RMface2face.jar!/resources/system.propertiesthe problem (I think) lies in the URL protocol : jar:file:C:/...
when I run the same lines in stand-alone I get :
file:/E:/Project/.../classes/resources/system.propertieswhich is just what I want.
Is there something I am doing wrong?
thanx,
Patrice.

ok thanx.
in the end I copy the file locally with :
try{
    InputStream input = Config.class.getResourceAsStream("/resources/"+fileName);
    OutputStream output = new FileOutputStream(userConfigFile);
    byte[] temp = new byte[128];
    while(input.available()>0){
        int nb = input.read(temp);
        output.write(temp,0,nb);
    input.close();
    output.close();
} catch (IOException e){
}it works perfectly.
thx.

Similar Messages

  • How can I get file from multiple instance using file adapter

    Hi.
    Our system(PI7.1) have three application instances running with each physical servers.
    We use sender file adapter.
    The file data is sent to one of the servers.
    Now, how can I get the file using three file adater?
    Should I put the file "sapmnt(\usr\sap)" .
    Or are there another solution?
    regards,

    Hi Ashutosh
    You will have to use sapcar.zip which contains the utility Sapcar.exe utility for unzipping the files from SAP compressed files. (*.car file)
    Regards
    Gaurav
    PS: Reward points if solved

  • How can I get file from local disk?

    hi, in my project, I store the files in server local disk, and store file name in Database. How can I get the file according to the file name in database? which means the file names in database are mapped to the file in local disk. How Can my application get the file according to the file name in DB?
    PS: file name are show on one web page as link, when user click the link, user can either open the file immediately or download to local PC.

    Hi Ashutosh
    You will have to use sapcar.zip which contains the utility Sapcar.exe utility for unzipping the files from SAP compressed files. (*.car file)
    Regards
    Gaurav
    PS: Reward points if solved

  • How can i get files from my time capsule to my new mac?

    Hello there, 
    I know this topic i much discussed, but searching has not turned up a solution.
    I have a new mac book pro 15 on order and want to grab my files from my time capsule.   My old mac book pro 15 (3 months old) was encrypted with file safe.  In the past i have never had good results with bringing data to a new mac from time capsules; I've tried many times for my self and family.  As a result I use the time capsule for day to day old file retrieval needs and do manual backups of my data onto externals and NAS devices for migration to new computers-tedious but it has yet to fail me.  This time, I did that with everything except a few folders of my movies and pictures.  They are now prisoner on the time capsule.
    What is the best way to get files off the time capsule and does it require that my login and user name on the new mac be identical to that which was on my old mac?
    (I change my user names each time i get a new mac, not specifically on purpose but i haven't paid attention to what they were when setting up a new computer.)
    any assistance is appreciated.
    Thanks

    Thanks Allan,
    Help me understand what question you're referring to.  I've been through several new macs and am not sure what specifically you're speaking about.
    My old mac had a partition on the drive that I do not want on the new mac, so I am concerned about doing a full restore and prefer a file by file or folder by folder. is this possible?

  • Need advice (help!) Can I get files from Time Machine to a PC

    My Mac book's HD I think is dead. I have an external HD with Time Machine back ups on it. I really NEED to get my address book contacts off and onto my back up PC, for right now. Is there even a way to do that?? and while Im at it what about iTunes library?
    Please tell me there is a way.

    Chad,
    I must disagree with Nerowolf on this one. You should be able to get the items you need off the drive, even connected to a PC.
    Contrary to what Nerowolf believes, Time Machine stores backups as standard, complete files; it does not make "incremental" backups in the traditional sense. Each and every backup includes every file from the source, and each one is a complete file.
    The trick with Time Machine is that the data associated with those many, many files is only copied to the drive once, and each "iteration" of the same file links to that single copy of the data. The process whereby this occurs is called "multiple hard links," and the resultant files are called "multi-linked files."
    You need not be concerned with all this. The important point is that the files are seen as normal files to you and to the OS.
    The real problem, however, is that those files are stored on a volume formatted as HFS+, and Windows cannot normally access this file system. If you attempt to connect your Time Machine drive to a PC, it will want to format it. If you really need to access the drive, you'll need something like MacDrive, a PC utility that allows Windows to mount and access HFS+ volumes. Look for it on Versiontracker.com (in order to use it, you'll need to pay for it).
    CAVEAT: I do not know with certainty that MacDrive includes compatibility with Multi-linked files. Multi-linking is part and parcel of the HFS+ file system format, so there may be no problem, but you might want to double-check to make sure Multi-linked files are fully supported in MacDrive.
    Scott

  • How can i get files from an sd card? removable drive does not pop up on desktop

    i tried connecting the sd card to get files and all that pops up is iphoto, but theres no pictures or anything thats on it.

    First, run Disk Utility to check that the SD card is being recognized and mounting. In the list of devices on the left column, you should see first the internal HDD and the boot volume, then the CD/DVD device, then the SD device and volume.
    To have the SD volume show up on the desktop, make sure that the Finder's General Preferences have the External Disks option checked.

  • How can I get files from my "no entry" MacBook Pro?

    I've got a MacBook Pro A1286 that I got a couple of years ago. It crashed with the "no entry" sign recently.
    It's insured so it'll be getting fixed in the next week or so, but they're not sure if they'll be able to recover the data, so I'd like to try myself first.
    It suddenly went kaput, when I go to Disk Utility in the recovery mode, it says everything is OK, but I went through in terminal and it keeps endlessly trying to access the drive and can't. It can see that the drive's there, but can't access it at all.
    I don't have another Mac, nor an external drive, so I'm not sure how I could go about recovering my files. I was going to try burning an ISO of Disk Drill to a DVD and booting from that, but I'm not sure that's possible.

    See mount section. You can run this from Terminal in Recovery.
    Disk Unmount Using Terminal
    Disk Utility – Force Mount Disk

  • PSE 12 / can't get files from Picassa

    Thanks for reply - that's how I thought it would work but unable to connect to Picassa icon on my desktop for files - nothing shows! Can connect to everything else on desktop! Control Panel /programs etc. does not work either! If I email image, then click on little icon in attach and move it to desktop, only then I can  move pic to PSE 12 Organiser. Something went wrong in download perhaps?  Need to download again?

    Not the Picasa icon. You need to figure out where the photos are and go directly to those.

  • Can I get files from a Mac formatted External Hard Drive onto a PC

    I have some old files on a mac formated external and wanted to know if there is anyway I could plug it into my pc and be able to access it. So far no dice. If there is a way to do it, I'd really appreciate knowing how. Thanks a lot.

    Install an application such as MacDrive onto Windows.
    (37079)

  • I purchased a song (Awaara Hoon (instrumental)) from itune store but it gives me a non-protected m4a file. I need a protected m4p file. How can i get it from itune store??? thanks in advance

    I purchased a song (Awaara Hoon (instrumental)) from itune store but it gives me a non-protected m4a file 
    I need a protected m4p file.
    How can i get it from itune store???
    thanks in advance

    All the music from iTunes Store aren't protected. You can search the web for a site that sells protected music.

  • Can I transfer files from a Mini running 10.4.11 to a new Mini running Lion? States I need to upgrade Migration Assistant, but I see no viable path I can take. OPtions to get photos over to new Mini?

    Can I transfer files from a Mini running 10.4.11 to a new Mini running Lion? States I need to upgrade Migration Assistant, but I see no viable path I can take. OPtions to get photos over to new Mini?

    Thanks Mende1; I know that PPC apps won't function on Intel machines but I can migrate the Universal apps, right? There is such a large gap between Tiger and Mountain Lion - can I still migrate files directly from one to the other taking the Universal apps as well? Sorry, I'm not very computer savvy!
    Len57

  • How can I safely and securely get files from my mac.

    I want something like LogMeIn Pro but for free. ther is a free version it DOES support mac BUT not gettong files. I want to be able to securely get files from my mac from school or anywhere whitout paying!!
    I HAVE had a look on google, no help.

    Try versiontracker.com

  • How can automatic save file from apex to user local directory?

    how can save pdf file from apex to user local directory on button click?

    >
    Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "940509".
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    how can save pdf file from apex to user local directory on button click?As Tony points out the ability to do so would represent a major security breach. The normal approach is to present the user with a download link that when clicked prompts them with a Save dialog in which they can select a location for the downloaded file.
    What is the source of the PDF file?

  • I cannot open a pdf file with aole-mail. I can open pdf files from windows explorer. I have associated pdf with adobe reader. My operating system is window

    I cannot open a pdf file with aol e-mail. I went to preferences in Adobe Reader but did not know what to enter for Incoming IMAP and outgoing SMTP. I can open pdf files from windows explorer as  I have associated .pdf files with adobe reader. My operating system is windows 7.
    When I try to open the pdf file within aol e-mail I get a message: 'Your security settings do not allow this file to be downloaded'.  I have not changed my security settings (Tools, Internet Options, security).

    Or http://helpx.adobe.com/acrobat/kb/pdf-browser-plugin-configuration.html

  • How to get file from FTP Server using File Control

    Hi,
    Any one did getting file from FTP Server?
    Please let me know any one help me.
    I would need to get file from FTP Server.
    Thanks,
    Madhu

    Yes I have done that. But In FTP Server I cannt read file, because no previliges. Only I need to copy file from FTP Server to local server then only I can read that file.
    I tried all options using FileConrol(getFiles(),read()).
    getFiles() - It wont copy the file, it give information about file.
    read() - I dont have previliges to read the file.
    Please tell me any other procedure would be there for getting file from FTPServer.
    Thanks,
    Madhu

Maybe you are looking for

  • Email to text message

    Before I switched to an iPhone it was possible for someone to email a message that was received as a text message (SMS). there are times that receiving a text message is much more convenient than checking email. The AT&T web site says it should be po

  • "Missing or offline titles, effects or generators" mystery

    Suddenly, I have that little yellow warning triangle on my event name and when I go to export, I get this "missing or offline titles, effects or generators."  Nothing in the time line or in the bin has a yellow triangle beside it.  Only yellow triang

  • Need to change user & system status of trade promotion

    Hi, I have a requirement where I need to advance a user status if system status is changed based on some creiteria. Similarly a system status will be changed on a particular user status. Which table is updated for status of trade promotion? Which cla

  • Regarding RFID

    Hi All, I am working in <b>ABAP</b> domain. I want to know some information about <b>RFID</b>. 1. What is it's purpose! Where it will be used mainly. 2. What is your future prospects. 3. How can i find good step-by-step material on the same. If anybo

  • Customizing error message that goes to IP_IN_QUEUE

    We are reading IP_IN_QUEUE from soa composite to find out the errors happened at B2B processing and then going to B2B_InstanceMessage table to read the payload associated with the message id to find out the order number to determine the failed transa