Return-Path: X-Original-To: apmail-incubator-ooo-issues-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2D8B09963 for ; Fri, 13 Jul 2012 17:38:46 +0000 (UTC) Received: (qmail 2518 invoked by uid 500); 13 Jul 2012 17:38:46 -0000 Delivered-To: apmail-incubator-ooo-issues-archive@incubator.apache.org Received: (qmail 2495 invoked by uid 500); 13 Jul 2012 17:38:46 -0000 Mailing-List: contact ooo-issues-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-issues@incubator.apache.org Delivered-To: mailing list ooo-issues@incubator.apache.org Received: (qmail 2487 invoked by uid 99); 13 Jul 2012 17:38:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jul 2012 17:38:46 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.123] (HELO sif.zones.apache.org) (140.211.11.123) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jul 2012 17:38:45 +0000 Received: by sif.zones.apache.org (Postfix, from userid 80) id 1292D4168; Fri, 13 Jul 2012 17:38:25 +0000 (UTC) From: bugzilla@apache.org To: ooo-issues@incubator.apache.org Subject: [Bug 120273] Can not open a file in UNO mode, if there is a "%" in file name Date: Fri, 13 Jul 2012 17:38:23 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: api X-Bugzilla-Component: code X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: arielch@apache.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ooo-issues@incubator.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://issues.apache.org/ooo/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/ooo/show_bug.cgi?id=120273 --- Comment #6 from Ariel Constenla-Haile --- (In reply to comment #4) > My question is that how can I convert "file:///d:/convert/h%e%l%l%o.odt" > into "file:///D:/convert /h%25e%25l%25l%25o.odt". I have hundreds of files > which hold "%" in the name. It is impossible for me to correct the name > manually one by one. Any suggestion? Thanks! You can use http://www.openoffice.org/api/docs/common/ref/com/sun/star/ucb/XFileIdentifierConverter.html#getFileURLFromSystemPath public static String convertToURL( XComponentContext xContext, String sBase, String sSystemPath) { String sURL = null; try { com.sun.star.ucb.XFileIdentifierConverter xFileConverter = (com.sun.star.ucb.XFileIdentifierConverter) UnoRuntime.queryInterface( com.sun.star.ucb.XFileIdentifierConverter.class, xContext.getServiceManager().createInstanceWithContext( "com.sun.star.ucb.FileContentProvider", xContext)); sURL = xFileConverter.getFileURLFromSystemPath( sBase, sSystemPath); } catch (java.lang.Exception e) { e.printStackTrace(); } finally { return sURL; } } Usage: String sURL = convertToURL(xContext, "", "D:\convert\h%25e%25l%25l%25o.odt"); -- You are receiving this mail because: You are the assignee for the bug.