@Override
    public FileObject getFileForOutput(JavaFileManager.Location location, String packageName,
            String relativeName, FileObject sibling) throws IOException {
        String name = null;
        if ("".equals(packageName)) {
            name = relativeName;
        } else {
            name = packageName.replace('.', '/') + "/" + relativeName;
        }
        LocationAndKind key = new LocationAndKind(location, Kind.OTHER);
        if (ramFileSystem.containsKey(key)) {
            JavaFileObject jfo = ramFileSystem.get(key).get(name);
            if (jfo != null) {
                return jfo;
            }
        }
        JavaFileObject jfo = new MemJavaFileObject(urlPrefix, name, Kind.OTHER);
        register(key, jfo);
        return jfo;
    }
MemFileManager is a memory based implementation of the JavaFileManager
interface

@author tiwe
querydsl-codegen-utils/src/main/java/com/querydsl/codegen/utils/MemFileManager.java