public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } if (value.trim().length() == 0) { throw new MalformedCookieException("Blank value for version attribute"); } try { cookie.setVersion(Integer.parseInt(value)); } catch (NumberFormatException e) { throw new MalformedCookieException("Invalid version: " + e.getMessage()); } }
/** * Parse cookie version attribute. */ public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (value == null) { throw new MalformedCookieException( "Missing value for version attribute"); } int version = -1; try { version = Integer.parseInt(value); } catch (NumberFormatException e) { version = -1; } if (version < 0) { throw new MalformedCookieException("Invalid cookie version."); } cookie.setVersion(version); }
/** * Parse cookie version attribute. */ @Override public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } int version = 0; try { version = Integer.parseInt(value); } catch (final NumberFormatException e) { // ignore invalid versions } cookie.setVersion(version); }
/** * Parse cookie version attribute. */ @Override public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } int version = 0; try { version = Integer.parseInt(value); } catch (final NumberFormatException e) { // ignore invalid versions } cookie.setVersion(version); }
public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } if (value.trim().length() == 0) { throw new MalformedCookieException("Blank value for version attribute"); } try { cookie.setVersion(Integer.parseInt(value)); } catch (NumberFormatException e) { throw new MalformedCookieException("Invalid version: " + e.getMessage()); } }
public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } if (value.trim().length() == 0) { throw new MalformedCookieException("Blank value for version attribute"); } try { cookie.setVersion(Integer.parseInt(value)); } catch (NumberFormatException e) { throw new MalformedCookieException("Invalid version: " + e.getMessage()); } }
/** * Parse cookie version attribute. */ public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } int version = 0; try { version = Integer.parseInt(value); } catch (final NumberFormatException e) { // Just ignore invalid versions } cookie.setVersion(version); }
public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } if (value.trim().length() == 0) { throw new MalformedCookieException("Blank value for version attribute"); } try { cookie.setVersion(Integer.parseInt(value)); } catch (NumberFormatException e) { throw new MalformedCookieException("Invalid version: " + e.getMessage()); } }
/** * Parse cookie version attribute. */ public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } int version = 0; try { version = Integer.parseInt(value); } catch (final NumberFormatException e) { // Just ignore invalid versions } cookie.setVersion(version); }
/** * Parse cookie version attribute. */ @Override public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } int version = 0; try { version = Integer.parseInt(value); } catch (final NumberFormatException e) { // Just ignore invalid versions } cookie.setVersion(version); }
public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } if (value.trim().length() == 0) { throw new MalformedCookieException("Blank value for version attribute"); } try { cookie.setVersion(Integer.parseInt(value)); } catch (NumberFormatException e) { throw new MalformedCookieException("Invalid version: " + e.getMessage()); } }
/** * Parse cookie version attribute. */ @Override public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } int version = 0; try { version = Integer.parseInt(value); } catch (final NumberFormatException e) { // Just ignore invalid versions } cookie.setVersion(version); }
/** * Parse cookie version attribute. */ @Override public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } int version = 0; try { version = Integer.parseInt(value); } catch (final NumberFormatException e) { // Just ignore invalid versions } cookie.setVersion(version); }
public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } if (value.trim().length() == 0) { throw new MalformedCookieException("Blank value for version attribute"); } try { cookie.setVersion(Integer.parseInt(value)); } catch (final NumberFormatException e) { throw new MalformedCookieException("Invalid version: " + e.getMessage()); } }
@Override public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } if (value.trim().isEmpty()) { throw new MalformedCookieException("Blank value for version attribute"); } try { cookie.setVersion(Integer.parseInt(value)); } catch (final NumberFormatException e) { throw new MalformedCookieException("Invalid version: " + e.getMessage()); } }
@Override public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } if (value.trim().isEmpty()) { throw new MalformedCookieException("Blank value for version attribute"); } try { cookie.setVersion(Integer.parseInt(value)); } catch (final NumberFormatException e) { throw new MalformedCookieException("Invalid version: " + e.getMessage()); } }
@Override public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } if (value.trim().isEmpty()) { throw new MalformedCookieException("Blank value for version attribute"); } try { cookie.setVersion(Integer.parseInt(value)); } catch (final NumberFormatException e) { throw new MalformedCookieException("Invalid version: " + e.getMessage()); } }
public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } if (value.trim().length() == 0) { throw new MalformedCookieException("Blank value for version attribute"); } try { cookie.setVersion(Integer.parseInt(value)); } catch (final NumberFormatException e) { throw new MalformedCookieException("Invalid version: " + e.getMessage()); } }
@Override public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } if (value.trim().isEmpty()) { throw new MalformedCookieException("Blank value for version attribute"); } try { cookie.setVersion(Integer.parseInt(value)); } catch (final NumberFormatException e) { throw new MalformedCookieException("Invalid version: " + e.getMessage()); } }
@Override public void parse(final SetCookie cookie, final String value) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (value == null) { throw new MalformedCookieException("Missing value for version attribute"); } if (value.trim().isEmpty()) { throw new MalformedCookieException("Blank value for version attribute"); } try { cookie.setVersion(Integer.parseInt(value)); } catch (final NumberFormatException e) { throw new MalformedCookieException("Invalid version: " + e.getMessage()); } }