@ScannerSide @Immutable public class PathResolver extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PathResolver.RelativePath
Deprecated.
since 6.0 was used when component keys were relative to source dirs
|
Constructor and Description |
---|
PathResolver() |
Modifier and Type | Method and Description |
---|---|
File |
relativeFile(File dir,
String path) |
List<File> |
relativeFiles(File dir,
List<String> paths) |
PathResolver.RelativePath |
relativePath(Collection<File> dirs,
File file)
Deprecated.
since 6.0 was used when component keys were relative to source dirs
|
String |
relativePath(File dir,
File file) |
String |
relativePath(Path dir,
Path file)
Similar to
Path.relativize(Path) except that:
null is returned if file is not a child of dir
the resulting path is converted to use Unix separators
|
static Optional<String> |
relativize(Path dir,
Path file)
Similar to
Path.relativize(Path) except that:
Empty is returned if file is not a child of dir
the resulting path is converted to use Unix separators
|
public PathResolver()
public File relativeFile(File dir, String path)
@Deprecated @CheckForNull public PathResolver.RelativePath relativePath(Collection<File> dirs, File file)
@CheckForNull public String relativePath(Path dir, Path file)
Path.relativize(Path)
except that:
public static Optional<String> relativize(Path dir, Path file)
Path.relativize(Path)
except that:
@CheckForNull public String relativePath(File dir, File file)
Copyright © 2009–2018 SonarSource. All rights reserved.