Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ErrorTreePanel.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ErrorTreePanel.java	(revision 10407)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ErrorTreePanel.java	(revision 10408)
@@ -48,5 +48,5 @@
 		this.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
 		setErrorList(errors);
-		}
+	}
 
 	public String getToolTipText(MouseEvent e) {
Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java	(revision 10407)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java	(revision 10408)
@@ -8,8 +8,4 @@
 import java.awt.GridBagLayout;
 import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -48,4 +44,5 @@
 import org.openstreetmap.josm.gui.preferences.TaggingPresetPreference;
 import org.openstreetmap.josm.gui.tagging.TaggingPreset;
+import org.openstreetmap.josm.io.MirroredInputStream;
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.plugins.validator.OSMValidatorPlugin;
@@ -153,5 +150,5 @@
 	 * @throws IOException
 	 */
-	private static void initializeData() throws FileNotFoundException, IOException
+	private static void initializeData() throws IOException
 	{
 		spellCheckKeyData = new HashMap<String, String>();
@@ -177,65 +174,63 @@
 		for(String source: sources.split(";"))
 		{
-			File sourceFile = null;
 			try
 			{
-				sourceFile = Util.mirror(new URL(source), Util.getPluginDir(), -1);
-			}
-			catch(java.net.MalformedURLException e) {}
-			if( sourceFile == null || !sourceFile.exists() )
-			{
-				sourceFile = new File(source);
-				if( sourceFile == null || !sourceFile.exists() )
-				{
-					errorSources += source + "\n";
-					continue;
-				}
-			}
-
-			BufferedReader reader = new BufferedReader(new FileReader(sourceFile));
-
-			String okValue = null;
-			Boolean tagcheckerfile = false;
-			do
-			{
-				String line = reader.readLine();
-				if( line == null || (!tagcheckerfile && line.length() == 0) )
-					break;
-				if( line.startsWith("#") )
-				{
-					if(line.startsWith("# JOSM TagChecker"))
-						tagcheckerfile = true;
-				}
-				else if(tagcheckerfile)
-				{
-					if(line.length() > 0)
-					{
-						CheckerData d = new CheckerData();
-						String err = d.getData(line);
-
-						if(err == null)
-							checkerData.add(d);
-						else
-							System.err.println(tr("Invalid tagchecker line - {0}: {1}", err, line));
-					}
-				}
-				else if( line.charAt(0) == '+' )
-				{
-					okValue = line.substring(1);
-				}
-				else if( line.charAt(0) == '-' && okValue != null )
-				{
-					spellCheckKeyData.put(line.substring(1), okValue);
-				}
-				else
-				{
-					System.err.println(tr("Invalid spellcheck line: {0}", line));
-				}
-			}
-			while( true );
+				MirroredInputStream s = new MirroredInputStream(source, Util.getPluginDir(), -1);
+				InputStreamReader r;
+				try
+				{
+					r = new InputStreamReader(s, "UTF-8");
+				}
+				catch (UnsupportedEncodingException e)
+				{
+					r = new InputStreamReader(s);
+				}
+				BufferedReader reader = new BufferedReader(r);
+
+				String okValue = null;
+				Boolean tagcheckerfile = false;
+				String line;
+				while((line = reader.readLine()) != null && (tagcheckerfile || line.length() != 0))
+				{
+					if(line.startsWith("#"))
+					{
+						if(line.startsWith("# JOSM TagChecker"))
+							tagcheckerfile = true;
+					}
+					else if(tagcheckerfile)
+					{
+						if(line.length() > 0)
+						{
+							CheckerData d = new CheckerData();
+							String err = d.getData(line);
+
+							if(err == null)
+								checkerData.add(d);
+							else
+								System.err.println(tr("Invalid tagchecker line - {0}: {1}", err, line));
+						}
+					}
+					else if(line.charAt(0) == '+')
+					{
+						okValue = line.substring(1);
+					}
+					else if(line.charAt(0) == '-' && okValue != null)
+					{
+						spellCheckKeyData.put(line.substring(1), okValue);
+					}
+					else
+					{
+						System.err.println(tr("Invalid spellcheck line: {0}", line));
+					}
+				}
+			}
+			catch (IOException e)
+			{
+				errorSources += source + "\n";
+			}
 		}
 
 		if( errorSources.length() > 0 )
-			throw new IOException( tr("Could not download data file(s):\n{0}", errorSources) );
+			throw new IOException( tr("Could not access data file(s):\n{0}", errorSources) );
 	}
 
