~ubuntu-branches/ubuntu/karmic/commons-io/karmic

« back to all changes in this revision

Viewing changes to src/java/org/apache/commons/io/filefilter/DirectoryFileFilter.java

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2007-04-13 08:20:49 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070413082049-2hd3s5ixtxsgvnvm
Tags: 1.3.1.dfsg.1-1
* New upstream (closes: #418973)
* java-gcj-compat-dev and cdbs transition
* Removed junit at the moment (closes: #397567)
* No javadoc at the moment

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright 2002-2004 The Apache Software Foundation.
3
 
 * 
4
 
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 
 * you may not use this file except in compliance with the License.
6
 
 * You may obtain a copy of the License at
 
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
 
3
 * contributor license agreements.  See the NOTICE file distributed with
 
4
 * this work for additional information regarding copyright ownership.
 
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
 
6
 * (the "License"); you may not use this file except in compliance with
 
7
 * the License.  You may obtain a copy of the License at
7
8
 * 
8
9
 *      http://www.apache.org/licenses/LICENSE-2.0
9
10
 * 
32
33
 * </pre>
33
34
 *
34
35
 * @since Commons IO 1.0
35
 
 * @version $Revision: 1.7 $ $Date: 2004/02/23 04:37:57 $
36
 
 * 
37
 
 * @author Henri Yandell
 
36
 * @version $Revision: 471628 $ $Date: 2006-11-05 20:06:45 -0800 (Sun, 05 Nov 2006) $
 
37
 *
38
38
 * @author Stephen Colebourne
39
39
 * @author Peter Donald
40
40
 */
41
41
public class DirectoryFileFilter extends AbstractFileFilter {
42
 
    
43
 
    /** Singleton instance of directory filter */
44
 
    public static final IOFileFilter INSTANCE = new DirectoryFileFilter();
45
 
    
 
42
 
 
43
    /**
 
44
     * Singleton instance of directory filter.
 
45
     * @since Commons IO 1.3
 
46
     */
 
47
    public static final IOFileFilter DIRECTORY = new DirectoryFileFilter();
 
48
    /**
 
49
     * Singleton instance of directory filter.
 
50
     * Please use the identical DirectoryFileFilter.DIRECTORY constant.
 
51
     * The new name is more JDK 1.5 friendly as it doesn't clash with other
 
52
     * values when using static imports.
 
53
     */
 
54
    public static final IOFileFilter INSTANCE = DIRECTORY;
 
55
 
46
56
    /**
47
57
     * Restrictive consructor.
48
58
     */
49
59
    protected DirectoryFileFilter() {
50
60
    }
51
 
    
 
61
 
52
62
    /**
53
63
     * Checks to see if the file is a directory.
54
 
     * 
 
64
     *
55
65
     * @param file  the File to check
56
66
     * @return true if the file is a directory
57
67
     */
58
68
    public boolean accept(File file) {
59
69
        return file.isDirectory();
60
70
    }
61
 
    
 
71
 
62
72
}