mardi 21 juillet 2015

Is there any way to load all classes in a specific path without knowing their package names?

I'm writing a java app that do some operation on a text file. I'm going to add an ability in my app that can use the operation of users and operate them on file too. I forced them to implement my interface to hold their method names in my hand. And forced them to put their class files in a specific path to load them in my app but I don't have any idea to get their package names of user's classes to load them with method class.forName(packageName.ClassName).

Is there any way to load all classes in a specific path without knowing their package names??





Aucun commentaire:

Enregistrer un commentaire