if(StringUtil.isEmpty(strDestination))
throw new ApplicationException("attribute destination is not defined");
// real to source
Resource newdirectory=toDestination(pc,strDestination,directory);
if ( nameconflict == NAMECONFLICT_ERROR && newdirectory.exists() )
throw new ApplicationException("new directory ["+newdirectory.toString()+"] already exist");
securityManager.checkFileLocation(pc.getConfig(),newdirectory,serverPassword);
try {
// has already a filter
if(filter!=null) {
if(recurse) filter=new OrResourceFilter(new ResourceFilter[]{
filter,DirectoryResourceFilter.FILTER
});
}
else {
if(!recurse)filter=new NotResourceFilter(DirectoryResourceFilter.FILTER);
}
if(!createPath) {
Resource p = newdirectory.getParentResource();
if(p!=null && !p.exists())
throw new ApplicationException("parent directory for ["+newdirectory+"] doesn't exist");
}
ResourceUtil.copyRecursive(directory, newdirectory,filter);
}
catch(Throwable t) {