Codota Logo
FilePredicates.is
Code IndexAdd Codota to your IDE (free)

How to use
is
method
in
org.sonar.api.batch.fs.FilePredicates

Best Java code snippets using org.sonar.api.batch.fs.FilePredicates.is (Showing top 20 results out of 315)

  • Common ways to obtain FilePredicates
private void myMethod () {
FilePredicates f =
  • Codota IconFileSystem fs;fs.predicates()
  • Codota IconSensorContext context;context.fileSystem().predicates()
  • Smart code suggestions by Codota
}
origin: SonarSource/sonarqube

@Test
public void is_file() throws Exception {
 // relative file
 assertThat(predicates.is(new File(javaFile.relativePath())).apply(javaFile)).isTrue();
 // absolute file
 assertThat(predicates.is(javaFile.file()).apply(javaFile)).isTrue();
 assertThat(predicates.is(javaFile.file().getAbsoluteFile()).apply(javaFile)).isTrue();
 assertThat(predicates.is(new File(javaFile.file().toURI())).apply(javaFile)).isTrue();
 assertThat(predicates.is(temp.newFile()).apply(javaFile)).isFalse();
}
origin: org.sonarsource.python/sonar-python-plugin

@CheckForNull
private InputFile getSonarTestFile(File file) {
 LOG.debug("Using the key '{}' to lookup the resource in SonarQube", file.getPath());
 return fileSystem.inputFile(fileSystem.predicates().is(file));
}
origin: SonarSource/sonar-python

@CheckForNull
private InputFile getSonarTestFile(File file) {
 LOG.debug("Using the key '{}' to lookup the resource in SonarQube", file.getPath());
 return fileSystem.inputFile(fileSystem.predicates().is(file));
}
origin: SonarSource/sonar-java

public InputFile inputFromIOFile(File file) {
 return fs.inputFile(fs.predicates().is(file));
}
origin: org.sonarsource.java/java-frontend

public InputFile inputFromIOFile(File file) {
 return fs.inputFile(fs.predicates().is(file));
}
origin: org.sonarsource.java/java-squid

public InputFile inputFromIOFile(File file) {
 return fs.inputFile(fs.predicates().is(file));
}
origin: fabriciocolombo/sonar-delphi

public InputFile getFile(File file) {
 return fs.inputFile(fs.predicates().is(file));
}
origin: SonarSource/sonar-java

 @Override
 public void scanFile(JavaFileScannerContext context) {
  sonarFile = fs.inputFile(fs.predicates().is(context.getFile()));
  createCommentLineVisitorAndFindNoSonar(context);
 }
}
origin: org.sonarsource.java/java-frontend

 @Override
 public void scanFile(JavaFileScannerContext context) {
  sonarFile = fs.inputFile(fs.predicates().is(context.getFile()));
  createCommentLineVisitorAndFindNoSonar(context);
 }
}
origin: org.sonarsource.java/java-squid

 @Override
 public void scanFile(JavaFileScannerContext context) {
  sonarFile = fs.inputFile(fs.predicates().is(context.getFile()));
  createCommentLineVisitorAndFindNoSonar(context);
 }
}
origin: SonarSource/sonar-java

 @Override
 public void scanFile(JavaFileScannerContext context) {
  Preconditions.checkNotNull(sensorContext);
  JavaFilesCache javaFilesCache = new JavaFilesCache();
  javaFilesCache.scanFile(context);
  InputFile inputFile = fs.inputFile(fs.predicates().is(context.getFile()));
  if (inputFile == null) {
   throw new IllegalStateException("resource not found : " + context.getFileKey());
  }
  for (Map.Entry<String, File> classIOFileEntry : javaFilesCache.getResourcesCache().entrySet()) {
   resourcesByClass.put(classIOFileEntry.getKey(), inputFile);
   if (context.getFileKey() != null) {
    sourceFileByClass.put(classIOFileEntry.getKey(), context.getFileKey());
   }
  }
 }
}
origin: org.codehaus.sonar-plugins.css/css-frontend

@Override
public void visitFile(Tree tree) {
 this.inputFile = fileSystem.inputFile(fileSystem.predicates().is(getContext().getFile()));
}
origin: racodond/sonar-css-plugin

