From b25a614a7d6f86663966cabb0e1ee668646ad6c1 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 19 Feb 2013 10:27:28 +0100 Subject: [PATCH] Remove FileSystemException and IllegalPathException --- .../scan/filesystem/FileSystemException.java | 33 ------------------- .../scan/filesystem/IllegalPathException.java | 31 ----------------- .../api/scan/filesystem/PathResolver.java | 7 ++-- 3 files changed, 3 insertions(+), 68 deletions(-) delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileSystemException.java delete mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/IllegalPathException.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 index d3bc4690d27..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileSystemException.java +++ /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 index d81a7bd48d2..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/IllegalPathException.java +++ /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); - } - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/PathResolver.java b/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/PathResolver.java index d3de2de11b3..d6c8921e602 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/PathResolver.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/PathResolver.java @@ -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; } -- 2.39.5