@SuppressWarnings("unchecked") private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); this.credentialsCharset = CharsetUtils.get(in.readUTF()); if (this.credentialsCharset == null) { this.credentialsCharset = Consts.ASCII; } this.challengeState = (ChallengeState) in.readObject(); }
/** * @deprecated (4.3) use * {@link SessionInputBufferImpl#SessionInputBufferImpl(int, int, CharsetDecoder, * ByteBufferAllocator)} */ @Deprecated public SessionInputBufferImpl( final int buffersize, final int lineBuffersize, final ByteBufferAllocator allocator, final HttpParams params) { super(buffersize, allocator); this.lineBuffersize = Args.positive(lineBuffersize, "Line buffer size"); final String charsetName = (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET); final Charset charset = CharsetUtils.lookup(charsetName); if (charset != null) { this.chardecoder = charset.newDecoder(); final CodingErrorAction a1 = (CodingErrorAction) params.getParameter( CoreProtocolPNames.HTTP_MALFORMED_INPUT_ACTION); this.chardecoder.onMalformedInput(a1 != null ? a1 : CodingErrorAction.REPORT); final CodingErrorAction a2 = (CodingErrorAction) params.getParameter( CoreProtocolPNames.HTTP_UNMAPPABLE_INPUT_ACTION); this.chardecoder.onUnmappableCharacter(a2 != null? a2 : CodingErrorAction.REPORT); } else { this.chardecoder = null; } this.constraints = MessageConstraints.DEFAULT; }
/** * @deprecated (4.3) use * {@link SessionOutputBufferImpl#SessionOutputBufferImpl(int, int, CharsetEncoder, * ByteBufferAllocator)} */ @Deprecated public SessionOutputBufferImpl( final int buffersize, final int lineBuffersize, final ByteBufferAllocator allocator, final HttpParams params) { super(buffersize, allocator); this.lineBuffersize = Args.positive(lineBuffersize, "Line buffer size"); final String charsetName = (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET); final Charset charset = CharsetUtils.lookup(charsetName); if (charset != null) { this.charencoder = charset.newEncoder(); final CodingErrorAction a1 = (CodingErrorAction) params.getParameter( CoreProtocolPNames.HTTP_MALFORMED_INPUT_ACTION); this.charencoder.onMalformedInput(a1 != null ? a1 : CodingErrorAction.REPORT); final CodingErrorAction a2 = (CodingErrorAction) params.getParameter( CoreProtocolPNames.HTTP_UNMAPPABLE_INPUT_ACTION); this.charencoder.onUnmappableCharacter(a2 != null? a2 : CodingErrorAction.REPORT); } else { this.charencoder = null; } }
@SuppressWarnings("unchecked") private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); this.credentialsCharset = CharsetUtils.get(in.readUTF()); if (this.credentialsCharset == null) { this.credentialsCharset = Consts.ASCII; } this.challengeState = (ChallengeState) in.readObject(); }
/** * @deprecated (4.3) use * {@link SessionOutputBufferImpl#SessionOutputBufferImpl(int, int, CharsetEncoder, * ByteBufferAllocator)} */ @Deprecated public SessionOutputBufferImpl( final int buffersize, final int lineBuffersize, final ByteBufferAllocator allocator, final HttpParams params) { super(buffersize, allocator); this.lineBuffersize = Args.positive(lineBuffersize, "Line buffer size"); final String charsetName = (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET); final Charset charset = CharsetUtils.lookup(charsetName); if (charset != null) { this.charencoder = charset.newEncoder(); final CodingErrorAction a1 = (CodingErrorAction) params.getParameter( CoreProtocolPNames.HTTP_MALFORMED_INPUT_ACTION); this.charencoder.onMalformedInput(a1 != null ? a1 : CodingErrorAction.REPORT); final CodingErrorAction a2 = (CodingErrorAction) params.getParameter( CoreProtocolPNames.HTTP_UNMAPPABLE_INPUT_ACTION); this.charencoder.onUnmappableCharacter(a2 != null? a2 : CodingErrorAction.REPORT); } else { this.charencoder = null; } }
@SuppressWarnings("unchecked") private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); this.credentialsCharset = CharsetUtils.get(in.readUTF()); if (this.credentialsCharset == null) { this.credentialsCharset = Consts.ASCII; } this.challengeState = (ChallengeState) in.readObject(); }
/** * @deprecated (4.3) use * {@link SessionInputBufferImpl#SessionInputBufferImpl(int, int, CharsetDecoder, * ByteBufferAllocator)} */ @Deprecated public SessionInputBufferImpl( final int buffersize, final int lineBuffersize, final ByteBufferAllocator allocator, final HttpParams params) { super(buffersize, allocator); this.lineBuffersize = Args.positive(lineBuffersize, "Line buffer size"); final String charsetName = (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET); final Charset charset = CharsetUtils.lookup(charsetName); if (charset != null) { this.chardecoder = charset.newDecoder(); final CodingErrorAction a1 = (CodingErrorAction) params.getParameter( CoreProtocolPNames.HTTP_MALFORMED_INPUT_ACTION); this.chardecoder.onMalformedInput(a1 != null ? a1 : CodingErrorAction.REPORT); final CodingErrorAction a2 = (CodingErrorAction) params.getParameter( CoreProtocolPNames.HTTP_UNMAPPABLE_INPUT_ACTION); this.chardecoder.onUnmappableCharacter(a2 != null? a2 : CodingErrorAction.REPORT); } else { this.chardecoder = null; } this.constraints = MessageConstraints.DEFAULT; }
@SuppressWarnings("unchecked") private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); this.credentialsCharset = CharsetUtils.get(in.readUTF()); if (this.credentialsCharset == null) { this.credentialsCharset = Consts.ASCII; } this.challengeState = (ChallengeState) in.readObject(); }
Charset charset = CharsetUtils.lookup( (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET)); if (charset != null) {
@SuppressWarnings("unchecked") private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); this.credentialsCharset = CharsetUtils.get(in.readUTF()); if (this.credentialsCharset == null) { this.credentialsCharset = Consts.ASCII; } this.challengeState = (ChallengeState) in.readObject(); }
Charset charset = CharsetUtils.lookup( (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET)); if (charset != null) {
entityBuilder.addPart("file", contentBody); entityBuilder.setCharset(CharsetUtils.get(urlEncoding)); httpPost.setEntity(entityBuilder.build()); request = httpPost;