delta.changed(this.resultElements[i], IJavaElementDelta.F_CONTENT);
}
addDelta(delta);
}
} else {
throw new JavaModelException(new JavaModelStatus(
IJavaModelStatusConstants.NAME_COLLISION,
Messages.bind(Messages.status_nameCollision, compilationUnitFile.getFullPath().toString())));
}
} else {
try {
String encoding = null;
try {
encoding = folder.getDefaultCharset(); // get folder encoding as file is not accessible
}
catch (CoreException ce) {
// use no encoding
}
InputStream stream = new ByteArrayInputStream(encoding == null ? this.source.getBytes() : this.source.getBytes(encoding));
createFile(folder, unit.getElementName(), stream, this.force);
this.resultElements = new IJavaElement[] {unit};
if (!Util.isExcluded(unit)
&& unit.getParent().exists()) {
for (int i = 0; i < this.resultElements.length; i++) {
delta.added(this.resultElements[i]);
}
addDelta(delta);
}
} catch (IOException e) {
throw new JavaModelException(e, IJavaModelStatusConstants.IO_EXCEPTION);
}
}
worked(1);
} finally {
done();