Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EF3B1DE7E for ; Tue, 11 Dec 2012 13:19:16 +0000 (UTC) Received: (qmail 17113 invoked by uid 500); 11 Dec 2012 13:19:16 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 16985 invoked by uid 500); 11 Dec 2012 13:19:12 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 16944 invoked by uid 99); 11 Dec 2012 13:19:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Dec 2012 13:19:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Dec 2012 13:19:08 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3665023888E7; Tue, 11 Dec 2012 13:18:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1420142 - in /accumulo/trunk/core/src: main/java/org/apache/accumulo/core/conf/PropertyType.java test/java/org/apache/accumulo/core/conf/PropertyTest.java Date: Tue, 11 Dec 2012 13:18:46 -0000 To: commits@accumulo.apache.org From: kturner@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121211131847.3665023888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kturner Date: Tue Dec 11 13:18:45 2012 New Revision: 1420142 URL: http://svn.apache.org/viewvc?rev=1420142&view=rev Log: ACCUMULO-895 allowed windows path for instance.dfs.dir Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java accumulo/trunk/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java?rev=1420142&r1=1420141&r2=1420142&view=diff ============================================================================== --- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java (original) +++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java Tue Dec 11 13:18:45 2012 @@ -18,6 +18,8 @@ package org.apache.accumulo.core.conf; import java.util.regex.Pattern; +import org.apache.hadoop.fs.Path; + public enum PropertyType { PREFIX(null, null, null), @@ -49,9 +51,13 @@ public enum PropertyType { PATH("path", ".*", "A string that represents a filesystem path, which can be either relative or absolute to some directory. The filesystem depends on the property."), - ABSOLUTEPATH("absolute path", "[/].*", - "An absolute filesystem path. The filesystem depends on the property. This is the same as path, but enforces that its root is explicitly specified."), - + ABSOLUTEPATH("absolute path", null, + "An absolute filesystem path. The filesystem depends on the property. This is the same as path, but enforces that its root is explicitly specified.") { + public boolean isValidFormat(String value) { + return new Path(value).isAbsolute(); + } + }, + CLASSNAME("java class", "[\\w$.]*", "A fully qualified java class name representing a class on the classpath.
" + "An example is 'java.lang.String', rather than 'String'"), Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java?rev=1420142&r1=1420141&r2=1420142&view=diff ============================================================================== --- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java (original) +++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java Tue Dec 11 13:18:45 2012 @@ -92,5 +92,8 @@ public class PropertyTest { typeCheckValidFormat(PropertyType.HOSTLIST, "localhost", "server1,server2,server3", "server1:1111,server2:3333", "localhost:1111", "server2:1111", "www.server", "www.server:1111", "www.server.com", "www.server.com:111"); typeCheckInvalidFormat(PropertyType.HOSTLIST, ":111", "local host"); + + typeCheckValidFormat(PropertyType.ABSOLUTEPATH, "d:\\foo12", "c:\\foo\\g", "c:\\foo\\c", "/foo", "/foo/c", "c:\\", "/"); + typeCheckInvalidFormat(PropertyType.ABSOLUTEPATH, "foo12", "foo/g", "foo\\c"); } }