@Test public void testParseEntity () throws Exception { final StringEntity entity = new StringEntity("Name1=Value1", null); entity.setContentType(URLEncodedUtils.CONTENT_TYPE); final List <NameValuePair> result = URLEncodedUtils.parse(entity); Assert.assertEquals(1, result.size()); assertNameValuePair(result.get(0), "Name1", "Value1"); entity.setContentType("text/test"); Assert.assertTrue(URLEncodedUtils.parse(entity).isEmpty()); }
public static List <NameValuePair> parse (final URI uri, final String encoding) { List <NameValuePair> result = Collections.emptyList(); final String query = uri.getRawQuery(); if (query != null && query.length() > 0) { result = new ArrayList <NameValuePair>(); parse(result, new Scanner(query), encoding); } return result; }
URLEncodedUtils { public static List <NameValuePair> parse (final URI uri, final String encoding) { List <NameValuePair> result = Collections.emptyList(); final String query = uri.getRawQuery(); if (query != null && query.length() > 0) { result = new ArrayList <NameValuePair>(); parse(result, new Scanner(query), encoding); } return result; } }
URLEncodedUtils { public static List <NameValuePair> parse (final URI uri, final String encoding) { List <NameValuePair> result = Collections.emptyList(); final String query = uri.getRawQuery(); if (query != null && query.length() > 0) { result = new ArrayList <NameValuePair>(); parse(result, new Scanner(query), encoding); } return result; }  }
URLEncodedUtils { public static List <NameValuePair> parse (final URI uri, final String encoding) { List <NameValuePair> result = Collections.emptyList(); final String query = uri.getRawQuery(); if (query != null && query.length() > 0) { result = new ArrayList <NameValuePair>(); parse(result, new Scanner(query), encoding); } return result; }  static List <NameValuePair> parse(final URI uri, final String encoding); static List <NameValuePair> parse(
            final HttpEntity entity); static boolean isEncoded(final HttpEntity entity); static void parse(
            final List <NameValuePair> parameters,
            final Scanner scanner,
            final String encoding); static String format(
            final List <? extends NameValuePair> parameters,
            final String encoding); }
URLEncodedUtils { public static List <NameValuePair> parse (final URI uri, final String encoding) { List <NameValuePair> result = Collections.emptyList(); final String query = uri.getRawQuery(); if (query != null && query.length() > 0) { result = new ArrayList <NameValuePair>(); parse(result, new Scanner(query), encoding); } return result; }  static List <NameValuePair> parse(final URI uri, final String encoding); static List <NameValuePair> parse(
            final HttpEntity entity); static boolean isEncoded(final HttpEntity entity); static void parse(
            final List <NameValuePair> parameters,
            final Scanner scanner,
            final String encoding); static String format(
            final List <? extends NameValuePair> parameters,
            final String encoding); static final String CONTENT_TYPE; }