}
protected static List<File> findTargets(Configuration config, String dirOrFile) throws Exception {
dirOrFile = dirOrFile.replaceAll("\\\\", "/");
List<File> dest = new ArrayList<File>();
ClassMetaExtractor extractor = new ClassMetaExtractor(config);
if (dirOrFile.matches(".+\\.java$")) {
File file = new File(dirOrFile);
String encoding = UniversalDetectorUtil.getDetectedEncoding(file);
ClassMeta classMeta = extractor.extract(IOUtil.readAsString(new FileInputStream(file), encoding));
if (!classMeta.isAbstract) {
dest.add(file);
}
} else {
List<File> javaFiles = new ArrayList<File>();
FileSearcher fileSearcher = new CommonsIOFileSearcher();
javaFiles = fileSearcher.searchFilesRecursivelyByName(dirOrFile, RegExp.FileExtension.JavaFile);
for (File file : javaFiles) {
String encoding = UniversalDetectorUtil.getDetectedEncoding(file);
ClassMeta classMeta = extractor.extract(IOUtil.readAsString(
new FileInputStream(file), encoding));
if (!classMeta.name.matches(".*Test$") && !classMeta.isAbstract) {
dest.add(file);
}
}