public static String createIgnorePatternForResource(final IResource resource){
  Check.notNull(resource,"resource");
  final String path=TPIgnoreCache.createResourceMatchString(resource);
  String patternString=Pattern.quote(path);
  if (resource.getType() == IResource.FOLDER || resource.getType() == IResource.PROJECT) {
    patternString=patternString + ".*";
  }
  return patternString;
}

public static String createIgnorePatternForResource ( final IResource resource ) { Check . notNull ( resource , "resource" ) ; final String path = TPIgnoreCache . createResourceMatchString ( resource ) ; String patternString = Pattern . quote ( path ) ; if ( resource . getType ( ) == IResource . FOLDER || resource . getType ( ) == IResource . PROJECT ) { patternString = patternString + ".*" ; } return patternString ; }
creates a regular expression to match the given resource . if the resource is a project or folder , the pattern matches every path which starts with that folder path . for files , the expression matches that file exactly .
