0N/A/*
0N/A * CDDL HEADER START
0N/A *
0N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
0N/A * You may not use this file except in compliance with the License.
0N/A *
0N/A * See LICENSE.txt included in this distribution for the specific
0N/A * language governing permissions and limitations under the License.
0N/A *
0N/A * When distributing Covered Code, include this CDDL HEADER in each
0N/A * file and include the License file at LICENSE.txt.
0N/A * If applicable, add the following below this CDDL HEADER, with the
0N/A * fields enclosed by brackets "[]" replaced with your own identifying
0N/A * information: Portions Copyright [yyyy] [name of copyright owner]
0N/A *
0N/A * CDDL HEADER END
0N/A */
0N/A
0N/A/*
1335N/A * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
0N/A */
0N/Apackage org.opensolaris.opengrok.index;
0N/A
47N/Aimport java.io.File;
0N/A
0N/A/**
1335N/A * This class maintains a list of file names (like "cscope.out"), SRC_ROOT
1335N/A * relative file paths (like "usr/src/uts" or "usr/src/Makefile"), and glob
1335N/A * patterns (like .make.*) which opengrok should ignore.
2N/A *
0N/A * @author Chandan
0N/A */
1026N/Apublic final class IgnoredNames extends Filter {
112N/A private static final String[] defaultPatterns = {
0N/A "SCCS",
0N/A "CVS",
0N/A "RCS",
0N/A "cscope.in.out",
0N/A "cscope.out.po",
0N/A "cscope.out.in",
0N/A "cscope.po.out",
0N/A "cscope.po.in",
0N/A "cscope.files",
0N/A "cscope.out",
0N/A "Codemgr_wsdata",
0N/A ".cvsignore",
0N/A "CVSROOT",
1335N/A // tags are leftover from the time when ctags did not run daemonized
1335N/A // "TAGS",
1335N/A // "tags",
2N/A ".svn",
286N/A ".git",
1108N/A ".repo",
8N/A ".hg",
8N/A ".hgtags",
250N/A ".bzr",
287N/A ".p4config",
311N/A ".razor",
47N/A "*~",
287N/A "deleted_files",
287N/A ".make.*",
823N/A ".del-*",
1275N/A "_MTN",
1335N/A // File Extensions for Visual Studio and Mono Projects
1275N/A ".vspscc",
1275N/A ".suo",
1275N/A ".vssscc",
1275N/A ".user",
1275N/A ".ncb",
1275N/A ".gpState",
1275N/A ".snc",
1275N/A ".sln",
1275N/A ".vsmdi",
1275N/A ".dll",
0N/A };
1190N/A
112N/A public IgnoredNames() {
1026N/A super();
112N/A addDefaultPatterns();
112N/A }
1190N/A
104N/A /**
104N/A * Should the file be ignored or not?
104N/A * @param file the file to check
104N/A * @return true if this file should be ignored, false otherwise
104N/A */
112N/A public boolean ignore(File file) {
1026N/A return match(file);
47N/A }
1190N/A
104N/A /**
104N/A * Should the file be ignored or not?
104N/A * @param name the name of the file to check
104N/A * @return true if this pathname should be ignored, false otherwise
104N/A */
112N/A public boolean ignore(String name) {
1026N/A return match(name);
47N/A }
112N/A
1026N/A private void addDefaultPatterns() {
112N/A for (String s : defaultPatterns) {
112N/A add(s);
112N/A }
1190N/A }
0N/A}