use of org.sonar.api.utils.internal.DefaultTempFolder in project sonarqube by SonarSource.
the class AnalysisTempFolderProvider method provide.
public TempFolder provide(ProjectReactor projectReactor) {
if (projectTempFolder == null) {
Path workingDir = projectReactor.getRoot().getWorkDir().toPath();
Path tempDir = workingDir.normalize().resolve(TMP_NAME);
try {
Files.deleteIfExists(tempDir);
Files.createDirectories(tempDir);
} catch (IOException e) {
throw new IllegalStateException("Unable to create root temp directory " + tempDir, e);
}
projectTempFolder = new DefaultTempFolder(tempDir.toFile(), true);
}
return projectTempFolder;
}
use of org.sonar.api.utils.internal.DefaultTempFolder in project sonarlint-core by SonarSource.
the class AnalysisTempFolderProvider method provide.
public TempFolder provide(StandaloneAnalysisConfiguration analysisConfig) {
if (projectTempFolder == null) {
Path workingDir = analysisConfig.workDir();
Path tempDir = workingDir.normalize().resolve(TMP_NAME);
try {
Files.deleteIfExists(tempDir);
Files.createDirectories(tempDir);
} catch (IOException e) {
throw new IllegalStateException("Unable to create root temp directory " + tempDir, e);
}
projectTempFolder = new DefaultTempFolder(tempDir.toFile(), true);
}
return projectTempFolder;
}
use of org.sonar.api.utils.internal.DefaultTempFolder in project sonarlint-core by SonarSource.
the class GlobalTempFolderProvider method provide.
public TempFolder provide(AbstractGlobalConfiguration globalConfiguration) {
if (tempFolder == null) {
Path workingPath = globalConfiguration.getWorkDir();
try {
cleanTempFolders(workingPath);
} catch (IOException e) {
LOG.error(String.format("failed to clean global working directory: %s", workingPath), e);
}
Path tempDir = createTempFolder(workingPath);
tempFolder = new DefaultTempFolder(tempDir.toFile(), true);
}
return tempFolder;
}
use of org.sonar.api.utils.internal.DefaultTempFolder in project sonarqube by SonarSource.
the class TempFolderProvider method provide.
public TempFolder provide(ServerFileSystem fs) {
if (tempFolder == null) {
File tempDir = new File(fs.getTempDir(), "tmp");
try {
FileUtils.forceMkdir(tempDir);
} catch (IOException e) {
throw new IllegalStateException("Unable to create temp directory " + tempDir, e);
}
tempFolder = new DefaultTempFolder(tempDir);
}
return tempFolder;
}
use of org.sonar.api.utils.internal.DefaultTempFolder in project sonarqube by SonarSource.
the class ComputationTempFolderProvider method provide.
public TempFolder provide(ServerFileSystem fs) {
if (this.tempFolder == null) {
File tempDir = new File(fs.getTempDir(), "ce");
try {
FileUtils.forceMkdir(tempDir);
} catch (IOException e) {
throw new IllegalStateException("Unable to create computation temp directory " + tempDir, e);
}
File computationDir = new DefaultTempFolder(tempDir).newDir();
this.tempFolder = new DefaultTempFolder(computationDir, true);
}
return this.tempFolder;
}
Aggregations