Here you can find the source of getFileFor(URL url1)
private static File getFileFor(URL url1)
//package com.java2s; /******************************************************************************* * Copyright (c) 2005, 2009 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors://ww w . j av a2 s. c o m * IBM Corporation - initial API and implementation * Chris Aniszczyk (IBM Corp.) - Fixed NPE *******************************************************************************/ import java.io.*; import java.net.URL; import java.util.*; public class Main { private static Map urlFileMap; private static File getFileFor(URL url1) { if (urlFileMap == null) urlFileMap = new HashMap(); if (urlFileMap.get(url1) != null) return (File) urlFileMap.get(url1); File newFile = new File(url1.getFile()); urlFileMap.put(url1, newFile); return newFile; } }