001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.commons.vfs2; 018 019/** 020 * Several standard file selectors. 021 */ 022public final class Selectors { 023 /** 024 * A {@link FileSelector} that selects only the base file/folder. 025 */ 026 public static final FileSelector SELECT_SELF = new FileDepthSelector(); 027 028 /** 029 * A {@link FileSelector} that selects the base file/folder and its direct children. 030 */ 031 public static final FileSelector SELECT_SELF_AND_CHILDREN = new FileDepthSelector(0, 1); 032 033 /** 034 * A {@link FileSelector} that selects only the direct children of the base folder. 035 */ 036 public static final FileSelector SELECT_CHILDREN = new FileDepthSelector(1); 037 038 /** 039 * A {@link FileSelector} that selects all the descendants of the base folder, but does not select the base folder 040 * itself. 041 */ 042 public static final FileSelector EXCLUDE_SELF = new FileDepthSelector(1, Integer.MAX_VALUE); 043 044 /** 045 * A {@link FileSelector} that only files (not folders). 046 */ 047 public static final FileSelector SELECT_FILES = new FileTypeSelector(FileType.FILE); 048 049 /** 050 * A {@link FileSelector} that only folders (not files). 051 */ 052 public static final FileSelector SELECT_FOLDERS = new FileTypeSelector(FileType.FOLDER); 053 054 /** 055 * A {@link FileSelector} that selects the base file/folder, plus all its descendants. 056 */ 057 public static final FileSelector SELECT_ALL = new AllFileSelector(); 058 059 /** 060 * Prevent the class from being instantiated. 061 */ 062 private Selectors() { 063 } 064}