Here you can find the source of toFile(Class> cls)
public static File toFile(Class<?> cls)
//package com.java2s; //License from project: MIT License import java.io.File; public class Main { public static File toFile(Class<?> cls) { return new File(cls.getName().replace('.', '/') + ".class"); }/*w w w . jav a2s . co m*/ }