How to escape spaces in a URL with HyperlinkEvent.getDescription()

Hi,
I'm trying to open a file whose URL contains spaces, this way:
if (ev.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
String urlStr = ev.getDescription();
BrowserLauncher.openURL(urlStr);
My urlStr contains the value:
"file:/C:/Program Files/My Software/Readme.htm"
and I want to convert it to the correct url format:
"file:/C:/Program%20Files/My%20Software/Readme.htm".
I found a usage note for File's toURL() API, that it should be called using toURI() first which automatically escapes characters that are illegal in URLs, anything similar for HyperlinkEvent's getDescription() (or getURL())?
TIA
- Vidya.

Hi,
I'd tried this earlier, but this also escapes the '/' in the path, resulting into a URL of this form:
�file%3A%2FC%3A%2FProgram+Files%2FMy+Software%2FReadme.htm�
This doesn't work, IE is not able to open the link in the above format.
Thanks,
Vidya.

Similar Messages

  • How do I redirect to a URL with JavaScript on submit in Adobe LiveCycle

    How do I redirect to a specific URL with JavaScript upon submit in Adobe LiveCycle?
    I already have the code in place where the submit event is handled, and just need the specific code to do the redirect.
    Standard asp.net-style redirects such as
    windows.location.replace(http://myURL.com);
    do not work.
    Any help would be appreciated.

    To be able to redirect a website with a submit button, you must have a custom submit button and insert the following line:
    app.launchURL("www.url.com");

  • How to solve space problem at URL String ?

    Hi,
    When I sent to data , with URL, like this
    (targetURL = new URL("http://localhost:8988/wsVasc/VascServlet"?name=erkan hel");
    spaces are problem, for example "name=erkan hel";
    how to solve this problem?
    browser recover this problem as erkan%20hel, but how can I solve this problem ?
    thanks..

    But , I have a problem to get connection ;
    System.out.println("URL-------**" + URLEncoder.encode(url,"UTF-8"));
    targetURL = new URL(URLEncoder.encode(url,"UTF-8"));
    URL-------**http%3A%2F%2Flocalhost%3A8988%2FwsVasc%2FVascServlet%3FserviceName%3Dtest
    Connection error :java.net.MalformedURLException: no protocol: http%3A%2F%2Flocalhost%3A8988%2FwsVasc%2FVascServlet%3FserviceName%3Dtest
    Process exited with exit code 0.

  • How can I redirect APEX(EPG) URL with afrindly one

    Hi All,
    I am using APEX with EPG on oracle 11g, and I would to redirect the URL http://localhost:8080/apex/f?p=122:1:43920293912715::NO with a friendly one like this
    http://project_name.mydomain.com
    Is there any one can help me know; how to do this redirection where I would to hide the port no 8080 within the URL
    Thank you in advance
    Yassin

    Yasen® wrote:
    hi is this solution working for Apex on 11g with EPG? whrere to run this code?Yes, it should work on 11g with EPG.
    Using SqlPlus, log in as SYS and run the code posted by "user7449726" to change the path name and default home page of the DAD.
    To change the port from 8080 (the default) to 80, run the following as SYS using SqlPlus:
    CALL DBMS_XDB.SETHTTPPORT(80);
    ALTER SYSTEM REGISTER;
    Make sure you don't have anything else running on port 80 (such as Microsoft's Internet Information Server) or you will obviously get a conflict.
    - Morten

  • How To Pass Multiple Parameters In URL with Report Builder

    Hi,
    I use apex 4.2 with database xe 11g and i use report builder to build my report i use this link to call report
    function runrep(){
    var vurl = 'http://192.168.0.57:8889/reports/rwservlet?userid=retail/1@xe&destype=cache&desformat=PDF&paramform=no&report=item_cost&P_BATCH_NO='+$v('P138_BATCH_NO');
    popupURL(vurl);
    now i want to pass Multiple Parameters like P138_ITEM_CODE , P138_UOM_CODE
    how can i add this Parameters in URL ?
    Regards
    Ahmed

    Ramani_vadakadu wrote:
    window.open("http://hq-orapp-03.kuf.com:9704/xmlpserver/~weblogic/kufpec/BTA/KUF_CONF_ITINUD.xdo?_xpf=&_xpt=1&_xdo=%2F~weblogic%2Fkuf%2FBTA%2FKUF_CONF_ITINUD.xdo&_xmode=&_paramsP_BTM_ID="+parseInt(document.getElementById('P3_BTA_ID').value)+"&_xt=KUF_CONF_ITINUD&_xf=pdf&_xautorun=true&id=weblogic&passwd=kuf2011","_blank");
    the above code we are using apex JS to BI publisher calling for report as PDF
    i don't know exactly where your parameters , did you customize my link to multiple parameters
    'http://192.168.0.57:8889/reports/rwservlet?userid=retail/1@xe&destype=cache&desformat=PDF&paramform=no&report=item_cost&P_BATCH_NO='+$v('P138_BATCH_NO'); 

  • How to use HTTP_POST : To Call URL with parameters

    Dear Gurus,
    how to call HTTP_post.
    I am having requirement from client to send SMS using URL for which mobile number and text are the parameters.
    Now i want to call this in sheduled job using abap program,
    one of the person suggested me HTTP_POST for the same.
    But how to pass the parameters for this.
    Or is there another way to call this.
    Thanks in advance.
    with  regards,
    Rajesh c

    Check this
    http://help.sap.com/saphelp_nw70/helpdata/en/e5/4d350bc11411d4ad310000e83539c3/content.htm
    Examples
    http://wi.twhost.de/datei/data/QuellcodeDemos.pdf

  • Replacing space in GO URL with %20

    Hi,
    I have created a GO URL and passing the branch name to the target report. The target report has "Is Prompted" filter for the Branch.
    The branch names has spaces between them. eg: "AAA - BBB" like this. To replace the space, i have used the following: REPLACE("EMPTrack".BRANCH,' ','%20') it is also encoded as "AAA%20-%20BBB"
    But when the request is run and the Branch name is navigated to the target report, the space in the branch name is replaced with "," instead of space itself.
    Kindly help me.
    Regards,
    Bhuvan R

    Hi ,
    Try to use '+' sign.

  • How to setup a Godaddy Hosted URL with a Mobile Me Web Host Account

    Is this setup correct for setting up a go daddy hosted domain name and pointing it to my iWeb account?
    CNAME "HOST" field = "www"
    CNAME "Points to" field = "web.me.com"
    I've posted a screen grab of my setup below.
    http://content.screencast.com/users/LukeJMorrison/folders/Snagit/media/0499cc2c- f1af-408f-b215-c396013e08b5/02.23.2011-13.34.30.png

    Yes! You do see your own domain and page path.
    e.g. http://www.epiwellness.com/Site/Welcome.html
    not just http://www.epiwellness.com/ no matter what page you are on, like what you see if you use godaddy.com "forwarding" option.
    URL definitely changes when you change pages.
    Case Closed!
    Regards,
    Luke
    Young Skywalker wrote:
    +*Thank You+!*
    Two more questions:
    1. Is there other settings needed other than just waiting for this setting to update on the servers?
    2. Can you clarify if I will see my domain name or the mobile me domain name once a person browses to the site?
    Regards,
    Luke

  • I have Firefox 6.0 running under Windows XL. When I forward an email with a URL in it, my recipients tell me the URL is not highlighted and they have to cut and paste it into their browser. Why? How can I get my forwarded URLs to be highlighted?

    I have Firefox 6.0 running under Windows XL. When I forward an email with a URL in it, my recipients tell me the URL is not highlighted and they have to cut and paste it into their browser. Why? How can I get my forwarded URLs to be highlighted?

    If you think getting your web pages to appear OK in all the major browsers is tricky then dealing with email clients is way worse. There are so many of them.
    If you want to bulk email yourself, there are apps for it and their templates will work in most cases...
    http://www.iwebformusicians.com/Website-Email-Marketing/EBlast.html
    This one will create the form, database and send out the emails...
    http://www.iwebformusicians.com/Website-Email-Marketing/MailShoot.html
    The alternative is to use a marketing service if your business can justify the cost. Their templates are tested in all the common email clients...
    http://www.iwebformusicians.com/Website-Email-Marketing/Email-Marketing-Service. html
    "I may receive some form of compensation, financial or otherwise, from my recommendation or link."

  • I'm running out of hd space on my MBP with Mavericks. How do I move my Photoshop 5 app off the computer for more space. How can I store the PS5 app on DVD or on my backup hd for a future reinstall on my next Mac?

    I'm running out of hd space on my MBP with Mavericks OS. How do I move my Photoshop 5 app off the computer for more space, and store the PS5 app on DVD or on my backup hd for a future reinstall on my next Mac with larger hd?
    Thanks

    slaglejrp,
    perhaps it would be less expensive to just install a new disk with a larger capacity on your current MacBook Pro, rather than plan on buying a new Mac with a larger disk? Once your current disk has been cloned to the new disk, and the new disk has been installed into your MacBook Pro, that would allow you to keep Photoshop 5 on your current MacBook Pro.

  • Since installing Lion I keep getting the error message 'there was a problem connecting to the server. URLs with the type 'file:" are not supported"' How can I fix this?

    since installing Lion I keep getting the error message 'there was a problem connecting to the server. URLs with the type 'file:" are not supported"' How can I fix this?

    A Davey1 wrote:
    Not a nice answer!
    Posting "Check the 'More like this'" area and not simply providing the answer is a great way to make these groups worthless.
    You're ignoring context.  On the old Apple Discussion Groups I never posted replies like that, instead giving people relatively detailed answers.  The new Apple Support Communities made things worse by introducing certain inefficiencies.  Then came Lion.  The flood of messages that came with Lion required a painful choice for any of the people who had been helping here: (1) Give quality responses to a few questions and ignore the rest.  (2) When applicable, give a brief answer such as the one that you found objectionable.  (3) Give up all the other normal activities of life and spend full time trying to answer questions here.
    People who needed help with Lion problems seemed to have trouble discovering existing message threads that described how to solve their problems.  I never posted the suggestion of "Check the 'More like this' area" without verifying that the help that the poster needed could be found there.  Even doing that, what I posted saved me time that I could use to help someone else.
    The people helping here are all volunteers.  None of them is being paid for the time they spend here.  They all have a life outside of Apple Support Communities.  It's arrogant of you to demand that people helping here spend more time than they already do.

  • Reading Contents of URL with Spaces in its Path (+other odd characters)

    Hi, I am looking for a way to get the contents of a webpage that has a pathname with odd characters in it. Here is my "contents reader":
        public static String getURLContents(URL u){
            try {
                Scanner scan = new Scanner((InputStream)u.getContent());
                String output = "";
                while (scan.hasNextLine()) {
                    output += scan.nextLine()+"\n";
                return output;
            } catch (Exception ex) {
                System.out.println(ex);
                return null;
        }I have here selected exception output from two tests on the same URL, which has spaces. First, nicely formatted spaces (" "->%20)
    java.io.FileNotFoundException: http://www.publichealthalert.org/articles/tinagarcia/jemsek%20part%201.htm
    and Secondly, raw spaces:
    java.io.IOException: Server returned HTTP response code: 400 for URL: http://www.publichealthalert.org/articles/tinagarcia/jemsek part 1.htm
    The second example is obvious - there's spaces, and that's not the right way of doing things. But what's going on in the first example??
    Thank you kindly,
    K
    Edited by: nixxlmai on Jun 8, 2009 11:56 AM

    nixxlmai wrote:
    java.io.FileNotFoundException: http://www.publichealthalert.org/articles/tinagarcia/jemsek%20part%201.htm
    But what's going on in the first example??Do you insinuate that it works when there aren't any spaces in the URL? Have you actually tested an URL without any spaces?
    This exception merely means that the URL itsn't reachable on the given domain. It's actually a 404 error.

  • Q: How to retrieve the current URL with PL/SQL

    I've got a pair of dynamic page portlets on a page. The first is simply an input text box and a submit button, the second is an inventory 'report' based on what is entered in the text box. When a value is entered and the button pressed, there is javascript behind the button that takes the current URL, adds '&ITEM=XXXXXXXX' (removing it first if this is not the first invocation of the page), and redirects to the new page.
    The second portlet uses the &ITEM parm to list a bill of materials for the item. If one of the items possesses a sub-assembly, I want to display the item# in an <a href= manner to make it so the user can simply click on the link to see the BOM of the subassembly.
    To do this, I believe I need to capture the current url and modify it as required to pass the new &ITEM value. I'm having a lot of trouble trying to figure out how to get the current page url. Any help would be greatly appreciated!
    Geoff

    Hello
    I have a similar problem I have developed a pl/sql portlet and put it into a page, this portlets display a dynamic page. This dynamic page have a search functionality, what I am trying to do is that when I click the search button on the dynamic page it recall the whole page and pass the paremeter that the user wrote on the search box, then the portlet that contains the dynamic page recieve the parameter and recall the dynamic page with the parameter that was received. The problem that I have is that the portlet receive the parameter but when I pass the parameter to the dynamic page it doesn't get it. This is the way the I am calling the dynamic page inside my portlet into the show procedure:
    EXECUTE IMMEDIATE
    'begin
    APP_NAME.PG_DYN_DIR_ALFABETICO.show (
    p_arg_names => PORTAL30.wwv_standard_util.string_to_table2(''url_page'',''search_param''),
    p_arg_values => PORTAL30.wwv_standard_util.string_to_table2(:1,:2));
    end;'
    using url_pg,p_text1;
    The dynamic page receive the first parameter(url_page) but not the second one(p_text1), I have checked that the p_text1 has a value on my portlet before I send it to the dynamic page so I really don't understand why my dynamic page doesn't work.
    Please HELP ME. I am desperate
    Ana Lasprilla

  • How to include spaces in rmi codebase value url?

    I am writing an RMI application to run on a LAN, and for my codebase value I am using an URL with the format file:///d:\dir1\dir2\.xx.jar, where the path points to a directory on the server's hard drive. I need to accommodate the situation where dir1 or dir2 contains a space. When I simply use the space (e.g. d:\program files\dir2\xx.jar), I get a java.net.MalformedURLException. When I substitute %20 where the space is, (e.g. d:\program%20files\dir2\xx.jar), the URL is accepted but I get a java.lang.ClassNotFoundException. I know the java.lang.ClassNotFoundException is not due to a path problem (I tested with an identical directory structure, except that I used a path whose directories contained no spaces -- and everything worked). So I infer that the reason for the java.lang.ClassNotFoundException is that no directory with the name "program%20files" exists on the hard drive.
    Any advice would be most appreciated.

    This is not a bug that Java have to solve, it is the
    way URL's should be formed.Actually this is a very bad bug in Java. URL's are just absolute URI's (according to the RFC's, but in Java, URL has little to do with URI), which donot_ allow spaces: spaces must be encoded. When the original URL class was written the RFC's were ignored, and spaces were allowed. Now there is a URI class that works properly (not allowing spaces) which is contradictory to URL.
    Worst of all, creating a URL is ambiguous. In the URL
    "file:/tmp/foo%20bar.txt"
    is this the encoded version of a file with a space, or is it the unencoded version of a file with '%' '2' '0' characters in it? There are regression bug reports for places where this has changed behavior in the Java library (something about RMI for those interested).
    SUN refuses to fix URL because of all the legacy code that relies upon this bug. There are many bug reports, (search the Bug Database for "URL space") often marked simply "will not fix".
    http://developer.java.sun.com/developer/bugParade/bugs/4273532.html
    This is a nasty little problem, and I don't think it can be solved without making a new URL class which behaves correctly, and deprecating the old class. Well, you could also just fix URL and break legacy code :)

  • How much usable "space" does a MacBook Air start with?

    I am contemplating purshasing a MacBook air and would like to know how much "useable" space it starts with. I know there are two options for storage (128GB and 256GB) but I would like to know how much of that is left after a base installational of Mavericks.
    Also, is there a resource that will tell me how much space common apps will take up? (Numbers, Pages, etc)
    Thank you

    reese2147
       I am contemplating purshasing a MacBook air and would like to know how much "useable" space it starts with.
    A new in box 128gig Air will read 121gig+ free out of box
    same for a 256gig ,   248gig free +/-

Maybe you are looking for

  • LabVIEW 8.2 -- "unable to locate LabView run-time" error message

    I am trying to run a LabVIEW version 8 exe file and keep getting the "Unable to locate" error. I downloaded LabVIEW_8.2_Runtime_Engine.exe from the NI website and installed the entire contents of the distribution. After getting the error, I have trie

  • Just reinstalled software and migrated data from Time Machine, now iMac does not recognize printer or camera

    Under the direction of Apple Support, I recently erased my iMac (Intel) hard drive, reinstalled and updated software and migrated data from an external hard drive via Time Machine. Now, after clicking on "PRINT", the print dialog box says "printing"

  • Recorded Animations Not Working In Presenter (8.0.1)

    My animation timings are not working when published to Presenter (8.0.1). Narration timing is good, but all the animations simply manifest one after the other, not as I recorded them as I clicked through (and yes each one is set for "click"). I also

  • Seeburger: No matching inbound binding

    Hi guys, I'm having the following error : I'm using Seeburger AS2 adapter and I'm trying to receive a message from an external partner. I've created the corresponding channels, sender and receiver agreements  but I'm getting the following error: No m

  • Jumpy, choppy animation (imported from Illustrator)

    Hello, I am having a problem with some vines I imported from illustrator having very choppy animation. Every other animation in my project thus far has been smooth, except for the vines which I just want to move slowly and slightly as if blowing in t