* @param map
*/
static void copyIconsToDirectory(final MapModel map, final String directoryName) {
final ListModel icons = map.getIconRegistry().getIconsAsListModel();
for (int i = 0; i < icons.getSize(); i++) {
final UIIcon icon = (UIIcon) icons.getElementAt(i);
final String iconName = icon.getName();
final StringBuilder sb = new StringBuilder(directoryName);
final int lastIndexOfSeparator = iconName.lastIndexOf('/');
if (lastIndexOfSeparator != -1) {
sb.append(File.separatorChar);
sb.append(iconName.substring(0, lastIndexOfSeparator));
}
final File destinationDirectory = new File(sb.toString());
destinationDirectory.mkdirs();
FileUtils.copyFromURL(icon.getUrl(), destinationDirectory);
}
}