@Override public String toString() { return new ToStringBuilder(this) .append("key", getKey()) .append("path", getPath()) .append("filename", filename) .append("language", language) .toString(); } }
@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; }
/** * {@inheritDoc} * * @see Resource#getLongName() */ @Override public String getLongName() { return StringUtils.defaultIfBlank(getPath(), getKey()); }
@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; }
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);
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");