/** * Internal use only. * @deprecated since 5.1 use {@link FileSystem#inputFile(org.sonar.api.batch.fs.FilePredicate)} */ @Deprecated public static File create(String relativePathFromBasedir) { File file = new File(); String normalizedPath = normalize(relativePathFromBasedir); file.setKey(normalizedPath); file.setPath(normalizedPath); String directoryPath; if (normalizedPath != null && normalizedPath.contains(Directory.SEPARATOR)) { directoryPath = StringUtils.substringBeforeLast(normalizedPath, Directory.SEPARATOR); file.filename = StringUtils.substringAfterLast(normalizedPath, Directory.SEPARATOR); } else { directoryPath = Directory.SEPARATOR; file.filename = normalizedPath; } file.parent = Directory.create(directoryPath); return file; }