this.setProperty("Path", path);
path = CommonUtil.adaptFilename(path);
String fullPath = path;
ScraperConfiguration configuration = scraper.getConfiguration();
File originalFile = configuration.getSourceFile();
String originalUrl = configuration.getUrl();
if (originalFile != null) {
String originalPath = CommonUtil.adaptFilename( originalFile.getAbsolutePath() );
int index = originalPath.lastIndexOf('/');
if (index > 0) {
String workingPath = originalPath.substring(0, index);
fullPath = CommonUtil.getAbsoluteFilename(workingPath, path);
}
} else if (originalUrl != null) {
fullPath = CommonUtil.fullUrl(originalUrl, path);
isUrl = true;
}
ScraperConfiguration includedConfig;
try {
includedConfig = isUrl ? new ScraperConfiguration(new URL(fullPath)) : new ScraperConfiguration(fullPath);
scraper.execute(includedConfig.getOperations());
return new EmptyVariable();
} catch (FileNotFoundException e) {
throw new FileException("Cannot include configuration file " + fullPath, e);
} catch (MalformedURLException e) {
throw new FileException("Cannot include configuration file " + fullPath, e);