public static JavaFileObject toJavaFileObject(JavaFileManager fileManager,File sourceFile) throws IOException {
  List<JavaFileObject> javaFileObjects=toJavaFileObjects(fileManager,asList(sourceFile));
  return javaFileObjects.isEmpty() ? null : javaFileObjects.get(0);
}

public static JavaFileObject toJavaFileObject ( JavaFileManager fileManager , File sourceFile ) throws IOException { List < JavaFileObject > javaFileObjects = toJavaFileObjects ( fileManager , asList ( sourceFile ) ) ; return javaFileObjects . isEmpty ( ) ? null : javaFileObjects . get ( 0 ) ; }
transforms a source file to a java file object ( used by javac ) .
