]> source.dussan.org Git - sonarqube.git/commitdiff
Remove FileSystemException and IllegalPathException
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 19 Feb 2013 09:27:28 +0000 (10:27 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 19 Feb 2013 09:27:28 +0000 (10:27 +0100)
sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileSystemException.java [deleted file]
sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/IllegalPathException.java [deleted file]
sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/PathResolver.java

diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileSystemException.java b/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileSystemException.java
deleted file mode 100644 (file)
index d3bc469..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2012 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package org.sonar.api.scan.filesystem;
-
-/**
- * @since 3.5
- */
-public class FileSystemException extends RuntimeException {
-  public FileSystemException(String message) {
-    super(message);
-  }
-
-  public FileSystemException(String message, Throwable cause) {
-    super(message, cause);
-  }
-}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/IllegalPathException.java b/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/IllegalPathException.java
deleted file mode 100644 (file)
index d81a7bd..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2012 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package org.sonar.api.scan.filesystem;
-
-/**
- * @since 3.5
- */
-public class IllegalPathException extends FileSystemException {
-
-  public IllegalPathException(String message) {
-    super(message);
-  }
-
-}
index d3de2de11b3de95133f5bbce4a5c4b81e1adcb08..d6c8921e602576181e6b1480a3356a7f620045a5 100644 (file)
@@ -24,7 +24,6 @@ import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 import org.apache.commons.io.FilenameUtils;
 import org.sonar.api.BatchComponent;
-import org.sonar.api.scan.filesystem.IllegalPathException;
 
 import java.io.File;
 import java.util.Collection;
@@ -42,7 +41,7 @@ public class PathResolver implements BatchComponent {
       try {
         file = new File(dir, path).getCanonicalFile();
       } catch (Exception e) {
-        throw new IllegalPathException("Fail to resolve path '" + path + "' relative to: " + dir.getAbsolutePath());
+        throw new IllegalStateException("Fail to resolve path '" + path + "' relative to: " + dir.getAbsolutePath(), e);
       }
     }
     return file;
@@ -98,11 +97,11 @@ public class PathResolver implements BatchComponent {
     return FilenameUtils.equalsNormalizedOnSystem(dir.getAbsolutePath(), cursor.getAbsolutePath());
   }
 
-  public static class RelativePath {
+  public static final class RelativePath {
     private File dir;
     private String path;
 
-    RelativePath(File dir, String path) {
+    private RelativePath(File dir, String path) {
       this.dir = dir;
       this.path = path;
     }