org.sonar.api.resources.File.getPath()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中org.sonar.api.resources.File.getPath()方法的一些代码示例,展示了File.getPath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。File.getPath()方法的具体详情如下:
包路径:org.sonar.api.resources.File
类名称:File
方法名:getPath

File.getPath介绍

暂无

代码示例

代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api

@Override
 public String toString() {
  return new ToStringBuilder(this)
   .append("key", getKey())
   .append("path", getPath())
   .append("filename", filename)
   .append("language", language)
   .toString();
 }
}

代码示例来源:origin: org.codehaus.sonar/sonar-batch

@Override
public String getSource(Resource reference) {
 Resource resource = getResource(reference);
 if (resource instanceof File) {
  File file = (File) resource;
  Project module = currentProject;
  ProjectDefinition def = projectTree.getProjectDefinition(module);
  try {
   return FileUtils.readFileToString(new java.io.File(def.getBaseDir(), file.getPath()));
  } catch (IOException e) {
   throw new IllegalStateException("Unable to read file content " + reference, e);
  }
 }
 return null;
}

代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api

/**
 * {@inheritDoc}
 *
 * @see Resource#getLongName()
 */
@Override
public String getLongName() {
 return StringUtils.defaultIfBlank(getPath(), getKey());
}

代码示例来源:origin: org.sonarsource.sonarqube/sonar-batch

@Override
public String getSource(Resource reference) {
 Resource resource = getResource(reference);
 if (resource instanceof File) {
  File file = (File) resource;
  Project module = currentProject;
  ProjectDefinition def = projectTree.getProjectDefinition(module);
  try {
   return FileUtils.readFileToString(new java.io.File(def.getBaseDir(), file.getPath()));
  } catch (IOException e) {
   throw new IllegalStateException("Unable to read file content " + reference, e);
  }
 }
 return null;
}

代码示例来源:origin: org.codehaus.sonar-plugins.javascript/sonar-javascript-plugin

LOG.debug("Default value of zero will be saved for file: {}", resource.getPath());
LOG.debug("Because: either was not present in LCOV report either was not able to retrieve associated SonarQube resource");
saveZeroValueForResource(resource, context);

代码示例来源:origin: org.codehaus.sonar/sonar-batch

if (ResourceUtils.isFile(resource)) {
 File sonarFile = (File) resource;
 InputFile file = inputPathCache.getFile(project.getEffectiveKey(), sonarFile.getPath());
 if (file == null) {
  throw new IllegalStateException("File " + resource + " was not found in InputPath cache");

相关文章