}
Resource dir=RestDeleteApplication.toResource(pc,dirPath);
ConfigWebImpl config=(ConfigWebImpl) pc.getConfig();
Mapping[] mappings = config.getRestMappings();
Mapping mapping;
// id is mapping name
String virtual=serviceMapping.trim();
if(!virtual.startsWith("/")) virtual="/"+virtual;
if(!virtual.endsWith("/")) virtual+="/";
boolean hasResetted=false;
for(int i=0;i<mappings.length;i++){
mapping=mappings[i];
if(mapping.getVirtualWithSlash().equals(virtual)){
// directory has changed
if(!RestUtil.isMatch(pc, mapping, dir) || (defaultMapping!=null && mapping.isDefault()!=defaultMapping.booleanValue())) {
update(pc,dir,virtual,RestDeleteApplication.getPassword(pc,webAdminPassword),defaultMapping==null?mapping.isDefault():defaultMapping.booleanValue());
}
mapping.reset(pc);
hasResetted=true;
}
}
if(!hasResetted) {
update(pc,dir,virtual,RestDeleteApplication.getPassword(pc,webAdminPassword),defaultMapping==null?false:defaultMapping.booleanValue());