Package org.sonar.api.scan.filesystem
Class PathResolver
- java.lang.Object
-
- org.sonar.api.scan.filesystem.PathResolver
-
@ScannerSide @Immutable public class PathResolver extends java.lang.Object
- Since:
- 3.5
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PathResolver.RelativePath
Deprecated.since 6.0 was used when component keys were relative to source dirs
-
Constructor Summary
Constructors Constructor Description PathResolver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.io.File
relativeFile(java.io.File dir, java.lang.String path)
java.util.List<java.io.File>
relativeFiles(java.io.File dir, java.util.List<java.lang.String> paths)
java.lang.String
relativePath(java.io.File dir, java.io.File file)
java.lang.String
relativePath(java.nio.file.Path dir, java.nio.file.Path file)
Similar toPath.relativize(Path)
except that: null is returned if file is not a child of dir the resulting path is converted to use Unix separatorsPathResolver.RelativePath
relativePath(java.util.Collection<java.io.File> dirs, java.io.File file)
Deprecated.since 6.0 was used when component keys were relative to source dirsstatic java.util.Optional<java.lang.String>
relativize(java.nio.file.Path dir, java.nio.file.Path file)
Similar toPath.relativize(Path)
except that: Empty is returned if file is not a child of dir the resulting path is converted to use Unix separators
-
-
-
Method Detail
-
relativeFile
public java.io.File relativeFile(java.io.File dir, java.lang.String path)
-
relativeFiles
public java.util.List<java.io.File> relativeFiles(java.io.File dir, java.util.List<java.lang.String> paths)
-
relativePath
@Deprecated @CheckForNull public PathResolver.RelativePath relativePath(java.util.Collection<java.io.File> dirs, java.io.File file)
Deprecated.since 6.0 was used when component keys were relative to source dirs
-
relativePath
@CheckForNull public java.lang.String relativePath(java.nio.file.Path dir, java.nio.file.Path file)
Similar toPath.relativize(Path)
except that:- null is returned if file is not a child of dir
- the resulting path is converted to use Unix separators
- Since:
- 6.0
-
relativize
public static java.util.Optional<java.lang.String> relativize(java.nio.file.Path dir, java.nio.file.Path file)
Similar toPath.relativize(Path)
except that:- Empty is returned if file is not a child of dir
- the resulting path is converted to use Unix separators
- Since:
- 6.6
-
relativePath
@CheckForNull public java.lang.String relativePath(java.io.File dir, java.io.File file)
-
-