Examples of relativePath()


Examples of org.sonar.api.batch.fs.InputPath.relativePath()

  public void store(Issue issue) {
    Resource r;
    InputPath inputPath = issue.inputPath();
    if (inputPath != null) {
      if (inputPath instanceof InputDir) {
        r = Directory.create(inputPath.relativePath());
      } else {
        r = File.create(inputPath.relativePath());
      }
    } else {
      r = project;
View Full Code Here

Examples of org.sonar.api.batch.fs.InputPath.relativePath()

    InputPath inputPath = issue.inputPath();
    if (inputPath != null) {
      if (inputPath instanceof InputDir) {
        r = Directory.create(inputPath.relativePath());
      } else {
        r = File.create(inputPath.relativePath());
      }
    } else {
      r = project;
    }
    Issuable issuable = perspectives.as(Issuable.class, r);
View Full Code Here

Examples of org.sonar.api.batch.fs.InputPath.relativePath()

        jsonWriter.beginObject()
          .prop("repository", issue.ruleKey().repository())
          .prop("rule", issue.ruleKey().rule());
        InputPath inputPath = issue.inputPath();
        if (inputPath != null) {
          jsonWriter.prop("path", inputPath.relativePath());
        }
        jsonWriter.prop("message", issue.message())
          .prop("effortToFix", issue.effortToFix())
          .prop("line", issue.line());
        Severity overridenSeverity = issue.overridenSeverity();
View Full Code Here

Examples of org.sonar.api.batch.fs.InputPath.relativePath()

    InputPath inputPath = issue.inputPath();
    if (inputPath != null) {
      if (inputPath instanceof InputDir) {
        value.put(0);
        value.putString(((DefaultInputDir) inputPath).moduleKey());
        value.putString(inputPath.relativePath());
      } else {
        value.put(1);
        value.putString(((DefaultInputFile) inputPath).moduleKey());
        value.putString(inputPath.relativePath());
        value.put(issue.line());
View Full Code Here

Examples of org.sonar.api.batch.fs.InputPath.relativePath()

        value.putString(((DefaultInputDir) inputPath).moduleKey());
        value.putString(inputPath.relativePath());
      } else {
        value.put(1);
        value.putString(((DefaultInputFile) inputPath).moduleKey());
        value.putString(inputPath.relativePath());
        value.put(issue.line());
      }
    } else {
      value.putNull();
    }
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile.relativePath()

  public void put(Value value, Object object, CoderContext context) {
    DefaultMeasure m = (DefaultMeasure) object;
    DefaultInputFile inputFile = (DefaultInputFile) m.inputFile();
    if (inputFile != null) {
      value.putString(inputFile.moduleKey());
      value.putString(inputFile.relativePath());
    } else {
      value.putNull();
    }
    value.putString(m.metric().key());
    value.put(m.value());
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DeprecatedDefaultInputFile.relativePath()

    assertThat(inputFile.type()).isEqualTo(InputFile.Type.MAIN);
    assertThat(inputFile.file()).isEqualTo(srcFile.getAbsoluteFile());
    assertThat(inputFile.absolutePath()).isEqualTo(PathUtils.sanitize(srcFile.getAbsolutePath()));
    assertThat(inputFile.language()).isEqualTo("java");
    assertThat(inputFile.key()).isEqualTo("struts:src/main/java/foo/Bar.java");
    assertThat(inputFile.relativePath()).isEqualTo("src/main/java/foo/Bar.java");
    assertThat(inputFile.lines()).isEqualTo(1);
    assertThat(inputFile.sourceDirAbsolutePath()).isNull();
    assertThat(inputFile.pathRelativeToSourceDir()).isNull();
    assertThat(inputFile.deprecatedKey()).isNull();
  }
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DeprecatedDefaultInputFile.relativePath()

  @Override
  public void put(Value value, Object object, CoderContext context) {
    DeprecatedDefaultInputFile f = (DeprecatedDefaultInputFile) object;
    putUTFOrNull(value, f.moduleKey());
    putUTFOrNull(value, f.relativePath());
    value.putString(f.getFileBaseDir().toString());
    putUTFOrNull(value, f.deprecatedKey());
    value.putString(f.sourceDirAbsolutePath());
    putUTFOrNull(value, f.pathRelativeToSourceDir());
    putUTFOrNull(value, f.absolutePath());
View Full Code Here

Examples of org.sonar.api.scan.filesystem.PathResolver.relativePath()

    if (!paths.isEmpty()) {
      PathResolver resolver = new PathResolver();
      StringBuilder sb = new StringBuilder(label);
      for (Iterator<File> it = paths.iterator(); it.hasNext();) {
        File file = it.next();
        String relativePathToBaseDir = resolver.relativePath(baseDir, file);
        if (relativePathToBaseDir == null) {
          sb.append(file);
        } else if (StringUtils.isBlank(relativePathToBaseDir)) {
          sb.append(".");
        } else {
View Full Code Here

Examples of play.vfs.VirtualFile.relativePath()

        try {
            VirtualFile file = Play.getVirtualFile(renderStatic.file);
            if (file != null && file.exists() && file.isDirectory()) {
                file = file.child("index.html");
                if (file != null) {
                    renderStatic.file = file.relativePath();
                }
            }
            if ((file == null || !file.exists())) {
                serve404(new NotFound("The file " + renderStatic.file + " does not exist"), ctx, request, nettyRequest);
            } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.