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