@Override
    public Object convertRequest(ServiceRequestContext ctx, AggregatedHttpMessage request,
                                 Class<?> expectedResultType) throws Exception {
        final String path = getPath(ctx);
        final Optional<Iterable<String>> jsonPaths = getJsonPaths(ctx);
        if (jsonPaths.isPresent()) {
            return Optional.of(Query.ofJsonPath(path, jsonPaths.get()));
        }

        if (isValidFilePath(path)) {
            return Optional.of(Query.of(QueryType.IDENTITY, path));
        }
        return Optional.empty();
    }
@ Override public Object convertRequest ( ServiceRequestContext ctx , AggregatedHttpMessage request , Class < ? > expectedResultType ) throws Exception { final String path = getPath ( ctx ) ; final Optional < Iterable < String > > jsonPaths = getJsonPaths ( ctx ) ; if ( jsonPaths . isPresent ( ) ) { return Optional . of ( Query . ofJsonPath ( path , jsonPaths . get ( ) ) ) ; } if ( isValidFilePath ( path ) ) { return Optional . of ( Query . of ( QueryType . IDENTITY , path ) ) ; } return Optional . empty ( ) ; }
Converts the specified {@code request} to {@link Optional} which contains {@link Query} when
the request has a valid file path. {@link Optional#EMPTY} otherwise.