class LegacyExtensionStorage extends ExtensionStorage {

    public static final String EXTENSIONS_RESOURCE = "META-INF/extensions.idx";

    public LegacyExtensionStorage(ExtensionAnnotationProcessor processor) {
        super(processor);
    }

    @Override
    public Map<String, Set<String>> read() {
        Map<String, Set<String>> extensions = new HashMap<>();

        try {
            FileObject file = getFiler().getResource(StandardLocation.CLASS_OUTPUT, "", EXTENSIONS_RESOURCE);
            // TODO try to calculate the extension point
            Set<String> entries = new HashSet<>();
            ExtensionStorage.read(file.openReader(true), entries);
            extensions.put(null, entries);
        } catch (FileNotFoundException | NoSuchFileException e) {
            // doesn't exist, ignore
        } catch (FilerException e) {
            // re-opening the file for reading or after writing is ignorable
        } catch (IOException e) {
            error(e.getMessage());
        }

        return extensions;
    }

    @Override
    public void write(Map<String, Set<String>> extensions) {<FILL_FUNCTION_BODY>}

}

        try {
            FileObject file = getFiler().createResource(StandardLocation.CLASS_OUTPUT, "", EXTENSIONS_RESOURCE);
            try (BufferedWriter writer = new BufferedWriter(file.openWriter())) {
                writer.write("# Generated by PF4J"); // write header
                writer.newLine();
                for (Map.Entry<String, Set<String>> entry : extensions.entrySet()) {
                    for (String extension : entry.getValue()) {
                        writer.write(extension);
                        writer.newLine();
                    }
                }
            }
        } catch (FileNotFoundException e) {
            // it's the first time, create the file
        } catch (FilerException e) {
            // re-opening the file for reading or after writing is ignorable
        } catch (IOException e) {
            error(e.toString());
        }
    
<methods>public void <init>(org.pf4j.processor.ExtensionAnnotationProcessor) ,public abstract Map<java.lang.String,Set<java.lang.String>> read() ,public static void read(java.io.Reader, Set<java.lang.String>) throws java.io.IOException,public abstract void write(Map<java.lang.String,Set<java.lang.String>>) <variables>private static final java.util.regex.Pattern COMMENT,private static final java.util.regex.Pattern WHITESPACE,protected final non-sealed org.pf4j.processor.ExtensionAnnotationProcessor processor