Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 88682981F for ; Thu, 27 Oct 2011 04:32:54 +0000 (UTC) Received: (qmail 70394 invoked by uid 500); 27 Oct 2011 04:32:51 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 70333 invoked by uid 500); 27 Oct 2011 04:32:49 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 70319 invoked by uid 99); 27 Oct 2011 04:32:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Oct 2011 04:32:45 +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.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Oct 2011 04:32:43 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 8E09323889D7 for ; Thu, 27 Oct 2011 04:32:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1189604 - in /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2: AllFileSelector.java FileExtensionSelector.java Date: Thu, 27 Oct 2011 04:32:23 -0000 To: commits@commons.apache.org From: ggregory@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111027043223.8E09323889D7@eris.apache.org> Author: ggregory Date: Thu Oct 27 04:32:23 2011 New Revision: 1189604 URL: http://svn.apache.org/viewvc?rev=1189604&view=rev Log: Fix Javadoc typo. Added: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileExtensionSelector.java Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/AllFileSelector.java Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/AllFileSelector.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/AllFileSelector.java?rev=1189604&r1=1189603&r2=1189604&view=diff ============================================================================== --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/AllFileSelector.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/AllFileSelector.java Thu Oct 27 04:32:23 2011 @@ -37,7 +37,7 @@ public class AllFileSelector /** * Determines whether a folder should be traversed. * @param fileInfo The file selection information. - * @return true if descendents should be traversed, fase otherwise. + * @return true if descendents should be traversed, false otherwise. */ public boolean traverseDescendents(final FileSelectInfo fileInfo) { Added: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileExtensionSelector.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileExtensionSelector.java?rev=1189604&view=auto ============================================================================== --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileExtensionSelector.java (added) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileExtensionSelector.java Thu Oct 27 04:32:23 2011 @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.vfs2; + +/** + * A {@link FileSelector} that selects the given file extension. + * + * @author Commons VFS team + */ +public class FileExtensionSelector + implements FileSelector { + + private final String extension; + + public FileExtensionSelector(String extension) { + this.extension = extension; + } + + /** + * Determines if a file or folder should be selected. + * @param fileInfo The file selection information. + * @return true if the file should be selected, false otherwise. + */ + public boolean includeFile(final FileSelectInfo fileInfo) + { + return fileInfo.getFile().getName().getExtension().equalsIgnoreCase(this.extension); + } + + /** + * Determines whether a folder should be traversed. + * @param fileInfo The file selection information. + * @return true if descendents should be traversed, false otherwise. + */ + public boolean traverseDescendents(final FileSelectInfo fileInfo) + { + return true; + } +}