src/org/openstreetmap/josm/plugins/opendata/core/modules/ReadRemoteModuleInformationTask.java
protected File createSiteCacheFile(File moduleDir, String site, CacheType type) {
        String name;
        try {
            site = site.replaceAll("%<(.*)>", "");
            URL url = new URL(site);
            StringBuilder sb = new StringBuilder();
            sb.append("site-");
            sb.append(url.getHost()).append("-");
            if (url.getPort() != -1) {
                sb.append(url.getPort()).append("-");
            }
            String path = url.getPath();
            for (int i = 0; i < path.length()-4; i++) {
                char c = path.charAt(i);
                if (Character.isLetterOrDigit(c)) {
                    sb.append(c);
                } else {
                    sb.append("_");
                }
            }
            switch (type) {
            case PLUGIN_LIST:
                sb.append(".txt");
                break;
            case ICON_LIST:
                sb.append("-icons.zip");
                break;
            }
            name = sb.toString();
        } catch (MalformedURLException e) {
            name = "site-unknown.txt";
        }
        return new File(moduleDir, name);
    }
/**
     * Creates the file name for the cached module list and the icon cache
     * file.
     *
     * @param site the name of the site
     * @param type icon cache or module list cache
     * @return the file name for the cache file
     */
Creates the file name for the cached module list and the icon cache
file.

@param site the name of the site
@param type icon cache or module list cache
@return the file name for the cache file
Creates the file name for the cached module list and the icon cache file . @param site the name of the site @param type icon cache or module list cache @return the file name for the cache file
protected File createSiteCacheFile(File moduleDir, String site, CacheType type) {
        String name;
        try {
            site = site.replaceAll("%<(.*)>", "");
            URL url = new URL(site);
            StringBuilder sb = new StringBuilder();
            sb.append("site-");
            sb.append(url.getHost()).append("-");
            if (url.getPort() != -1) {
                sb.append(url.getPort()).append("-");
            }
            String path = url.getPath();
            for (int i = 0; i < path.length()-4; i++) {
                char c = path.charAt(i);
                if (Character.isLetterOrDigit(c)) {
                    sb.append(c);
                } else {
                    sb.append("_");
                }
            }
            switch (type) {
            case PLUGIN_LIST:
                sb.append(".txt");
                break;
            case ICON_LIST:
                sb.append("-icons.zip");
                break;
            }
            name = sb.toString();
        } catch (MalformedURLException e) {
            name = "site-unknown.txt";
        }
        return new File(moduleDir, name);
    }
protected File createSiteCacheFile ( File moduleDir , String site , CacheType type ) { String name ; try { site = site . replaceAll ( "%<(.*)>" , "" ) ; URL url = new URL ( site ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "site-" ) ; sb . append ( url . getHost ( ) ) . append ( "-" ) ; if ( url . getPort ( ) != - 1 ) { sb . append ( url . getPort ( ) ) . append ( "-" ) ; } String path = url . getPath ( ) ; for ( int i = 0 ; i < path . length ( ) - 4 ; i ++ ) { char c = path . charAt ( i ) ; if ( Character . isLetterOrDigit ( c ) ) { sb . append ( c ) ; } else { sb . append ( "_" ) ; } } switch ( type ) { case PLUGIN_LIST : sb . append ( ".txt" ) ; break ; case ICON_LIST : sb . append ( "-icons.zip" ) ; break ; } name = sb . toString ( ) ; } catch ( MalformedURLException e ) { name = "site-unknown.txt" ; } return new File ( moduleDir , name ) ; }
Creates the file name for the cached module list and the icon cache
 file.
Creates the file name for the cached module list and the icon cache file .