Does anyone know a 2-3 line solution for iterating over classes in some kind of Jar file?
(I have a java.net.URL instance in my hand)
thank
Access Mailboxes and Banks Using Java Part 1
Access Mailboxes and Banks Using Java Part 2
Here is the code snippet from the first article:
ZipFile zip = new ZipFile(fileName); // Process the zip file. Close it when the block is exited. try { // Loop through the zip entries and print the name of each one. for (Enumeration list = zip.entries(); list.hasMoreElements(); ) { ZipEntry entry = (ZipEntry) list.nextElement(); System.out.println(entry.getName()); } } finally { zip.close(); }
jar -tf xyz.jar | grep class
Here is the solution . You can create an input stream from a URL instead of a file that uses code.
Source: https://habr.com/ru/post/1735218/More articles:How to rewrite Webconfig connection string at runtime - vb.netRewriting characters in the command window - c #How to set default form in vb.Net? - vb.netHow can I use NUnit with an ASP.NET website (not a web project)? - asp.netProblem using \ LaTeX \ includegraphics with some PDF files - includeWhen do you define an index in decreasing order? - indexingFind path between nodes with SQL - sqlWhat is Object Eclipsing? - oopARM print register register value in decimal value - decimalPlacing exceptions in their own subpackage? - javaAll Articles