try {
host = hostAPI.find(fr.getFolder().getHostId(), user, false);
folderPath = APILocator.getIdentifierAPI().find(fr.getFolder()).getPath();
} catch (DotDataException e) {
Logger.error(FolderResourceImpl.class, e.getMessage(), e);
throw new DotRuntimeException(e.getMessage(), e);
} catch (DotSecurityException e) {
Logger.error(FolderResourceImpl.class, e.getMessage(), e);
throw new DotRuntimeException(e.getMessage(), e);
}
dotDavHelper.createTempFolder(File.separator + host.getHostname() + folderPath + name);
return;
}
try {
String p = fr.getPath();
if(!p.endsWith("/"))
p = p + "/";
dotDavHelper.move(this.getPath(), p + name, user, isAutoPub);
} catch (Exception e) {
Logger.error(this, e.getMessage(), e);
throw new DotRuntimeException(e.getMessage(), e);
}
}else if(collRes instanceof HostResourceImpl){
HostResourceImpl hr = (HostResourceImpl)collRes;
if(dotDavHelper.isTempResource(name)){
Host host = hr.getHost();
dotDavHelper.createTempFolder(File.separator + host.getHostname());
return;
}
try {
String p = this.getPath();
if(!p.endsWith("/"))
p = p +"/";
dotDavHelper.move(p, "/" + hr.getName() + "/" + name, user, isAutoPub);
} catch (Exception e) {
Logger.error(this, e.getMessage(), e);
throw new DotRuntimeException(e.getMessage(), e);
}
}
}