use of com.igormaznitsa.nbmindmap.nb.editor.MMDDataObject in project netbeans-mmd-plugin by raydac.
the class MindMapLink method writeUTF8Text.
public void writeUTF8Text(final String text) throws IOException {
final FileObject foj = getFile();
final FileLock flock = lock(foj);
try {
final OutputStream out = foj.getOutputStream(flock);
try {
IOUtils.write(text, out, "UTF-8");
} finally {
IOUtils.closeQuietly(out);
}
} finally {
flock.releaseLock();
}
final DataObject doj = DataObject.find(foj);
if (doj != null && doj instanceof MMDDataObject) {
LOGGER.info("Notify about change primary file");
((MMDDataObject) doj).firePrimaryFileChanged();
}
}
Aggregations