Package java.io

Examples of java.io.UnsupportedEncodingException


            && !validateEncoding( encoding ) )
        {
            StringBuffer msg = new StringBuffer();
            msg.append( "The encoding '" + encoding + "' is not a valid one. The supported charsets are: " );
            msg.append( StringUtils.join( CharsetDetector.getAllDetectableCharsets(), ", " ) );
            throw new UnsupportedEncodingException( msg.toString() );
        }
        this.encoding = ( StringUtils.isNotEmpty( encoding ) ? encoding : AUTO_ENCODING );
    }
View Full Code Here


    StringBuilder sb = new StringBuilder(numChars > 500 ? numChars / 2 : numChars);
    int i = 0;

    if (enc.length() == 0)
    {
      throw new RuntimeException(new UnsupportedEncodingException(
        "URLDecoder: empty string enc parameter"));
    }

    char c;
    byte[] bytes = null;
View Full Code Here

   {
      EncodingMap encodingMap = new EncodingMapImpl();
      String ianaEncoding = encodingMap.convertJava2IANA(System.getProperty("file.encoding"));
      if (ianaEncoding == null)
      {
         throw new UnsupportedEncodingException("Can't find corresponding type of encoding for : "
            + System.getProperty("file.encoding"));
      }
      return encodingMap.convertJava2IANA(ianaEncoding);
   }
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

        } else if (escapeSequences.equals("%/E")) {
            // UCS-2 level 3
            return "UTF-16BE";
        } else {
            // Unknown
            throw new UnsupportedEncodingException(escapeSequences);
        }
    }
View Full Code Here

        {
            return new OutputStreamWriter(output, encoding);
        }
        catch (java.lang.IllegalArgumentException iae) // java 1.1.8
        {
            throw new UnsupportedEncodingException(encoding);
        }
    }
View Full Code Here

        throws IOException {
        try {
            encoder = Charset.forName(charset).newEncoder();
            encoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
        } catch (UnsupportedCharsetException e) {
            throw new UnsupportedEncodingException(charset);
        }
    }
View Full Code Here

        this.id = id;
        this.resource = resource;
        arguments = new FilteredArguments();
        if (!Charset.isSupported(encoding))
        {
            throw new UnsupportedEncodingException("The encoding \"" + encoding + "\" is not supported.");
        }
        this.encoding = encoding;
    }
View Full Code Here

        this.id = id;
        this.resource = resource;
        this.arguments = new FilteredArguments(arguments);
        if (!Charset.isSupported(encoding))
        {
            throw new UnsupportedEncodingException("The encoding \"" + encoding + "\" is not supported.");
        }
        this.encoding = encoding;
    }
View Full Code Here

   {
      List<LinkInfo> info = new ArrayList<LinkInfo>();
      if( name.endsWith(".properties") )
         parseLinkProperties(is, info, props);
      else
         throw new UnsupportedEncodingException("Unknown link format: "+name);
      return info;
   }
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.