use of net.sourceforge.pmd.eclipse.plugin.PMDPlugin in project pmd-eclipse-plugin by pmd.
the class PreferencesManagerImpl method storeRuleSetInStateLocation.
/**
* Store the rule set in preference store
*/
private void storeRuleSetInStateLocation(RuleSet ruleSet) {
OutputStream out = null;
PMDPlugin plugin = PMDPlugin.getDefault();
try {
IPath ruleSetLocation = plugin.getStateLocation().append(PREFERENCE_RULESET_FILE);
out = new FileOutputStream(ruleSetLocation.toOSString());
IRuleSetWriter writer = plugin.getRuleSetWriter();
writer.write(out, ruleSet);
out.flush();
} catch (IOException e) {
plugin.logError("IO Exception when storing ruleset in state location", e);
} catch (WriterException e) {
plugin.logError("General PMD Eclipse Exception when storing ruleset in state location", e);
} finally {
IOUtil.closeQuietly(out);
}
}
Aggregations