src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleHandler.java
public static void installDownloadedModules(boolean dowarn) {
        File moduleDir = OdPlugin.getInstance().getModulesDirectory();
        if (!moduleDir.exists() || !moduleDir.isDirectory() || !moduleDir.canWrite())
            return;

        final File[] files = moduleDir.listFiles(new FilenameFilter() {
            @Override
            public boolean accept(File dir, String name) {
                return name.endsWith(".jar.new");
            } });

        for (File updatedModule : files) {
            final String filePath = updatedModule.getPath();
            File module = new File(filePath.substring(0, filePath.length() - 4));
            String moduleName = updatedModule.getName().substring(0, updatedModule.getName().length() - 8);
            // CHECKSTYLE.OFF: LineLength
            if (module.exists()) {
                if (!module.delete() && dowarn) {
                    Logging.warn(tr("Warning: failed to delete outdated module ''{0}''.", module.toString()));
                    Logging.warn(tr("Warning: failed to install already downloaded module ''{0}''. Skipping installation. JOSM is still going to load the old module version.", moduleName));
                    continue;
                }
            }
            if (!updatedModule.renameTo(module) && dowarn) {
                Logging.warn(tr("Warning: failed to install module ''{0}'' from temporary download file ''{1}''. Renaming failed.", module.toString(), updatedModule.toString()));
                Logging.warn(tr("Warning: failed to install already downloaded module ''{0}''. Skipping installation. JOSM is still going to load the old module version.", moduleName));
            }
            // CHECKSTYLE.ON: LineLength
        }
        return;
    }
/**
     * Installs downloaded modules. Moves files with the suffix ".jar.new" to the corresponding
     * ".jar" files.
     *
     * If {@code dowarn} is true, this methods emits warning messages on the console if a downloaded
     * but not yet installed module .jar can't be be installed. If {@code dowarn} is false, the
     * installation of the respective module is sillently skipped.
     *
     * @param dowarn if true, warning messages are displayed; false otherwise
     */
Installs downloaded modules. Moves files with the suffix ".jar.new" to the corresponding
".jar" files.

If  dowarn is true, this methods emits warning messages on the console if a downloaded
but not yet installed module .jar can't be be installed. If  dowarn is false, the
installation of the respective module is sillently skipped.

@param dowarn if true, warning messages are displayed; false otherwise
Installs downloaded modules . Moves files with the suffix " . jar . new " to the corresponding " . jar " files . If dowarn is true this methods emits warning messages on the console if a downloaded but not yet installed module . jar can ' t be be installed . If dowarn is false the installation of the respective module is sillently skipped . @param dowarn if true warning messages are displayed ; false otherwise
public static void installDownloadedModules(boolean dowarn) {
        File moduleDir = OdPlugin.getInstance().getModulesDirectory();
        if (!moduleDir.exists() || !moduleDir.isDirectory() || !moduleDir.canWrite())
            return;
        final File[] files = moduleDir.listFiles(new FilenameFilter() {
            @Override
            public boolean accept(File dir, String name) {
                return name.endsWith(".jar.new");
            } });
        for (File updatedModule : files) {
            final String filePath = updatedModule.getPath();
            File module = new File(filePath.substring(0, filePath.length() - 4));
            String moduleName = updatedModule.getName().substring(0, updatedModule.getName().length() - 8);
            if (module.exists()) {
                if (!module.delete() && dowarn) {
                    Logging.warn(tr("Warning: failed to delete outdated module ''{0}''.", module.toString()));
                    Logging.warn(tr("Warning: failed to install already downloaded module ''{0}''. Skipping installation. JOSM is still going to load the old module version.", moduleName));
                    continue;
                }
            }
            if (!updatedModule.renameTo(module) && dowarn) {
                Logging.warn(tr("Warning: failed to install module ''{0}'' from temporary download file ''{1}''. Renaming failed.", module.toString(), updatedModule.toString()));
                Logging.warn(tr("Warning: failed to install already downloaded module ''{0}''. Skipping installation. JOSM is still going to load the old module version.", moduleName));
            }
        }
        return;
    }
public static void installDownloadedModules ( boolean dowarn ) { File moduleDir = OdPlugin . getInstance ( ) . getModulesDirectory ( ) ; if ( ! moduleDir . exists ( ) || ! moduleDir . isDirectory ( ) || ! moduleDir . canWrite ( ) ) return ; final File [ ] files = moduleDir . listFiles ( new FilenameFilter ( ) { @ Override public boolean accept ( File dir , String name ) { return name . endsWith ( ".jar.new" ) ; } } ) ; for ( File updatedModule : files ) { final String filePath = updatedModule . getPath ( ) ; File module = new File ( filePath . substring ( 0 , filePath . length ( ) - 4 ) ) ; String moduleName = updatedModule . getName ( ) . substring ( 0 , updatedModule . getName ( ) . length ( ) - 8 ) ; if ( module . exists ( ) ) { if ( ! module . delete ( ) && dowarn ) { Logging . warn ( tr ( "Warning: failed to delete outdated module ''{0}''." , module . toString ( ) ) ) ; Logging . warn ( tr ( "Warning: failed to install already downloaded module ''{0}''. Skipping installation. JOSM is still going to load the old module version." , moduleName ) ) ; continue ; } } if ( ! updatedModule . renameTo ( module ) && dowarn ) { Logging . warn ( tr ( "Warning: failed to install module ''{0}'' from temporary download file ''{1}''. Renaming failed." , module . toString ( ) , updatedModule . toString ( ) ) ) ; Logging . warn ( tr ( "Warning: failed to install already downloaded module ''{0}''. Skipping installation. JOSM is still going to load the old module version." , moduleName ) ) ; } } return ; }
Installs downloaded modules.
Installs downloaded modules .
// CHECKSTYLE.OFF: LineLength
 // CHECKSTYLE.ON: LineLength
