public MediaWiki.InterwikiPrefixes getInterwikiPrefixes() throws IOException {
		preferenceLock.readLock().lock();
		try {
			MediaWiki.InterwikiPrefixes result;
			if ((interwikiPrefixCache != null) && ((result = interwikiPrefixCache.get()) != null))
				return result;
		} finally {
			preferenceLock.readLock().unlock();
		}
		// Not cached. Get, cache and return the result now.

		final Map<String, String> getParams = paramValuesToMap("action", "query", "format", "xml", "meta", "siteinfo", "siprop", "interwikimap");
		final String url = createApiGetUrl(getParams);

		final Map<String, Boolean> areLocal = new HashMap<String, Boolean>();
		final Map<String, String> urlPatterns = new HashMap<String, String>();
		final Map<String, String> languages = new HashMap<String, String>();

		networkLock.lock();
		try {
			final InputStream in = get(url);
			final Document xml = parse(in);
			// no checkError: no errors declared for this action

			final NodeList interwikiMapTags = xml.getElementsByTagName("interwikimap");

			if (interwikiMapTags.getLength() >= 1) {
				final Element interwikiMapTag = (Element) interwikiMapTags.item(0);

				final NodeList iwTags = interwikiMapTag.getElementsByTagName("iw");
				for (int i = 0; i < iwTags.getLength(); i++) {
					final Element iwTag = (Element) iwTags.item(i);
					final String name = iwTag.getAttribute("prefix");
					urlPatterns.put(name, iwTag.getAttribute("url"));
					if (iwTag.hasAttribute("language")) {
						languages.put(name, iwTag.getAttribute("language"));
					}
					areLocal.put(name, iwTag.hasAttribute("local"));
				}
			}

			final Map<String, MediaWiki.InterwikiPrefix> interwikiPrefixes = new TreeMap<String, InterwikiPrefix>();
			for (final String name : urlPatterns.keySet()) {
				interwikiPrefixes.put(name, new MediaWiki.InterwikiPrefix(name, languages.get(name), urlPatterns.get(name), areLocal.get(name)));
			}
			final MediaWiki.InterwikiPrefixes result = new MediaWiki.InterwikiPrefixes(interwikiPrefixes);
			preferenceLock.writeLock().lock();
			try {
				interwikiPrefixCache = new SoftReference<MediaWiki.InterwikiPrefixes>(result);
			} finally {
				preferenceLock.writeLock().unlock();
			}
			return result;
		} finally {
			networkLock.unlock();
		}
	}