class HtmlSchemaParser implements SchemaParser {

    @Override
    public Schema parse(Request request) {

        try {
            SimpleHeadersContentHandler headersContentHandler = new SimpleHeadersContentHandler();

            InputStream inputStream = request.getContent();
            HtmlParser htmlParser = new HtmlParser();

            Metadata metadata = new Metadata();

            htmlParser.parse(inputStream, headersContentHandler, metadata, new ParseContext());

            List<ColumnMetadata> columns = new ArrayList<>(headersContentHandler.getHeaderValues().size());

            for (String headerValue : headersContentHandler.getHeaderValues()) {
                columns.add(ColumnMetadata.Builder
                        .column() //
                        .type(Type.STRING) // ATM not doing any complicated type calculation
                        .name(headerValue) //
                        .id(columns.size()) //
                        .build());
            }

            Schema.SheetContent sheetContent = new Schema.SheetContent();
            sheetContent.setColumnMetadatas(columns);

            return Schema.Builder
                    .parserResult() //
                    .sheetContents(Collections.singletonList(sheetContent)) //
                    .draft(false) //
                    .build();

        } catch (Exception e) {
            LOGGER.debug("Exception during parsing html request :" + e.getMessage(), e);
            throw new TDPException(CommonErrorCodes.UNEXPECTED_EXCEPTION, e);
        }

    }

}