jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/org/jvnet/mimepull/FactoryFinder.java
changeset 33547 e4c76ac38b12
parent 25871 b80b84e87032
equal deleted inserted replaced
33390:d131f4b8433a 33547:e4c76ac38b12
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    27 
    27 
    28 import java.io.BufferedReader;
    28 import java.io.BufferedReader;
    29 import java.io.IOException;
    29 import java.io.IOException;
    30 import java.io.InputStream;
    30 import java.io.InputStream;
    31 import java.io.InputStreamReader;
    31 import java.io.InputStreamReader;
       
    32 import java.nio.charset.StandardCharsets;
    32 import java.util.logging.Level;
    33 import java.util.logging.Level;
    33 import java.util.logging.Logger;
    34 import java.util.logging.Logger;
    34 
    35 
    35 class FactoryFinder {
    36 class FactoryFinder {
    36 
    37 
    68         }
    69         }
    69 
    70 
    70         String factoryClassName;
    71         String factoryClassName;
    71         BufferedReader rd = null;
    72         BufferedReader rd = null;
    72         try {
    73         try {
    73             try {
    74             rd = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8));
    74                 rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
       
    75             } catch (java.io.UnsupportedEncodingException e) {
       
    76                 rd = new BufferedReader(new InputStreamReader(is));
       
    77             }
       
    78             try {
    75             try {
    79                 factoryClassName = rd.readLine();
    76                 factoryClassName = rd.readLine();
    80             } catch (IOException x) {
    77             } catch (IOException x) {
    81                 return null;
    78                 return null;
    82             }
    79             }