for (SdkLibrary library : libraryMap.getSdkLibraries()) {
String libraryPath = library.getPath();
if (filePath.replace('\\', '/').equals(libraryPath)) {
String path = library.getShortName();
try {
return new FileBasedSource(new URI(path), file);
} catch (URISyntaxException exception) {
AnalysisEngine.getInstance().getLogger().logInformation(
"Failed to create URI: " + path,
exception);
return null;
}
}
libraryPath = new File(libraryPath).getParent();
if (filePath.startsWith(libraryPath + File.separator)) {
String path = library.getShortName() + "/" + filePath.substring(libraryPath.length() + 1);
try {
return new FileBasedSource(new URI(path), file);
} catch (URISyntaxException exception) {
AnalysisEngine.getInstance().getLogger().logInformation(
"Failed to create URI: " + path,
exception);
return null;