I don't think this condition is OK. I would see CStype folder, with childCategory file. javaFile is of type file.
I'd use: parentNode == null