Package java.io

Examples of java.io.UnsupportedEncodingException


            final FormDataParser parser = originalServlet.getFormParserFactory().createParser(exchange);
            if (parser != null) {
                parser.setCharacterEncoding(env);
            }
        } catch (UnsupportedCharsetException e) {
            throw new UnsupportedEncodingException();
        }
    }
View Full Code Here


                    String c = Headers.extractQuotedValueFromHeader(contentType, "charset");
                    if (c != null) {
                        try {
                            charSet = Charset.forName(c);
                        } catch (UnsupportedCharsetException e) {
                            throw new UnsupportedEncodingException();
                        }
                    }
                }
            }
View Full Code Here

    public void set_encoding_failure() throws Exception
    {
        HttpServletRequest sr = mockHttpServletRequest();

        String encoding = "the-encoding";
        UnsupportedEncodingException exception = new UnsupportedEncodingException("Oops.");

        sr.setCharacterEncoding(encoding);
        setThrowable(exception);

        replay();
View Full Code Here

            if (encoding.equals(BASE64_ENCODING_MARKER)) {
                Base64Decoder.decode(encodedData, out);
            } else if (encoding.equals(QUOTEDPRINTABLE_ENCODING_MARKER)) { // maybe quoted printable.
                QuotedPrintableDecoder.decode(encodedData, out);
            } else {
                throw new UnsupportedEncodingException("Unknown RFC 2047 encoding: " + encoding);
            }
            // get the decoded byte data and convert into a string.
            byte[] decodedData = out.toByteArray();
            return new String(decodedData, javaCharset(charset));
        } catch (IOException e) {
            throw new UnsupportedEncodingException("Invalid RFC 2047 encoding");
        }
    }
View Full Code Here

    public void set_encoding_failure() throws Exception
    {
        HttpServletRequest sr = mockHttpServletRequest();

        String encoding = "the-encoding";
        UnsupportedEncodingException exception = new UnsupportedEncodingException("Oops.");

        sr.setCharacterEncoding(encoding);
        setThrowable(exception);

        replay();
View Full Code Here

                if (cs == null) {
                    cs = HTTP.DEFAULT_CONTENT_CHARSET;
                }
                this.charset = Charset.forName(cs);
            } catch (UnsupportedCharsetException ex) {
                throw new UnsupportedEncodingException(this.contentType.getCharset());
            }
            this.chardecoder = this.charset.newDecoder();
            this.bbuf = ByteBuffer.allocate(this.bufSize);
            this.cbuf = CharBuffer.allocate(this.bufSize);
        }
View Full Code Here

        if (normalizedEncoding == null) {
            String m = new org.apache.cxf.common.i18n.Message("INVALID_ENCODING_MSG", LOG, new Object[] {
                enc
            }).toString();
            LOG.log(Level.WARNING, m);
            throw new UnsupportedEncodingException(m);
        }

        return normalizedEncoding;
    }
View Full Code Here

    {
      charset = Charset.forName(charsetName);
    }
    catch (IllegalCharsetNameException | UnsupportedCharsetException e)
    {
      throw new RuntimeException(new UnsupportedEncodingException(charsetName));
    }

    boolean stopEncoding = false;
    for (int i = 0; i < s.length();)
    {
View Full Code Here

        if (normalizedEncoding == null) {
            String m = new org.apache.cxf.common.i18n.Message("INVALID_ENCODING_MSG", LOG, new Object[] {
                enc
            }).toString();
            LOG.log(Level.WARNING, m);
            throw new UnsupportedEncodingException(m);
        }

        return normalizedEncoding;
    }
View Full Code Here

                final ContentType contentType = ContentType.get(entity);
                if (contentType != null) {
                    charset = contentType.getCharset();
                }
            } catch (final UnsupportedCharsetException ex) {
                throw new UnsupportedEncodingException(ex.getMessage());
            }
            if (charset == null) {
                charset = defaultCharset;
            }
            if (charset == null) {
View Full Code Here

TOP

Related Classes of java.io.UnsupportedEncodingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.