void writeOptions()

in src/main/java/org/apache/sling/settings/impl/SlingSettingsServiceImpl.java [272:296]


    void writeOptions(final BundleContext context, final List<Options> optionsList) {
        final File file = context.getDataFile(OPTIONS_FILE);
        FileOutputStream fos = null;
        ObjectOutputStream oos = null;
        try {
            fos = new FileOutputStream(file);
            oos = new ObjectOutputStream(fos);
            oos.writeObject(optionsList);
        } catch (final IOException ioe) {
            throw new RuntimeException("Unable to write to options data file.", ioe);
        } finally {
            if (oos != null) {
                try {
                    oos.close();
                } catch (final IOException ignore) {
                }
            }
            if (fos != null) {
                try {
                    fos.close();
                } catch (final IOException ignore) {
                }
            }
        }
    }