if (input instanceof IPathEditorInput) {
IPath path = ((IPathEditorInput) input).getPath();
basePath = path.toOSString();
}
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
new TMXMapWriter().writeMap(currentMap, outputStream, basePath);
byte[] bytes = outputStream.toByteArray();
document.set(new String(bytes));
documentProvider.saveDocument(monitor,input,document,true);
setDirty(false);
} catch (CoreException e) {