<commit_before>package com.github.dreamhead.moco.mount;

import com.github.dreamhead.moco.HttpRequest;
import com.github.dreamhead.moco.HttpRequestExtractor;
import com.github.dreamhead.moco.RequestExtractor;
import com.github.dreamhead.moco.extractor.UriRequestExtractor;

import java.util.Optional;

public final class MountPathExtractor extends HttpRequestExtractor<String> {
    private final MountTo target;
    private final RequestExtractor<String> extractor = new UriRequestExtractor();

    public MountPathExtractor(final MountTo target) {
        this.target = target;
    }

    @Override
    protected Optional<String> doExtract(final HttpRequest request) {
        Optional<String> extractedUri = extractor.extract(request);
        if (!extractedUri.isPresent()) {
            return Optional.empty();
        }

        return target.extract(extractedUri.get());<commit_msg>applied optional to moutn path extractor<commit_after>package com.github.dreamhead.moco.mount;

import com.github.dreamhead.moco.HttpRequest;
import com.github.dreamhead.moco.HttpRequestExtractor;
import com.github.dreamhead.moco.RequestExtractor;
import com.github.dreamhead.moco.extractor.UriRequestExtractor;

import java.util.Optional;

public final class MountPathExtractor extends HttpRequestExtractor<String> {
    private final MountTo target;
    private final RequestExtractor<String> extractor = new UriRequestExtractor();

    public MountPathExtractor(final MountTo target) {
        this.target = target;
    }

    @Override
    protected Optional<String> doExtract(final HttpRequest request) {
        Optional<String> extractedUri = extractor.extract(request);
        return extractedUri.flatMap(target::extract);
{'fraction_non_alphanumeric': 0.08657757117954677, 'fraction_numerical': 0.0, 'mean_word_length': 4.6644736842105265, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4498209', 'n_tokens_mistral': 485, 'n_tokens_neox': 468, 'n_words': 98}