You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Diagnostics.java 24 kB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
9 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. *
  17. */
  18. package org.apache.tools.ant;
  19. import java.io.File;
  20. import java.io.IOException;
  21. import java.io.InputStream;
  22. import java.io.OutputStream;
  23. import java.io.PrintStream;
  24. import java.lang.reflect.InvocationTargetException;
  25. import java.lang.reflect.Method;
  26. import java.net.URL;
  27. import java.nio.file.Files;
  28. import java.util.Calendar;
  29. import java.util.Properties;
  30. import java.util.TimeZone;
  31. import javax.xml.parsers.SAXParser;
  32. import javax.xml.parsers.SAXParserFactory;
  33. import javax.xml.transform.Transformer;
  34. import javax.xml.transform.TransformerFactory;
  35. import org.apache.tools.ant.launch.Launcher;
  36. import org.apache.tools.ant.util.FileUtils;
  37. import org.apache.tools.ant.util.JAXPUtils;
  38. import org.apache.tools.ant.util.JavaEnvUtils;
  39. import org.apache.tools.ant.util.ProxySetup;
  40. import org.apache.tools.ant.util.java15.ProxyDiagnostics;
  41. import org.xml.sax.XMLReader;
  42. /**
  43. * A little diagnostic helper that output some information that may help
  44. * in support. It should quickly give correct information about the
  45. * jar existing in ant.home/lib and the jar versions...
  46. *
  47. * @since Ant 1.5
  48. */
  49. public final class Diagnostics {
  50. /**
  51. * value for which a difference between clock and temp file time triggers
  52. * a warning.
  53. * {@value}
  54. */
  55. private static final int BIG_DRIFT_LIMIT = 10000;
  56. /**
  57. * How big a test file to write.
  58. * {@value}
  59. */
  60. private static final int TEST_FILE_SIZE = 32;
  61. private static final int KILOBYTE = 1024;
  62. private static final int SECONDS_PER_MILLISECOND = 1000;
  63. private static final int SECONDS_PER_MINUTE = 60;
  64. private static final int MINUTES_PER_HOUR = 60;
  65. /**
  66. * The error text when a security manager blocks access to a property.
  67. * {@value}
  68. */
  69. protected static final String ERROR_PROPERTY_ACCESS_BLOCKED
  70. = "Access to this property blocked by a security manager";
  71. /** utility class */
  72. private Diagnostics() {
  73. // hidden constructor
  74. }
  75. /**
  76. * Doesn't do anything.
  77. * @deprecated Obsolete since Ant 1.8.2
  78. * @return <code>true</code>
  79. */
  80. @Deprecated
  81. public static boolean isOptionalAvailable() {
  82. return true;
  83. }
  84. /**
  85. * Doesn't do anything.
  86. * @deprecated Obsolete since Ant 1.8.2
  87. */
  88. @Deprecated
  89. public static void validateVersion() throws BuildException {
  90. }
  91. /**
  92. * return the list of jar files existing in ANT_HOME/lib
  93. * and that must have been picked up by Ant script.
  94. * @return the list of jar files existing in ant.home/lib or
  95. * <code>null</code> if an error occurs.
  96. */
  97. public static File[] listLibraries() {
  98. String home = System.getProperty(MagicNames.ANT_HOME);
  99. if (home == null) {
  100. return null;
  101. }
  102. return listJarFiles(new File(home, "lib"));
  103. }
  104. /**
  105. * get a list of all JAR files in a directory
  106. * @param libDir directory
  107. * @return array of files (or null for no such directory)
  108. */
  109. private static File[] listJarFiles(File libDir) {
  110. return libDir.listFiles((dir, name) -> name.endsWith(".jar"));
  111. }
  112. /**
  113. * main entry point for command line
  114. * @param args command line arguments.
  115. */
  116. public static void main(String[] args) {
  117. doReport(System.out);
  118. }
  119. /**
  120. * Helper method to get the implementation version.
  121. * @param clazz the class to get the information from.
  122. * @return null if there is no package or implementation version.
  123. * '?.?' for JDK 1.0 or 1.1.
  124. */
  125. private static String getImplementationVersion(Class<?> clazz) {
  126. return clazz.getPackage().getImplementationVersion();
  127. }
  128. /**
  129. * Helper method to get the location.
  130. * @param clazz the class to get the information from.
  131. * @since Ant 1.8.0
  132. */
  133. private static URL getClassLocation(Class<?> clazz) {
  134. if (clazz.getProtectionDomain().getCodeSource() == null) {
  135. return null;
  136. }
  137. return clazz.getProtectionDomain().getCodeSource().getLocation();
  138. }
  139. /**
  140. * what parser are we using.
  141. * @return the classname of the parser
  142. */
  143. private static String getXMLParserName() {
  144. SAXParser saxParser = getSAXParser();
  145. if (saxParser == null) {
  146. return "Could not create an XML Parser";
  147. }
  148. // check to what is in the classname
  149. return saxParser.getClass().getName();
  150. }
  151. /**
  152. * what parser are we using.
  153. * @return the classname of the parser
  154. */
  155. private static String getXSLTProcessorName() {
  156. Transformer transformer = getXSLTProcessor();
  157. if (transformer == null) {
  158. return "Could not create an XSLT Processor";
  159. }
  160. // check to what is in the classname
  161. return transformer.getClass().getName();
  162. }
  163. /**
  164. * Create a JAXP SAXParser
  165. * @return parser or null for trouble
  166. */
  167. private static SAXParser getSAXParser() {
  168. SAXParserFactory saxParserFactory = null;
  169. try {
  170. saxParserFactory = SAXParserFactory.newInstance();
  171. } catch (Exception e) {
  172. // ignore
  173. ignoreThrowable(e);
  174. return null;
  175. }
  176. SAXParser saxParser = null;
  177. try {
  178. saxParser = saxParserFactory.newSAXParser();
  179. } catch (Exception e) {
  180. // ignore
  181. ignoreThrowable(e);
  182. }
  183. return saxParser;
  184. }
  185. /**
  186. * Create a JAXP XSLT Transformer
  187. * @return parser or null for trouble
  188. */
  189. private static Transformer getXSLTProcessor() {
  190. TransformerFactory transformerFactory = TransformerFactory.newInstance();
  191. if (transformerFactory != null) {
  192. try {
  193. return transformerFactory.newTransformer();
  194. } catch (Exception e) {
  195. // ignore
  196. ignoreThrowable(e);
  197. }
  198. }
  199. return null;
  200. }
  201. /**
  202. * get the location of the parser
  203. * @return path or null for trouble in tracking it down
  204. */
  205. private static String getXMLParserLocation() {
  206. SAXParser saxParser = getSAXParser();
  207. if (saxParser == null) {
  208. return null;
  209. }
  210. URL location = getClassLocation(saxParser.getClass());
  211. return location != null ? location.toString() : null;
  212. }
  213. private static String getNamespaceParserName() {
  214. try {
  215. XMLReader reader = JAXPUtils.getNamespaceXMLReader();
  216. return reader.getClass().getName();
  217. } catch (BuildException e) {
  218. //ignore
  219. ignoreThrowable(e);
  220. return null;
  221. }
  222. }
  223. private static String getNamespaceParserLocation() {
  224. try {
  225. XMLReader reader = JAXPUtils.getNamespaceXMLReader();
  226. URL location = getClassLocation(reader.getClass());
  227. return location != null ? location.toString() : null;
  228. } catch (BuildException e) {
  229. //ignore
  230. ignoreThrowable(e);
  231. return null;
  232. }
  233. }
  234. /**
  235. * get the location of the parser
  236. * @return path or null for trouble in tracking it down
  237. */
  238. private static String getXSLTProcessorLocation() {
  239. Transformer transformer = getXSLTProcessor();
  240. if (transformer == null) {
  241. return null;
  242. }
  243. URL location = getClassLocation(transformer.getClass());
  244. return location != null ? location.toString() : null;
  245. }
  246. /**
  247. * ignore exceptions. This is to allow future
  248. * implementations to log at a verbose level
  249. * @param thrown a Throwable to ignore
  250. */
  251. private static void ignoreThrowable(Throwable thrown) {
  252. }
  253. /**
  254. * Print a report to the given stream.
  255. * @param out the stream to print the report to.
  256. */
  257. public static void doReport(PrintStream out) {
  258. doReport(out, Project.MSG_INFO);
  259. }
  260. /**
  261. * Print a report to the given stream.
  262. * @param out the stream to print the report to.
  263. * @param logLevel denotes the level of detail requested as one of
  264. * Project's MSG_* constants.
  265. */
  266. public static void doReport(PrintStream out, int logLevel) {
  267. out.println("------- Ant diagnostics report -------");
  268. out.println(Main.getAntVersion());
  269. header(out, "Implementation Version");
  270. out.println("core tasks : " + getImplementationVersion(Main.class)
  271. + " in " + getClassLocation(Main.class));
  272. header(out, "ANT PROPERTIES");
  273. doReportAntProperties(out);
  274. header(out, "ANT_HOME/lib jar listing");
  275. doReportAntHomeLibraries(out);
  276. header(out, "USER_HOME/.ant/lib jar listing");
  277. doReportUserHomeLibraries(out);
  278. header(out, "Tasks availability");
  279. doReportTasksAvailability(out);
  280. header(out, "org.apache.env.Which diagnostics");
  281. doReportWhich(out);
  282. header(out, "XML Parser information");
  283. doReportParserInfo(out);
  284. header(out, "XSLT Processor information");
  285. doReportXSLTProcessorInfo(out);
  286. header(out, "System properties");
  287. doReportSystemProperties(out);
  288. header(out, "Temp dir");
  289. doReportTempDir(out);
  290. header(out, "Locale information");
  291. doReportLocale(out);
  292. header(out, "Proxy information");
  293. doReportProxy(out);
  294. out.println();
  295. }
  296. private static void header(PrintStream out, String section) {
  297. out.println();
  298. out.println("-------------------------------------------");
  299. out.print(" ");
  300. out.println(section);
  301. out.println("-------------------------------------------");
  302. }
  303. /**
  304. * Report a listing of system properties existing in the current vm.
  305. * @param out the stream to print the properties to.
  306. */
  307. private static void doReportSystemProperties(PrintStream out) {
  308. Properties sysprops = null;
  309. try {
  310. sysprops = System.getProperties();
  311. } catch (SecurityException e) {
  312. ignoreThrowable(e);
  313. out.println("Access to System.getProperties() blocked " + "by a security manager");
  314. return;
  315. }
  316. sysprops.stringPropertyNames().stream()
  317. .map(key -> key + " : " + getProperty(key)).forEach(out::println);
  318. }
  319. /**
  320. * Get the value of a system property. If a security manager
  321. * blocks access to a property it fills the result in with an error
  322. * @param key a property key
  323. * @return the system property's value or error text
  324. * @see #ERROR_PROPERTY_ACCESS_BLOCKED
  325. */
  326. private static String getProperty(String key) {
  327. String value;
  328. try {
  329. value = System.getProperty(key);
  330. } catch (SecurityException e) {
  331. value = ERROR_PROPERTY_ACCESS_BLOCKED;
  332. }
  333. return value;
  334. }
  335. /**
  336. * Report the content of ANT_HOME/lib directory
  337. * @param out the stream to print the content to
  338. */
  339. private static void doReportAntProperties(PrintStream out) {
  340. Project p = new Project();
  341. p.initProperties();
  342. out.println(MagicNames.ANT_VERSION + ": " + p.getProperty(MagicNames.ANT_VERSION));
  343. out.println(MagicNames.ANT_JAVA_VERSION + ": "
  344. + p.getProperty(MagicNames.ANT_JAVA_VERSION));
  345. out.println("Is this the Apache Harmony VM? "
  346. + (JavaEnvUtils.isApacheHarmony() ? "yes" : "no"));
  347. out.println("Is this the Kaffe VM? "
  348. + (JavaEnvUtils.isKaffe() ? "yes" : "no"));
  349. out.println("Is this gij/gcj? "
  350. + (JavaEnvUtils.isGij() ? "yes" : "no"));
  351. out.println(MagicNames.ANT_LIB + ": " + p.getProperty(MagicNames.ANT_LIB));
  352. out.println(MagicNames.ANT_HOME + ": " + p.getProperty(MagicNames.ANT_HOME));
  353. }
  354. /**
  355. * Report the content of ANT_HOME/lib directory
  356. * @param out the stream to print the content to
  357. */
  358. private static void doReportAntHomeLibraries(PrintStream out) {
  359. out.println(MagicNames.ANT_HOME + ": " + System.getProperty(MagicNames.ANT_HOME));
  360. printLibraries(listLibraries(), out);
  361. }
  362. /**
  363. * Report the content of ~/.ant/lib directory
  364. *
  365. * @param out the stream to print the content to
  366. */
  367. private static void doReportUserHomeLibraries(PrintStream out) {
  368. String home = System.getProperty(Launcher.USER_HOMEDIR);
  369. out.println("user.home: " + home);
  370. File libDir = new File(home, Launcher.USER_LIBDIR);
  371. printLibraries(listJarFiles(libDir), out);
  372. }
  373. /**
  374. * list the libraries
  375. * @param libs array of libraries (can be null)
  376. * @param out output stream
  377. */
  378. private static void printLibraries(File[] libs, PrintStream out) {
  379. if (libs == null) {
  380. out.println("No such directory.");
  381. return;
  382. }
  383. for (File lib : libs) {
  384. out.println(lib.getName() + " (" + lib.length() + " bytes)");
  385. }
  386. }
  387. /**
  388. * Call org.apache.env.Which if available
  389. *
  390. * @param out the stream to print the content to.
  391. */
  392. private static void doReportWhich(PrintStream out) {
  393. Throwable error = null;
  394. try {
  395. Class<?> which = Class.forName("org.apache.env.Which");
  396. Method method = which.getMethod(
  397. "main", String[].class);
  398. method.invoke(null, new Object[]{new String[]{}});
  399. } catch (ClassNotFoundException e) {
  400. out.println("Not available.");
  401. out.println("Download it at http://xml.apache.org/commons/");
  402. } catch (InvocationTargetException e) {
  403. error = e.getTargetException() == null ? e : e.getTargetException();
  404. } catch (Throwable e) {
  405. error = e;
  406. }
  407. // report error if something weird happens...this is diagnostic.
  408. if (error != null) {
  409. out.println("Error while running org.apache.env.Which");
  410. error.printStackTrace(out); //NOSONAR
  411. }
  412. }
  413. /**
  414. * Create a report about non-available tasks that are defined in the
  415. * mapping but could not be found via lookup. It might generally happen
  416. * because Ant requires multiple libraries to compile and one of them
  417. * was missing when compiling Ant.
  418. * @param out the stream to print the tasks report to
  419. * <code>null</code> for a missing stream (ie mapping).
  420. */
  421. private static void doReportTasksAvailability(PrintStream out) {
  422. InputStream is = Main.class.getResourceAsStream(
  423. MagicNames.TASKDEF_PROPERTIES_RESOURCE);
  424. if (is == null) {
  425. out.println("None available");
  426. } else {
  427. Properties props = new Properties();
  428. try {
  429. props.load(is);
  430. for (String key : props.stringPropertyNames()) {
  431. String classname = props.getProperty(key);
  432. try {
  433. Class.forName(classname);
  434. props.remove(key);
  435. } catch (ClassNotFoundException e) {
  436. out.println(key + " : Not Available "
  437. + "(the implementation class is not present)");
  438. } catch (NoClassDefFoundError e) {
  439. String pkg = e.getMessage().replace('/', '.');
  440. out.println(key + " : Missing dependency " + pkg);
  441. } catch (LinkageError e) {
  442. out.println(key + " : Initialization error");
  443. }
  444. }
  445. if (props.size() == 0) {
  446. out.println("All defined tasks are available");
  447. } else {
  448. out.println("A task being missing/unavailable should only "
  449. + "matter if you are trying to use it");
  450. }
  451. } catch (IOException e) {
  452. out.println(e.getMessage());
  453. }
  454. }
  455. }
  456. /**
  457. * tell the user about the XML parser
  458. * @param out a PrintStream
  459. */
  460. private static void doReportParserInfo(PrintStream out) {
  461. String parserName = getXMLParserName();
  462. String parserLocation = getXMLParserLocation();
  463. printParserInfo(out, "XML Parser", parserName, parserLocation);
  464. printParserInfo(out, "Namespace-aware parser", getNamespaceParserName(),
  465. getNamespaceParserLocation());
  466. }
  467. /**
  468. * tell the user about the XSLT processor
  469. * @param out a PrintStream
  470. */
  471. private static void doReportXSLTProcessorInfo(PrintStream out) {
  472. String processorName = getXSLTProcessorName();
  473. String processorLocation = getXSLTProcessorLocation();
  474. printParserInfo(out, "XSLT Processor", processorName, processorLocation);
  475. }
  476. private static void printParserInfo(PrintStream out, String parserType, String parserName,
  477. String parserLocation) {
  478. if (parserName == null) {
  479. parserName = "unknown";
  480. }
  481. if (parserLocation == null) {
  482. parserLocation = "unknown";
  483. }
  484. out.println(parserType + " : " + parserName);
  485. out.println(parserType + " Location: " + parserLocation);
  486. }
  487. /**
  488. * try and create a temp file in our temp dir; this
  489. * checks that it has space and access.
  490. * We also do some clock reporting.
  491. * @param out a PrintStream
  492. */
  493. private static void doReportTempDir(PrintStream out) {
  494. String tempdir = System.getProperty("java.io.tmpdir");
  495. if (tempdir == null) {
  496. out.println("Warning: java.io.tmpdir is undefined");
  497. return;
  498. }
  499. out.println("Temp dir is " + tempdir);
  500. File tempDirectory = new File(tempdir);
  501. if (!tempDirectory.exists()) {
  502. out.println("Warning, java.io.tmpdir directory does not exist: " + tempdir);
  503. return;
  504. }
  505. //create the file
  506. long now = System.currentTimeMillis();
  507. File tempFile = null;
  508. OutputStream fileout = null;
  509. InputStream filein = null;
  510. try {
  511. tempFile = File.createTempFile("diag", "txt", tempDirectory);
  512. //do some writing to it
  513. fileout = Files.newOutputStream(tempFile.toPath());
  514. byte[] buffer = new byte[KILOBYTE];
  515. for (int i = 0; i < TEST_FILE_SIZE; i++) {
  516. fileout.write(buffer);
  517. }
  518. fileout.close();
  519. fileout = null;
  520. // read to make sure the file has been written completely
  521. Thread.sleep(1000);
  522. filein = Files.newInputStream(tempFile.toPath());
  523. int total = 0;
  524. int read = 0;
  525. while ((read = filein.read(buffer, 0, KILOBYTE)) > 0) {
  526. total += read;
  527. }
  528. filein.close();
  529. filein = null;
  530. long filetime = tempFile.lastModified();
  531. long drift = filetime - now;
  532. tempFile.delete();
  533. out.print("Temp dir is writeable");
  534. if (total != TEST_FILE_SIZE * KILOBYTE) {
  535. out.println(", but seems to be full. Wrote "
  536. + (TEST_FILE_SIZE * KILOBYTE)
  537. + "but could only read " + total + " bytes.");
  538. } else {
  539. out.println();
  540. }
  541. out.println("Temp dir alignment with system clock is " + drift + " ms");
  542. if (Math.abs(drift) > BIG_DRIFT_LIMIT) {
  543. out.println("Warning: big clock drift -maybe a network filesystem");
  544. }
  545. } catch (IOException e) {
  546. ignoreThrowable(e);
  547. out.println("Failed to create a temporary file in the temp dir " + tempdir);
  548. out.println("File " + tempFile + " could not be created/written to");
  549. } catch (InterruptedException e) {
  550. ignoreThrowable(e);
  551. out.println("Failed to check whether tempdir is writable");
  552. } finally {
  553. FileUtils.close(fileout);
  554. FileUtils.close(filein);
  555. if (tempFile != null && tempFile.exists()) {
  556. tempFile.delete();
  557. }
  558. }
  559. }
  560. /**
  561. * Report locale information
  562. * @param out stream to print to
  563. */
  564. private static void doReportLocale(PrintStream out) {
  565. //calendar stuff.
  566. Calendar cal = Calendar.getInstance();
  567. TimeZone tz = cal.getTimeZone();
  568. out.println("Timezone "
  569. + tz.getDisplayName()
  570. + " offset="
  571. + tz.getOffset(cal.get(Calendar.ERA), cal.get(Calendar.YEAR), cal
  572. .get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), cal
  573. .get(Calendar.DAY_OF_WEEK), ((cal.get(Calendar.HOUR_OF_DAY)
  574. * MINUTES_PER_HOUR + cal.get(Calendar.MINUTE))
  575. * SECONDS_PER_MINUTE + cal.get(Calendar.SECOND))
  576. * SECONDS_PER_MILLISECOND + cal.get(Calendar.MILLISECOND)));
  577. }
  578. /**
  579. * print a property name="value" pair if the property is set;
  580. * print nothing if it is null
  581. * @param out stream to print on
  582. * @param key property name
  583. */
  584. private static void printProperty(PrintStream out, String key) {
  585. String value = getProperty(key);
  586. if (value != null) {
  587. out.print(key);
  588. out.print(" = ");
  589. out.print('"');
  590. out.print(value);
  591. out.println('"');
  592. }
  593. }
  594. /**
  595. * Report proxy information
  596. *
  597. * @param out stream to print to
  598. * @since Ant1.7
  599. */
  600. private static void doReportProxy(PrintStream out) {
  601. printProperty(out, ProxySetup.HTTP_PROXY_HOST);
  602. printProperty(out, ProxySetup.HTTP_PROXY_PORT);
  603. printProperty(out, ProxySetup.HTTP_PROXY_USERNAME);
  604. printProperty(out, ProxySetup.HTTP_PROXY_PASSWORD);
  605. printProperty(out, ProxySetup.HTTP_NON_PROXY_HOSTS);
  606. printProperty(out, ProxySetup.HTTPS_PROXY_HOST);
  607. printProperty(out, ProxySetup.HTTPS_PROXY_PORT);
  608. printProperty(out, ProxySetup.HTTPS_NON_PROXY_HOSTS);
  609. printProperty(out, ProxySetup.FTP_PROXY_HOST);
  610. printProperty(out, ProxySetup.FTP_PROXY_PORT);
  611. printProperty(out, ProxySetup.FTP_NON_PROXY_HOSTS);
  612. printProperty(out, ProxySetup.SOCKS_PROXY_HOST);
  613. printProperty(out, ProxySetup.SOCKS_PROXY_PORT);
  614. printProperty(out, ProxySetup.SOCKS_PROXY_USERNAME);
  615. printProperty(out, ProxySetup.SOCKS_PROXY_PASSWORD);
  616. printProperty(out, ProxySetup.USE_SYSTEM_PROXIES);
  617. ProxyDiagnostics proxyDiag = new ProxyDiagnostics();
  618. out.println("Java1.5+ proxy settings:");
  619. out.println(proxyDiag.toString());
  620. }
  621. }