]> source.dussan.org Git - sonarqube.git/commitdiff
Remove unused method AnalysisReportService#deleteDirectory()
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Sun, 11 Jan 2015 21:31:05 +0000 (22:31 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Sun, 11 Jan 2015 21:31:05 +0000 (22:31 +0100)
server/sonar-server/src/main/java/org/sonar/server/computation/AnalysisReportService.java
server/sonar-server/src/test/java/org/sonar/server/computation/AnalysisReportServiceTest.java

index a6c943305a100c22e004d0a5826775feb9997003..6a2af749f04b3701241532d8af4bf5e7ea0f4c10 100644 (file)
@@ -23,7 +23,6 @@ package org.sonar.server.computation;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Function;
 import com.google.common.collect.Iterables;
-import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -39,8 +38,6 @@ import org.sonar.batch.protocol.output.component.ReportComponents;
 import org.sonar.batch.protocol.output.issue.ReportIssue;
 import org.sonar.core.issue.db.IssueStorage;
 
-import javax.annotation.Nullable;
-
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
@@ -153,16 +150,4 @@ public class AnalysisReportService implements ServerComponent {
 
     return issue;
   }
-
-  public void deleteDirectory(@Nullable File directory) {
-    if (directory == null) {
-      return;
-    }
-
-    try {
-      FileUtils.deleteDirectory(directory);
-    } catch (IOException e) {
-      LOG.warn(String.format("Failed to delete directory '%s'", directory.getPath()), e);
-    }
-  }
 }
index 875ace20192356cf0692ef655b7700693e54f5e1..feb7a2449d3056184f2f6384beabb8a6fde055f6 100644 (file)
@@ -21,7 +21,6 @@
 package org.sonar.server.computation;
 
 import com.google.common.collect.Lists;
-import org.apache.commons.io.FileUtils;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -55,23 +54,6 @@ public class AnalysisReportServiceTest {
     sut = new AnalysisReportService(issueStorageFactory);
   }
 
-  @Test
-  public void clean_null_directory_does_not_throw_any_exception() throws Exception {
-    sut.deleteDirectory(null);
-  }
-
-  @Test
-  public void clean_temp_folder() throws Exception {
-    File origin = new File(getClass().getResource("/org/sonar/server/computation/AnalysisReportServiceTest/report-folder").getFile());
-    File destination = new File("target/tmp/report-folder-to-delete");
-    FileUtils.copyDirectory(origin, destination);
-    assertThat(destination.exists()).isTrue();
-
-    sut.deleteDirectory(destination);
-
-    assertThat(destination.exists()).isFalse();
-  }
-
   @Test
   public void load_resources() throws Exception {
     File dir = new File(getClass().getResource("/org/sonar/server/computation/AnalysisReportServiceTest/report-folder").getFile());