src/share/classes/sun/net/ftp/FtpClientProvider.java
Print this page
@@ -25,11 +25,11 @@
package sun.net.ftp;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ServiceConfigurationError;
-//import sun.misc.Service;
+//import java.util.ServiceLoader;
/**
* Service provider class for FtpClient.
* Sub-classes of FtpClientProvider provide an implementation of {@link FtpClient}
* and associated classes. Applications do not normally use this class directly.
@@ -77,24 +77,26 @@
throw new ServiceConfigurationError(x.toString());
}
}
private static boolean loadProviderAsService() {
- // Iterator i = Service.providers(FtpClientProvider.class,
- // ClassLoader.getSystemClassLoader());
- // while (i.hasNext()) {
- // try {
- // provider = (FtpClientProvider) i.next();
- // return true;
- // } catch (ServiceConfigurationError sce) {
- // if (sce.getCause() instanceof SecurityException) {
- // // Ignore, try next provider, if any
- // continue;
- // }
- // throw sce;
- // }
- // }
+// Iterator<FtpClientProvider> i =
+// ServiceLoader.load(FtpClientProvider.class,
+// ClassLoader.getSystemClassLoader()).iterator();
+//
+// while (i.hasNext()) {
+// try {
+// provider = i.next();
+// return true;
+// } catch (ServiceConfigurationError sce) {
+// if (sce.getCause() instanceof SecurityException) {
+// // Ignore, try next provider, if any
+// continue;
+// }
+// throw sce;
+// }
+// }
return false;
}
/**
* Returns the system wide default FtpClientProvider for this invocation of