Can't create URI from filepath string

I am trying to open a file (c:\test.txt) from a java application in the default browser. To do this I must specify the filepath as an URI to desktop.browse():
    Desktop desktop;
    if (Desktop.isDesktopSupported()) {
      desktop = Desktop.getDesktop();     
      String test = "c:" + File.separator + "bob.txt";
      System.out.println(test);
      URI pathTofile;
      try {
        pathTofile = new URI(test);
        desktop.browse(pathTofile);
        System.out.println("where is the browser??");
      } catch (URISyntaxException e) {
        e.printStackTrace();
      } catch (IOException e) {
        e.printStackTrace();
    }  But this line:
pathTofile = new URI(test);
throws:
java.net.URISyntaxException: Illegal character in opaque part at index 2: c:\bob.txt
I have tried replacing backslash with forward slash but that does not help. Any ideas?

Why not just create a File object from the filepath and then call its toURI method? Then you don't have to assume you actually know how a file URI is constructed and you don't get blindsided by gaps in your knowledge.

Similar Messages

  • Error in create-nodeset-from-delimited-string

    Hi Gurus,
    I am trying to use the orcl:create-nodeset-from-delimited-string XPath extension function in the XSL mapper.
    I am using the Map test feature to test my map, and notice that if I use this function, the XSL does not give any output - i guess the map is failing to execute at runtime. When I open the JDeveloper as jdev.exe [so that I can see the command line window for JDev], I can see that an error appears in the command line window that states "Method orcl:create-nodeset-from-delimited-string" not found.
    This XPath function is available for use in the "Advanced Functions" palette in the XSL Mapper.
    Please let me know if
    a) This function can be used within the Mapper, and if so,
    b) whats the right way to use it.
    My usage looks like
    orcl:create-nodeset-from-delimited-string('tns:sampeNode',$delimVar,',')
    where delimVar is a comma delimited string.
    Please let me know your thoughts on this .
    rgds,
    Ram

    Hello..
    Look, I paste a functional piece of code that I develop in a transformation.
    Take this for your example and develop with the same structure.
    BR...Rodrigo
    <xsl:param name="HomeNumber"
    select="/tns:GetCustomerResponse/tns:GetCustomerResult/tns:DefaultAddress/tns:HomePhone"/>
    <xsl:param name="HomeNumberExt"
    select="/tns:GetCustomerResponse/tns:GetCustomerResult/tns:DefaultAddress/tns:HomePhoneExt"/>
    <xsl:param name="WorkNumber"
    select="/tns:GetCustomerResponse/tns:GetCustomerResult/tns:DefaultAddress/tns:WorkPhone"/>
    <xsl:param name="WorkNumberExt"
    select="/tns:GetCustomerResponse/tns:GetCustomerResult/tns:DefaultAddress/tns:WorkPhoneExt"/>
    <xsl:param name="Fax1"
    select="/tns:GetCustomerResponse/tns:GetCustomerResult/tns:DefaultAddress/tns:Fax1"/>
    <xsl:param name="Fax2"
    select="/tns:GetCustomerResponse/tns:GetCustomerResult/tns:DefaultAddress/tns:Fax2"/>
    <xsl:param name="Email"
    select="/tns:GetCustomerResponse/tns:GetCustomerResult/tns:DefaultAddress/tns:Email"/>
    <xsl:param name="contactMedium"
    select="concat($HomeNumber,'-%',$HomeNumberExt,'-%',$WorkNumber,'-%',$WorkNumberExt,'-%',$Fax1,'-%',$Fax2,'-%',$Email,'-')"/>
    <xsl:param name="contactMediumNodeSet"
    select="oraext:create-nodeset-from-delimited-string('contactMediumNodeSet',$contactMedium,'%')"/>

  • Can't create PDFs from Word due to Cambria font. Help.

    I'm using win 7 32 bit office 2010 acrobat pro 9. I can't create pdfs from word because of problems with cambria. I've ttried all the fixes I can find but none worked. Any more ideas?
    [thread title updated by moderator]

    How are you trying to create the PDF? With AA9 you have to print to the Adobe PDF printer or use the MS plugin.
    When you say you cannot create PDFs because of Cambria, what error messages are you getting and copy them here? At this point we really do not know what you are having problems with or how you are trying to create PDFs.
    In the future, please provide a topic to help folks that are stepping through all of the posts. A blank topic almost led me to simply skip your post.

  • Java.sql.SQLException: can't create statement from closed connection

    java.sql.SQLException: can't create statement from closed connection.
    at com.caucho.sql.QPooledConnectionImpl.prepareStatement(QPooledConnecti onImpl.java:411)
    I am getting this error with my JSP's, i am running on Resin on Win2k, and MySql as backend.
    Has anyone else also faced this issue ?
    Looking for someone to help me to solve this issue.
    rc

    Looking for someone to help me to solve this issue.Maybe you are closing the connections. You might want to verify that you are not doing that. Or if you are that that is the correct way to return the connection to the pool.
    Or you could have stale connections. Some databases will time out connections if the connection is no used in a while. (This is a good thing.) But this means connection pools must do something with connections that are not used for a while. The pools usually have a configuration option(s) which allows you to set up a keep alive message which keeps the database from closing the connection.

  • Can't create PDFs from Acrobat or Word?

    Downloaded the 8.1.4 update and now I can't create PDFs from Acrobat or Word.  If I try to create a PDF from the print menu, I get a message indicating that there are no print drivers for this...any ideas?

    Thanks for responding.  Yep, I tried repairing it...no dice.  Then I realized that I'd re-installed AA Pro 8 (having completely given up on the AA Pro 9 upgrade that crashed my system) but not the updates.  So I went through and re-installed each update.  Still no dice. Then I did another repair. Nope.  When I try to create a PDF via the print menu, I get a "Windows cannot print due to a problem with the current printer setup."  This tells me that I have driver problem. But everything else prints fine, and I'm pretty sure Acrobat doesn't have drivers.  I'm stumped...

  • How to use create-nodeset-from-delimited-string()

    Hi All,
    I am getting the input data as following
    name rollno sub
    Anu 1 Maths|science|social
    and the output should be as follows:
    name rollno sub
    Anu 1 Maths
    Anu 1 Science
    Anu 1 Social
    I need to implememt this by using oraext:create-nodeset-from-delimited-string() in XSLT Pls help me out in resolving this issue
    Regards,
    Anasuya

    can u elaborate the query with ur input xml and output xml for clear understanding instead of
    name rollno sub
    Anu 1 Maths|science|social
    and the output should be as follows:
    name rollno sub
    Anu 1 Maths
    Anu 1 Science
    Anu 1 Social
    check the following links it might help u
    http://www.soabyte.com/2011/01/delimited-string-to-xml-nodeset.html
    Edited by: olety on Nov 2, 2011 2:29 AM

  • DACF,BC4J: How can i create RowSetInfo from VO generated by createViewObjectFromQuery

    How can i create and publish RowSetInfo from VO generated by applicationModule.createViewObjectFromQuery()?
    And how can i set named AttributeInfo for
    that RowSetInfo?
    I can't use VO w/o Entity object generated by wisard becouse in generated code my query will be enclosed to SELECT * FROM (...), and rowsetInfo.setQueryCondition
    will add WHERE clause to enclosed select.
    (i need to access to inner WHERE clause)
    null

    I got next exception
    oracle.dacf.dataset.DataSourceOperationException: ResultSetInfo: ResultSet TestRS could not be opened because of problems opening one or more attributes.
    with next message box:
    JBO-25002: Definition SimpleJobber.TestVO of type View Definition not found
    Details:
    DAC-502: ResultSetInfo: ResultSet TestRS could not be opened because of problems opening one or more attributes.
    JBO-25002: Definition SimpleJobber.TestVO of type View Definition not found
    for next test code:
    private void test() {
    final String sql = "SELECT 1+1 X, 1+2 XX FROM dual";
    final ColumnInfo x = new ColumnInfo(java.sql.Types.INTEGER),
    xx = new ColumnInfo(java.sql.Types.INTEGER);
    //at this point session allready has been published
    final ViewObject vo = sessionInfo1.getApplicationModule().createViewObjectFromQueryStmt("TestVO",sql);
    final RowSetInfo rsi = new RowSetInfo();
    vo.remove();
    x.setName("X");
    xx.setName("XX");
    rsi.setAttributeInfo( new ColumnInfo[] {x,xx} );
    rsi.setQueryInfo(new QueryViewInfo("TestVO"));
    rsi.setName("TestRS");
    rsi.setSession(sessionInfo1);
    rsi.publishRowSet();
    null

  • Can we create a structure with string type not char??

    Hi All
    Can we create a structure with type STRING not as a CHAR type??
    Please its urgent.
    Regards
    Deepanker

    HI,
    Yes, you can string instead of CHAR.
    Please follow the steps below :
    SE11 --> Table name --> Create Button --> And input the short description and necessary Delivery and Maintenance fields --> Select Fields tab --> Input some name on field --> And Click on Predefined button --> Press F4 on Data type column --> a Pop window will be displayed --> Select String from that.
    Thanks,
    Sriram Ponna.

  • How can i store values from my String into Array

    Hi guys
    i wants to store all the values from my string into an array,,,, after converting them into intergers,,,, how i can do this becs i have a peice of code which just give me a value of a character at time,,,,charat(2)...BUT i want to the values from String to store in an Array
    here is my peice of code which i m using for 1 char at time
    int[] ExampleArray2 = new int[24];
    String tempci = "Battle of Midway";
    for(int i=0;i>=tempci.length();i++)
    int ascii = tempci.charAt(i); //Get ascii value for the first character.

    public class d1
         public static final void main( String args[] )
              int[] ExampleArray2 = new int[24];
              String tempci = "Battle of Midway";
              for(int i=0;i<tempci.length();i++)
                   int ascii = tempci.charAt(i);
                   ExampleArray2=ascii;
              for(int i=0;i<ExampleArray2.length;i++)
                   System.out.println(ExampleArray2[i]);

  • Can't create PDF from Word file

    I may be missing some functionality or that functionality may not exist.
    I'm running Acrobat Pro 9.2 and MS Word 2004 (11.5) on OSX Leopard 10.5.8. I want to create a PDF from a Word file but NOT using the Print dialog. I want to either create it in Acrobat using File > Create PDF > From File or create it from within Word using the Acrobat menu/toolbar. This is so that it will end up as a tagged PDF.
    However, I don't have an Acrobat menu or toolbar in Word. I thought Acrobat was supposed to have installed these into MS Office when I installed Acrobat. And when within Acrobat if I select File > Create PDF > From File and choose a Word file, I get a message "Acrobat could not open 'filename.doc' because it is either not a supported file type or because the file has been damaged". This happens for all Word files.
    Looking in Acrobat > About Adobe Plug-Ins... under Convert2AdobePDF it says 'Loaded: no'.
    Are these two methods of converting Word files to PDFs something that can only be done in the Windows version of Acrobat? Or is there a plug-in or update I can download to install this missing functionality?
    Thanks for your help,
    Mark

    Keep your Office2004. But Office 2008 does have a way to create PDF's from within  the word and excel Programs.
    It works better than through the AdobePDF Printer, or through the Apple Print menus save as PDF. (Unless you have X.6.x Snow leopard)
    One thing it gets around is a long standing Problem Acrobat has had with word and excel since Word 6.0.1.a/Excel 5.0.1a. Acrobat doesn't know how to interpert Word Page section Breaks. Chopping up a word/excel document in to multiple PDFs that have to be merged back together. MS came up with their own PDF Converter that gets around that problem.

  • Can't Create PDF "from file" using any MS Office files

    Acrobat 8.1.1 Pro. (OS = XP), as part of the CS3 premium edition.
    I can no longer get Acrobat to recognize any of the MS Office applications extensions (.doc, .ppt, etc...) for use with either Create PDF "From File" or when using the Combine Files feature to Merge or Package. The extensions are no longer even listed as an option in the dialog box, or in the Preference settings under "Convert to PDF".
    FYI- I can still use the PDF Maker functionality from within the MS Office application to create a PDF.
    Any Idea what could have happened, or more importantly how to fix?
    ***Update***
    I have re-installed the Acrobat 8 application, and the problem still exists.
    I'm truly puzzled.

    I get this with my PC and I ran detect-repair and reinstalled. Some PDF's I can open and other's I cannot. I can send the email to a cohort and they can open fine.
    "Can't create file: Right-click the folder you want to create the file in and then click Properties on the shortcut menu to check your permissions for the folder"
    Any ideas would be great.
    Thanks!

  • How can I read file from filepath and Insert in to SQL Server ?

    Hi,
    I have table called "table1" and has data like this ..
    id
    Folder
    FileName
    1
       f:\cfs\O\
    ENDTINS5090.tif

    D:\Grant\
    CLMDOC.doc
    3
     f:\cfs\Team\
    CORRES_3526.msg
    4
      f:\cfs\S\
    OTH_001.PDF
    I have another table called "table2" with content column is image datatype.
    Id
    FileName
    Content
    1
    FileName
    2
    ENDTINS5090.tif
    3
    CLMDOC.doc
    4
    CORRES_3526.msg
    5
    OTH_001.PDF
    I would like to insert in to content column in the table2 by reading the file from filepath( table1).
    Is there any simple way or SSIS  able to do it ?
    Please help me on this.
    Thank you.

    http://dimantdatabasesolutions.blogspot.co.il/2009/05/how-to-uploadmodify-more-than-one-blob.html
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Can't create VM from template on iSCSI

    Hello,
    I'm trying to create new VM from original Oracle template "OVM_EL5U3_X86_64_PVM_4GB" on iSCSI device without a success.
    Steps to reproduce:
    1) /OVS is mounted as iSCSI block device
    2) Original Oracle template is copied into /OVS/seed_pool/OVM_EL5U3_X86_64_PVM_4GB
    3) Oracle VM Manager - Import template (no problem)
    4) Oracle VM Manager - Create VM from template
    Result: Files are copied into running_pool, vm.cfg is updated, new VM is visible in VM Manager but with this message:
    failed: <Exception: Error updating the image.> StackTrace: File "/opt/ovs-agent-2.2/OVSSiteVM.py", line 471, in config_vm raise Exception("Error updating the image.")
    5) Oracle VM Manager - Start new VM
    Result:
    Status in VM is Running
    I can connect using VNC console
    But the VM is constantly rebooting with these messages on the console:
    Registering block device major 202
    xvda: xvda1 xvda2 xvda3
    xvda: p2 exceeds device capacity
    xvda: p3 exceeds device capacity
    Waiting for driver initialization.
    xvda: rw=0, want=101530648, limit-12707414
    attemp to access beyond end of device
    switchroot: mount failed: No such file or directory
    Kernel panic - not syncing: Attempted to kill init!
    Looks like there is a problem with partition sizes within the VM image file (xvda: p2 exceeds device capacity)
    I've tried to mount iSCSI formated with ocsf2 and ext3 - I'm getting the same error.
    However there is no problem when I mount /OVS as NFS or local drive and repeat the steps above.
    Any suggestion would be highly appreciated,
    Honza

    It's all sorted now.
    What I've learnt: OVS/Xen hypervisor doesn't seem to handle 4kB iSCSI block sizes.
    I had to change it to 512 bytes (configuration on the iSCSI storage - nothing on the Oracle VM side) and re-create all volumes.
    Just in case you experience something similar.
    Honza
    Edited by: Honza on Jul 21, 2009 3:00 PM

  • Can't creat PDF from .DWG file

    Using the world's most popular CAD program. Can't create a PDF from Adobe 3D. Apparently Adobe 3D wants to open the file using my AutoCAD, but thinks AutoCAD is not on my computer???

    Hi SWS,
    Didn't find it here, but found the answer by Googling and getting pointed to an AECBytes article from Feb '06, which had updated Revit 3D Capture settings (settings more updated than what Adobe gives you!).
    It's too bad the rotation tool is so unweildy and that the walkthru isn't right there with rotation, pan & zoom (crazy - no idea why that is). I need these to work in Reader for regular people, not computer/cad savvy types. Adobe 3D seems to have just great potential, but doesn't seem ready for prime-time yet on the PDF recipient end yet. Maybe version 8 is more polished/joe-regular-user friendly (which is what it's billed as if it's for use in Reader.
    Thanks again for your help.

  • I can't create table from another table?

    Hi everyone!
    I have a problem that I don't known the reason why?
    I'm using Oracle version 8i and I want to create a table from another table, such as:
         CREATE TABLE a_backup as SELECT * FROM a => It's OK, table a_backup is created.
    But there is only a table that I can't created like that, such as:
         CREATE TABLE b_backup AS SELECT * FROM b;
    When I run over command, SQL Plus is not responding... and clients are can't access to DB or Executing forever
    This is the first time I met this problem.
    Can Anyone help me to resolved it?
    Thanks in advance!

    xi`tin wrote:
    Hi everyone!
    I have a problem that I don't known the reason why?
    I'm using Oracle version 8i and I want to create a table from another table, such as:You realize, of course, that 8i is completely out of support .... Is your OS and hardware just as old as your rdbms software, or is it only the rdbms that your company refuses to upgrade?
         CREATE TABLE a_backup as SELECT * FROM a => It's OK, table a_backup is created.
    But there is only a table that I can't created like that, such as:
         CREATE TABLE b_backup AS SELECT * FROM b;
    When I run over command, SQL Plus is not responding... and clients are can't access to DB or Executing forever
    This is the first time I met this problem.
    Can Anyone help me to resolved it?
    Thanks in advance!

Maybe you are looking for

  • Mail crashing hard - crash log details, what to do next

    Hello all. I've just started having Mail app crash moments after starting, apparently as it's trying to download new email from certain accounts. I've seen references to similar problems here lately; the advice usually has been to trash the "com.appl

  • Problem importing to mp3_ file name will not change

    I have experienced this problem multiple times before and still can't find the solution. Every-time I Import a Cd to "MP3" a weird file name is created. When I located the mp3 after import then try to rename it. I notice that the weird file name is s

  • Os9 in os 10.4.11

    Can I install os 9 in my G5 imac os 10.4.11?

  • Use usb superdive on retina mbp win 7? Help!

    I have alot of software on disks that I need to be able install on windows 7 on my new MacBook Pro with Retina Display. When I plug in the USB Superdrive, nothing happens, it there any way to get it recognised? I would appreciate any help. Thanks, Be

  • Business Content - 0COUNTRY_BRAZIL

    Hello, Please help me to activate the 0COUNTRY_BRAZIL from Business Content. In the ODS 0NF_DS07 the monitor was red and I could not proceed. The messages were: - Infoobject 0PBUS_AREA do not existe in the version A - Infoobject 0ID_BUPLA do not exis