@@ -251,14 +246,26 @@
 
 		Collection<TaggingPreset> presets = TaggingPresetPreference.taggingPresets;
-		if( presets == null || presets.isEmpty() )
-		{
-			// Skip re-reading presets if there are none available
-			return;
-		}
-
-		presetsValueData = new Bag<String, String>();
-		readPresetFromPreferences();
-	}
-
+		if(presets != null)
+		{
+			presetsValueData = new Bag<String, String>();
+			for(TaggingPreset p : presets)
+			{
+				for(TaggingPreset.Item i : p.data)
+				{
+					if(i instanceof TaggingPreset.Combo)
+					{
+						TaggingPreset.Combo combo = (TaggingPreset.Combo) i;
+						for(String value : combo.values.split(","))
+							presetsValueData.add(combo.key, value);
+					}
+					else if(i instanceof TaggingPreset.Key)
+					{
+						TaggingPreset.Key k = (TaggingPreset.Key) i;
+						presetsValueData.add(k.key, k.value);
+					}
+				}
+			}
+		}
+	}
 
 	@Override
@@ -345,76 +352,4 @@
 					withErrors.add(p, "FIXME");
 				}
-			}
-		}
-	}
-
-	/**
-	 * Parse an anotation preset from a stream
-	 *
-	 * @param inStream The stream of the anotstion preset
-	 * @throws SAXException
-	 */
-	public static void readPresets(InputStream inStream) throws SAXException
-	{
-		BufferedReader in = null;
-		try
-		{
-			in = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));
-		}
-		catch (UnsupportedEncodingException e)
-		{
-			e.printStackTrace();
-			in = new BufferedReader(new InputStreamReader(inStream));
-		}
-
-		XmlObjectParser parser = new XmlObjectParser();
-		parser.mapOnStart("item", TaggingPreset.class);
-		parser.map("text", TaggingPreset.Text.class);
-		parser.map("check", TaggingPreset.Check.class);
-		parser.map("combo", TaggingPreset.Combo.class);
-		parser.map("label", TaggingPreset.Label.class);
-		parser.map("key", TaggingPreset.Key.class);
-		parser.start(in);
-
-		while(parser.hasNext())
-		{
-			Object obj = parser.next();
-			if (obj instanceof TaggingPreset.Combo) {
-				TaggingPreset.Combo combo = (TaggingPreset.Combo)obj;
-				for(String value : combo.values.split(",") )
-					presetsValueData.add(combo.key, value);
-			}
-		}
-	}
-
-	/**
-	 * Reads the tagging presets
-	 */
-	public static void readPresetFromPreferences()
-	{
-		String allAnnotations = Main.pref.get("taggingpreset.sources");
-		if(allAnnotations == null | allAnnotations.length() == 0)
-			return;
-		for(String source : allAnnotations.split(";"))
-		{
-			InputStream in = null;
-			try
-			{
-				if (source.startsWith("http") || source.startsWith("ftp") || source.startsWith("file"))
-					in = new URL(source).openStream();
-				else if (source.startsWith("resource://"))
-					in = Main.class.getResourceAsStream(source.substring("resource:/".length()));
-				else
-					in = new FileInputStream(source);
-				readPresets(in);
-				in.close();
-			}
-			catch (IOException e)
-			{
-				// Error already reported by JOSM
-			}
-			catch (SAXException e)
-			{
-				// Error already reported by JOSM
 			}
 		}
Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/util/Util.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/util/Util.java	(revision 10407)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/util/Util.java	(revision 10408)
@@ -6,7 +6,4 @@
 import java.awt.event.ActionListener;
 import java.awt.geom.Point2D;
-import java.io.*;
-import java.net.URL;
-import java.net.URLConnection;
 import java.util.*;
 
@@ -73,125 +70,4 @@
 			this.time = time;
 		}
