Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 43513 invoked from network); 15 Jun 2009 14:08:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Jun 2009 14:08:18 -0000 Received: (qmail 52609 invoked by uid 500); 15 Jun 2009 14:08:29 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 52502 invoked by uid 500); 15 Jun 2009 14:08:29 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 52492 invoked by uid 99); 15 Jun 2009 14:08:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jun 2009 14:08:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jun 2009 14:08:27 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8BFF0234C1ED for ; Mon, 15 Jun 2009 07:08:07 -0700 (PDT) Message-ID: <1413703541.1245074887572.JavaMail.jira@brutus> Date: Mon, 15 Jun 2009 07:08:07 -0700 (PDT) From: "atc (JIRA)" To: issues@commons.apache.org Subject: [jira] Issue Comment Edited: (VALIDATOR-276) isValidURL call returns false for file scheme/protocol when URL is correct In-Reply-To: <931318950.1244987047812.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/VALIDATOR-276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12719562#action_12719562 ] atc edited comment on VALIDATOR-276 at 6/15/09 7:07 AM: -------------------------------------------------------- This small app ([^URLTest.java]) runs numerous tests, all of which should yield true but don't. I ran these with the following JARs: commons-validator-1.3.1.jar jakarta-oro-2.0.8.jar was (Author: atc): This small app runs numerous tests, all of which should yield true but don't. I ran these with the following JARs: commons-validator-1.3.1.jar jakarta-oro-2.0.8.jar > isValidURL call returns false for file scheme/protocol when URL is correct > -------------------------------------------------------------------------- > > Key: VALIDATOR-276 > URL: https://issues.apache.org/jira/browse/VALIDATOR-276 > Project: Commons Validator > Issue Type: Bug > Components: Framework > Affects Versions: 1.3.1 Release > Environment: Linux prometheus 2.6.26-1-amd64 #1 SMP Fri Mar 13 17:46:45 UTC 2009 x86_64 GNU/Linux, Debian sid > Reporter: atc > Attachments: URLTest.java > > > Validate a URL using the file scheme/protocol for a file on a local Linux filesystem returns false. An extensive set of tests can be found here: [^URLTest.java]. > The following code snippet is a quick proof-of-concept: > {noformat} > import org.apache.commons.validator.UrlValidator; > class URLTest { > public static void main(String[] args) { > String url = "file:///etc/hosts"; > UrlValidator urlValidator = new UrlValidator(new String[] {"http", "https", "ftp", "gopher", "file"}); > boolean result = urlValidator.isValid(url); > System.out.println(String.format("URL '%s' is valid: %s", url, result)); > } > } > {noformat} > This issue occurs whether the scheme String[] constructor or the ALLOW_ALL_SCHEMES equivalent is used. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.