org.sonar.api.resources
Class File

java.lang.Object
  extended by org.sonar.api.resources.AbstractResource<Directory>
      extended by org.sonar.api.resources.File
All Implemented Interfaces:
Resource

public class File
extends AbstractResource<Directory>


Field Summary
 
Fields inherited from interface org.sonar.api.resources.Resource
QUALIFIER_CLASS, QUALIFIER_DIRECTORY, QUALIFIER_FILE, QUALIFIER_PACKAGE, QUALIFIER_PROJECT_BRANCH, QUALIFIER_PROJECT_TRUNK, QUALIFIER_UNIT_TEST_CLASS, SCOPE_DIRECTORY, SCOPE_FILE, SCOPE_FUNCTION, SCOPE_PROJECT
 
Constructor Summary
File(java.lang.String key)
           
File(java.lang.String directory, java.lang.String filename)
           
 
Method Summary
 Directory getParent()
          The parent is used to build the resources tree, for example for relations between classes, packages and projects.
 boolean matchFilePattern(java.lang.String antPattern)
          Check resource against an Ant pattern, like mypackag?/*Foo.java.
 
Methods inherited from class org.sonar.api.resources.AbstractResource
equals, getDescription, getKey, getLanguage, getName, getQualifier, getScope, hashCode, setDescription, setKey, setLanguage, setName, setQualifier, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

File

public File(java.lang.String key)

File

public File(java.lang.String directory,
            java.lang.String filename)
Method Detail

getParent

public Directory getParent()
Description copied from interface: Resource
The parent is used to build the resources tree, for example for relations between classes, packages and projects.

Return null if the parent is the project.

Specified by:
getParent in interface Resource
Overrides:
getParent in class AbstractResource<Directory>

matchFilePattern

public boolean matchFilePattern(java.lang.String antPattern)
Description copied from interface: Resource
Check resource against an Ant pattern, like mypackag?/*Foo.java. It's used for example to match resource exclusions.

Parameters:
antPattern - Ant-like pattern (with **, * and ?). It includes file suffixes.
Returns:
true if the resource matches the Ant pattern


Copyright © 2009 SonarSource SA. All Rights Reserved.