-	}
-
-
-	/**
-	 * Loads a text file in a String
-	 *
-	 * @param resource The URL of the file
-	 * @return A String with the file contents
-	 * @throws IOException when error reading the file
-	 */
-	public static String loadFile(URL resource) throws IOException
-	{
-		BufferedReader in = null;
-		try
-		{
-			in = new BufferedReader(new InputStreamReader(resource.openStream()));
-			StringBuilder sb = new StringBuilder();
-			for (String line = in.readLine(); line != null; line = in.readLine())
-			{
-				sb.append(line);
-				sb.append('\n');
-			}
-			return sb.toString();
-		}
-		finally
-		{
-			if( in != null )
-			{
-				try {
-					in.close();
-				} catch (IOException e) {
-					e.printStackTrace();
-				}
-			}
-		}
-	}
-
-	/**
-	 * Mirrors a file to a local file.
-	 * <p>
-	 * The file mirrored is only downloaded if it has been more than one day since last download
-	 *
-	 * @param url The URL of the remote file
-	 * @param destDir The destionation dir of the mirrored file
-	 * @param maxTime The time interval, in seconds, to check if the file changed. If less than 0, it defaults to 1 week
-	 * @return The local file
-	 */
-	public static File mirror(URL url, String destDir, long maxTime)
-	{
-		if( url.getProtocol().equals("file") )
-			return new File(url.toString() ) ;
-
-		String localPath = Main.pref.get( PreferenceEditor.PREFIX + ".mirror." + url);
-		File oldFile = null;
-		if( localPath != null && localPath.length() > 0)
-		{
-			StringTokenizer st = new StringTokenizer(localPath, ";");
-			long checkDate = Long.parseLong(st.nextToken());
-			localPath = st.nextToken();
-			oldFile = new File(localPath);
-			maxTime = (maxTime <= 0) ? 7 * 24 * 60 * 60 * 1000 : maxTime * 1000;
-			if( System.currentTimeMillis() - checkDate < maxTime )
-			{
-				if( oldFile.exists() )
-					return oldFile;
-			}
-		}
-
-		File destDirFile = new File(destDir);
-		if( !destDirFile.exists() )
-			destDirFile.mkdirs();
-
-		localPath = destDir + System.currentTimeMillis() + "-" + new File(url.getPath()).getName();
-		BufferedOutputStream bos = null;
-		BufferedInputStream bis = null;
-		try
-		{
-			URLConnection conn = url.openConnection();
-			conn.setConnectTimeout(5000);
-			bis = new BufferedInputStream(conn.getInputStream());
-			bos = new BufferedOutputStream( new FileOutputStream(localPath) );
-			byte[] buffer = new byte[4096];
-			int length;
-			while( (length = bis.read( buffer )) > -1 )
-			{
-				bos.write( buffer, 0, length );
-			}
-		}
-		catch(IOException ioe)
-		{
-			if( oldFile != null )
-				return oldFile;
-			else
-				return null;
-		}
-		finally
-		{
-			if( bis != null )
-			{
-				try {
-					bis.close();
-				} catch (IOException e) {
-					e.printStackTrace();
-				}
-			}
-			if( bos != null )
-			{
-				try {
-					bos.close();
-				} catch (IOException e) {
-					e.printStackTrace();
-				}
-			}
-		}
-
-		Main.pref.put( PreferenceEditor.PREFIX + ".mirror." + url, System.currentTimeMillis() + ";" + localPath);
-
-		if( oldFile != null )
-			oldFile.delete();
-
-		return new File(localPath);
 	}
 
