< prev index next >

src/java.base/share/classes/com/sun/net/ssl/TrustManagerFactory.java

Print this page
rev 51919 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: dfuchs, alanb


 138 
 139     /**
 140      * Generates a <code>TrustManagerFactory</code> object for the specified
 141      * trust management algorithm from the specified provider.
 142      *
 143      * @param algorithm the standard name of the requested trust management
 144      * algorithm.
 145      * @param provider the name of the provider
 146      *
 147      * @return the new <code>TrustManagerFactory</code> object
 148      *
 149      * @exception NoSuchAlgorithmException if the specified algorithm is not
 150      * available from the specified provider.
 151      * @exception NoSuchProviderException if the specified provider has not
 152      * been configured.
 153      */
 154     public static final TrustManagerFactory getInstance(String algorithm,
 155                                                  String provider)
 156         throws NoSuchAlgorithmException, NoSuchProviderException
 157     {
 158         if (provider == null || provider.length() == 0)
 159             throw new IllegalArgumentException("missing provider");
 160         Object[] objs = SSLSecurity.getImpl(algorithm, "TrustManagerFactory",
 161                                             provider);
 162         return new TrustManagerFactory((TrustManagerFactorySpi)objs[0],
 163             (Provider)objs[1], algorithm);
 164     }
 165 
 166     /**
 167      * Generates a <code>TrustManagerFactory</code> object for the specified
 168      * trust management algorithm from the specified provider.
 169      *
 170      * @param algorithm the standard name of the requested trust management
 171      * algorithm.
 172      * @param provider an instance of the provider
 173      *
 174      * @return the new <code>TrustManagerFactory</code> object
 175      *
 176      * @exception NoSuchAlgorithmException if the specified algorithm is not
 177      * available from the specified provider.
 178      */




 138 
 139     /**
 140      * Generates a <code>TrustManagerFactory</code> object for the specified
 141      * trust management algorithm from the specified provider.
 142      *
 143      * @param algorithm the standard name of the requested trust management
 144      * algorithm.
 145      * @param provider the name of the provider
 146      *
 147      * @return the new <code>TrustManagerFactory</code> object
 148      *
 149      * @exception NoSuchAlgorithmException if the specified algorithm is not
 150      * available from the specified provider.
 151      * @exception NoSuchProviderException if the specified provider has not
 152      * been configured.
 153      */
 154     public static final TrustManagerFactory getInstance(String algorithm,
 155                                                  String provider)
 156         throws NoSuchAlgorithmException, NoSuchProviderException
 157     {
 158         if (provider == null || provider.isEmpty())
 159             throw new IllegalArgumentException("missing provider");
 160         Object[] objs = SSLSecurity.getImpl(algorithm, "TrustManagerFactory",
 161                                             provider);
 162         return new TrustManagerFactory((TrustManagerFactorySpi)objs[0],
 163             (Provider)objs[1], algorithm);
 164     }
 165 
 166     /**
 167      * Generates a <code>TrustManagerFactory</code> object for the specified
 168      * trust management algorithm from the specified provider.
 169      *
 170      * @param algorithm the standard name of the requested trust management
 171      * algorithm.
 172      * @param provider an instance of the provider
 173      *
 174      * @return the new <code>TrustManagerFactory</code> object
 175      *
 176      * @exception NoSuchAlgorithmException if the specified algorithm is not
 177      * available from the specified provider.
 178      */


< prev index next >