Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5152 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

The JAR file is just a ZIP file, so if you have, say, 7-zip installed, you can right click it an unzip it. Alternately, if the Java SDK is installed you can use the jar command to list the classes per Link

You can list the classes in Scriptmaster by reading the jar file and parsing it. Below example shows classes in javax.mail, assuming you have a copy in c:mail.jar

Most jars have a javadoc on the internet that lists all the classes.

import java.util.jar.*;

import java.util.*;

import java.io.*;

public static String getClasseNamesInPackage (String jarName, String packageName)

{

String classes = "";

packageName = packageName.replaceAll("." , "/");

try{

JarInputStream jarFile = new JarInputStream (new FileInputStream (jarName));

JarEntry jarEntry;

while(true) {

jarEntry=jarFile.getNextJarEntry ();

if(jarEntry == null){

break;

}

if((jarEntry.getName ().startsWith (packageName)) && (jarEntry.getName ().endsWith (".class")) ) {

classes = classes + (jarEntry.getName().replaceAll("/", ".")) + "n";

}

}

}

catch( Exception e){

return e ;

}

return classes;

}

String Class_list = getClasseNamesInPackage ("C:/mail.jar", "javax.mail");

return Class_list;

This topic is 5152 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.