Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 26287 invoked from network); 7 Mar 2005 21:16:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 7 Mar 2005 21:16:39 -0000 Received: (qmail 90938 invoked by uid 500); 7 Mar 2005 21:16:25 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 90856 invoked by uid 500); 7 Mar 2005 21:16:25 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 90837 invoked by uid 99); 7 Mar 2005 21:16:25 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FORGED_RCVD_HELO,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from fep19-0.kolumbus.fi (HELO fep19-app.kolumbus.fi) (193.229.0.45) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 07 Mar 2005 13:16:20 -0800 Received: from [213.161.36.31] by fep19-app.kolumbus.fi with ESMTP id <20050307211617.XDY8010.fep19-app.kolumbus.fi@[213.161.36.31]> for ; Mon, 7 Mar 2005 23:16:17 +0200 Message-ID: <422CC437.1040604@elisa.fi> Date: Mon, 07 Mar 2005 23:14:31 +0200 From: Rami Ojares User-Agent: Mozilla Thunderbird 1.0 (X11/20050110) X-Accept-Language: en-us, en MIME-Version: 1.0 To: commons-dev@jakarta.apache.org Subject: Re: [vfs] parsing uri References: In-Reply-To: X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Here is my proposal using idea from binkley /** * Finds a local file, from its local name. */ public FileObject findLocalFile(final String name) throws FileSystemException { // TODO - tidy this up, no need to turn the name into an absolute URI, // and then straight back again return findFile(null, (new File(name)).toURI().toString(), null); } /** * Finds a local file. */ public FileObject findLocalFile(final File file) throws FileSystemException { // TODO - tidy this up, should build file object straight from the file return findFile(null, file.getAbsoluteFile().toURI().toString(), null); } I tried it and it worked. - rami --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org