+++ /dev/null
-/*
- * 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);
- }
-}
+++ /dev/null
-/*
- * 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);
- }
-
-}
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;
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;
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;
}