src/org/openstreetmap/josm/plugins/opendata/core/modules/ReadRemoteModuleInformationTask.java
protected void cacheModuleList(String site, String list) {
        try {
            File moduleDir = OdPlugin.getInstance().getModulesDirectory();
            if (!moduleDir.exists()) {
                if (!moduleDir.mkdirs()) {
                    Logging.warn(tr("Warning: failed to create module directory ''{0}''. Cannot cache module list from module site ''{1}''.",
                            moduleDir.toString(), site));
                }
            }
            File cacheFile = createSiteCacheFile(moduleDir, site, CacheType.PLUGIN_LIST);
            getProgressMonitor().subTask(tr("Writing module list to local cache ''{0}''", cacheFile.toString()));
            try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(cacheFile), "utf-8"))) {
                writer.write(list);
            }
        } catch (IOException e) {
            // just failed to write the cache file. No big deal, but log the exception anyway
            Logging.warn(e);
        }
    }
/**
     * Writes the list of modules to a cache file
     *
     * @param site the site from where the list was downloaded
     * @param list the downloaded list
     */
Writes the list of modules to a cache file

@param site the site from where the list was downloaded
@param list the downloaded list
Writes the list of modules to a cache file @param site the site from where the list was downloaded @param list the downloaded list
protected void cacheModuleList(String site, String list) {
        try {
            File moduleDir = OdPlugin.getInstance().getModulesDirectory();
            if (!moduleDir.exists()) {
                if (!moduleDir.mkdirs()) {
                    Logging.warn(tr("Warning: failed to create module directory ''{0}''. Cannot cache module list from module site ''{1}''.",
                            moduleDir.toString(), site));
                }
            }
            File cacheFile = createSiteCacheFile(moduleDir, site, CacheType.PLUGIN_LIST);
            getProgressMonitor().subTask(tr("Writing module list to local cache ''{0}''", cacheFile.toString()));
            try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(cacheFile), "utf-8"))) {
                writer.write(list);
            }
        } catch (IOException e) {
            Logging.warn(e);
        }
    }
protected void cacheModuleList ( String site , String list ) { try { File moduleDir = OdPlugin . getInstance ( ) . getModulesDirectory ( ) ; if ( ! moduleDir . exists ( ) ) { if ( ! moduleDir . mkdirs ( ) ) { Logging . warn ( tr ( "Warning: failed to create module directory ''{0}''. Cannot cache module list from module site ''{1}''." , moduleDir . toString ( ) , site ) ) ; } } File cacheFile = createSiteCacheFile ( moduleDir , site , CacheType . PLUGIN_LIST ) ; getProgressMonitor ( ) . subTask ( tr ( "Writing module list to local cache ''{0}''" , cacheFile . toString ( ) ) ) ; try ( PrintWriter writer = new PrintWriter ( new OutputStreamWriter ( new FileOutputStream ( cacheFile ) , "utf-8" ) ) ) { writer . write ( list ) ; } } catch ( IOException e ) { Logging . warn ( e ) ; } }
Writes the list of modules to a cache file
Writes the list of modules to a cache file
// just failed to write the cache file. No big deal, but log the exception anyway
