Source:
<code>public Folder createFolder(String folderUri, User user) throws IOException, DotDataException { Folder folder = null; folderUri = stripMapping(folderUri); PermissionAPI perAPI = APILocator.getPermissionAPI(); Logger.debug(this.getClass(), "createFolder"); String hostName = getHostname(folderUri); String path = getPath(folderUri); Host host; try { host = hostAPI.findByName(hostName, user, false); } catch (DotDataException e) { Logger.error(DotWebdavHelper.class, e.getMessage(), e); throw new IOException(e.getMessage(),e); } catch (DotSecurityException e) { Logger.error(DotWebdavHelper.class, e.getMessage(), e); throw new IOException(e.getMessage(),e); } List<Permission> parentPermissions = new ArrayList<Permission>(); boolean hasPermission = false; boolean validName = true; String parentPath = getFolderName(path); if (UtilMethods.isSet(parentPath) && !parentPath.equals("/")) { Folder parentFolder; try { parentFolder = folderAPI.findFolderByPath(parentPath,host,user,false); hasPermission = perAPI.doesUserHavePermission(parentFolder, PERMISSION_CAN_ADD_CHILDREN, user, false); } catch (Exception e) { Logger.error(DotWebdavHelper.class,e.getMessage(),e); throw new IOException(e.getMessage(),e); } } else { try { hasPermission = perAPI.doesUserHavePermission(host, PERMISSION_CAN_ADD_CHILDREN, user, false); <START> } catch (DotDataException e) { <END> Logger.error(DotWebdavHelper.class,e.getMessage(),e); throw new IOException(e.getMessage(),e); } } if ((hasPermission) && (validName)) { if (InodeUtils.isSet(host.getInode())) { path = deleteSpecialCharacter(path); try { folder = folderAPI.createFolders(path, host,user,false); } catch (Exception e) { throw new DotDataException(e.getMessage(), e); } } } return folder; }</code><technical_language>part of PR either, include folderUri in error message please</technical_language>

Target:
public Folder createFolder(String folderUri, User user) throws IOException, DotDataException { Folder folder = null; folderUri = stripMapping(folderUri); PermissionAPI perAPI = APILocator.getPermissionAPI(); Logger.debug(this.getClass(), "createFolder"); String hostName = getHostname(folderUri); String path = getPath(folderUri); Host host; try { host = hostAPI.findByName(hostName, user, false); } catch (DotDataException e) { Logger.error(DotWebdavHelper.class, e.getMessage(), e); throw new IOException(e.getMessage(),e); } catch (DotSecurityException e) { Logger.error(DotWebdavHelper.class, e.getMessage(), e); throw new IOException(e.getMessage(),e); } List<Permission> parentPermissions = new ArrayList<Permission>(); boolean hasPermission = false; boolean validName = true; String parentPath = getFolderName(path); if (UtilMethods.isSet(parentPath) && !parentPath.equals("/")) { Folder parentFolder; try { parentFolder = folderAPI.findFolderByPath(parentPath,host,user,false); hasPermission = perAPI.doesUserHavePermission(parentFolder, PERMISSION_CAN_ADD_CHILDREN, user, false); } catch (Exception e) { Logger.error(DotWebdavHelper.class,"Error creating folder with URI: " + folderUri + ". Error: " + e.getMessage(),e); throw new IOException(e.getMessage(),e); } } else { try { hasPermission = perAPI.doesUserHavePermission(host, PERMISSION_CAN_ADD_CHILDREN, user, false); } catch (DotDataException e) { Logger.error(DotWebdavHelper.class,e.getMessage(),e); throw new IOException(e.getMessage(),e); } } if ((hasPermission) && (validName)) { if (InodeUtils.isSet(host.getInode())) { path = deleteSpecialCharacter(path); try { folder = folderAPI.createFolders(path, host,user,false); } catch (Exception e) { throw new DotDataException(e.getMessage(), e); } } } return folder; }