File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Finding a file in classpath

 
Nehal Dave
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I need to know how can we validate an import statement.
For e.g
import com.javaranch.ABC;
I need to find out if com.javaranch.ABC class is present in my classpath.
Any ideas?
Thanks
Nehal.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could try
Class.forName("com.javaranch.ABC")
or
ClassLoader.getSystemResource("com/javaranch/ABC")
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic