code: public static String getNodeType(String nodeTypeHeader, String defaultNodeType, Set<String> allowedNodeTypes)
        throws NoSuchNodeTypeException
     {
        if (nodeTypeHeader == null)
        {
           return defaultNodeType;
        }
        if (allowedNodeTypes.contains(nodeTypeHeader))
        {
           return nodeTypeHeader;
        }
  
        throw new NoSuchNodeTypeException("Unsupported node type: " + nodeTypeHeader);
     }
docs: Returns parsed nodeType obtained from node-type header.
  This method is unified for files and folders.
  
  @param nodeTypeHeader
  @param defaultNodeType
  @param allowedNodeTypes
  @return
  @throws NoSuchNodeTypeException is thrown if node-type header contains not allowed node type