May I suggest to create this method:
```
private String canonicalize(String relPath, String childName) {
	String canonical;

	if (relPath != null && !relPath.equals("")) {
		relPath = relPath.replaceAll("\\\\", "/");
		canonical = relPath.endsWith("/") ? relPath + childName : relPath + "/" + childName;
	} else {
		canonical = childName;
	}
	return canonical;
}
```
and change lines 417-425 to ```childRelativePath = canonicalize(relPath, childName);```