Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 164
  • Last Modified:

Searching for classes with incomplete name

Hi !
I'm looking for a method to find a particular class without know it full name..
For example :
The real name is com.mycompany.myapp.mymodule.myclass.class
I have only mymodule and myclass.
I have already done an kind of search engine but using classpath and searching also into jar files recursively...
It is very slow... so I'm looking for a more efficient method, scalable and full java...
An Idea ?
0
newbeewan
Asked:
newbeewan
  • 2
1 Solution
 
girionisCommented:
> so I'm looking for a more efficient method, scalable and full java...

  I am afraid there isn't any more efficient method. You would still have to check all files in the classpath since you do not have the top level name availabe but only the last two. So in any case you still have to check every single path till you fidn a folder that matches the "mymodule".
0
 
girionisCommented:
 .. on second thought you might want to store all classpath into memory (or into a file) and check it every time. Then find the location to the class you want and load it straight away.
0
 
CleanupPingCommented:
newbeewan:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
jimmackCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept girionis' comment as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jimmack
EE Cleanup Volunteer
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now