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

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