public static void copyTo(Object source, File output) throws IllegalArgumentException, IOException
	{
		InputStream in = getInputStream(source);
		FileOutputStream fos = new FileOutputStream(output);
		byte [] buf = new byte[1024];
        int len;
        while((len = in.read(buf)) > 0)
        {            
            fos.write(buf, 0, len);
        }
        fos.close();
        in.close();
	}