@Override
public void handleServiceChange(ServiceInfo service, List<String> propertyNames,
List<Object> oldValues, List<Object> newValues) {
XStreamServiceLoader loader = findServiceLoader(service);
//handle the case of a service changing workspace and move the file
int i = propertyNames.indexOf("workspace");
if (i != -1) {
//TODO: share code with GeoServerPersister
WorkspaceInfo old = (WorkspaceInfo) oldValues.get(i);
if (old != null) {
WorkspaceInfo ws = (WorkspaceInfo) newValues.get(i);
File f;
try {
f = new File(dir(ws), loader.getFilename());
f.renameTo(new File(dir(ws,true), loader.getFilename()));
} catch (IOException e) {
throw new RuntimeException( e );
}
}
}