return metadataFolder.getFile(tmlfile.getName().substring(0, tmlfile.getName().length() - tmlfile.getFileExtension().length()) + "metadata.xml");
}
public static TMLMetadataInfo getMetaDataInfo(IFile tmlFile) {
WGADesignStructureHelper helper = new WGADesignStructureHelper(tmlFile);
TMLMetadataInfo metaData = new TMLMetadataInfo();
try {
WGADesignConfigurationModel wgaDesignConfig = helper.createModel();
metaData.setDirectAccess(wgaDesignConfig.isDirectAccessDefault());
} catch (IOException e) {
Activator.getDefault().logError("Cannot load WGADesignConfig", e);
}
if (getMetadataFile(tmlFile).exists()) {
TMLFileMetadataModel metaDataFile = new TMLFileMetadataModel(tmlFile);
metaData.setDirectAccess(metaDataFile.isDirectAccess());
}
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(tmlFile.getContents()));
String readLine = null;
readLine = reader.readLine();
while (readLine != null && readLine.startsWith("##MDSET ")) {
try {
metaData.processDesignHeader(readLine);
}
catch (Exception e) {
Activator.getDefault().logError("Unable to process design metadata header '" + readLine + "' in file '" + tmlFile.getLocation().toString() + "'.", e);
}
readLine = reader.readLine();