@Override
public void visitFile(Tree tree) {
 this.inputFile = fileSystem.inputFile(fileSystem.predicates().is(getContext().getFile()));
}
origin: org.codehaus.sonar-plugins.css/css-frontend

@Override
public void visitFile(Tree scriptTree) {
 File file = getContext().getFile();
 inputFile = fileSystem.inputFile(fileSystem.predicates().is(file));
 cpdTokens = sensorContext.newCpdTokens().onFile(inputFile);
}
origin: racodond/sonar-css-plugin

@Override
public void visitFile(Tree scriptTree) {
 File file = getContext().getFile();
 inputFile = fileSystem.inputFile(fileSystem.predicates().is(file));
 cpdTokens = sensorContext.newCpdTokens().onFile(inputFile);
}
origin: org.codehaus.sonar-plugins.css/css-frontend

@Override
public void visitFile(Tree tree) {
 highlighting = sensorContext.newHighlighting().onFile(fileSystem.inputFile(fileSystem.predicates().is(getContext().getFile())));
}
origin: racodond/sonar-css-plugin

@Override
public void visitFile(Tree tree) {
 highlighting = sensorContext.newHighlighting().onFile(fileSystem.inputFile(fileSystem.predicates().is(getContext().getFile())));
}
origin: SonarSource/sonar-java

 @Override
 public void scanFile(JavaFileScannerContext context) {
  InputFile component = fileSystem.inputFile(fileSystem.predicates().is(context.getFile()));
  if (component == null) {
   throw new AnalysisException("Component not found: " + context.getFileKey());
  }
  String componentKey = component.key();
  for (JavaIssueFilter javaIssueFilter : getIssueFilters()) {
   javaIssueFilter.setComponentKey(componentKey);
   javaIssueFilter.scanFile(context);
  }
 }
}
origin: org.sonarsource.java/java-checks

 @Override
 public void scanFile(JavaFileScannerContext context) {
  InputFile component = fileSystem.inputFile(fileSystem.predicates().is(context.getFile()));
  if (component == null) {
   throw new AnalysisException("Component not found: " + context.getFileKey());
  }
  String componentKey = component.key();
  for (JavaIssueFilter javaIssueFilter : getIssueFilters()) {
   javaIssueFilter.setComponentKey(componentKey);
   javaIssueFilter.scanFile(context);
  }
 }
}
origin: racodond/sonar-css-plugin

private void saveLineIssue(LineIssue issue) {
 NewIssue newIssue = sensorContext.newIssue();
 InputFile primaryFile = Preconditions.checkNotNull(fileSystem.inputFile(fileSystem.predicates().is(issue.file())));
 NewIssueLocation primaryLocation = newIssue.newLocation()
  .message(issue.message())
  .on(primaryFile)
  .at(primaryFile.selectLine(issue.line()));
 newIssue
  .forRule(ruleKey(issue.check()))
  .at(primaryLocation);
 if (issue.cost() != null) {
  newIssue.gap(issue.cost());
 }
 newIssue.save();
}
org.sonar.api.batch.fsFilePredicatesis

Javadoc

Warning - may not be supported in SonarLint

Popular methods of FilePredicates

  • hasLanguage
  • and
  • hasType
  • hasPath
    if the parameter represents an absolute path for the running environment, then returns #hasAbsoluteP
  • hasAbsolutePath
    Predicate that find file by its absolute path. The parameter accepts forward/back slashes as separat
  • hasRelativePath
    Predicate that gets a file by its relative path. The parameter accepts forward/back slashes as separ
  • all
    Predicate that always evaluates to true
  • matchesPathPattern
    Predicate that gets the files which "path" matches a wildcard pattern. The path is the path part of
  • or
  • hasLanguages
  • hasStatus
    Look for InputFile having a specific InputFile#status()
  • doesNotMatchPathPatterns
    Predicate that gets the files that do not match any of the given wildcard patterns. No filter is app
  • hasStatus,
  • doesNotMatchPathPatterns,
  • not,
  • hasAnyStatus,
  • matchesPathPatterns,
  • doesNotMatchPathPattern,
  • hasExtension,
  • hasFilename,
  • hasURI

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • addToBackStack (FragmentTransaction)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Join (org.hibernate.mapping)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now