private static Change createRenameDesignReferenceChange(ContentStoreRefactoringInfo info) throws Exception {
TextFileChange change = new TextFileChange("", info.getRuntime().getWGAConfigFile());
WGAConfiguration config = info.getRuntime().retrieveWGAConfig(false);
ContentStore currentContentStore = (ContentStore)config.getByUid(info.getContentStoreUID());
boolean configChanged = false;
if(info.getArguments() instanceof RenameArguments){
currentContentStore.getDesign().setName(computeNewDesignReference(info));
configChanged=true;
}else if(info.getArguments() instanceof MoveArguments){
currentContentStore.setEnabled(false);
configChanged=true;
}else if(info.getArguments() instanceof DeleteArguments) {
// check if wgaconfig will still exists after deletion is performed - otherwise we can skip any change here
if (!info.getElement().getFullPath().isPrefixOf(info.getRuntime().getWGAConfigFile().getFullPath())) {
currentContentStore.setEnabled(false);
configChanged=true;
}
}
if(configChanged){
List<ValidationError> errors = config.validate();
if(errors.isEmpty()) {
ByteArrayOutputStream configContent = new ByteArrayOutputStream();
WGAConfiguration.write(config, configContent);