protocol_fetch() {
	local FILE="${1#file://*}"
	local media_mounted=
	local retval=1

	if [ "${FILE#/media/}" != "$FILE" ] && mountmedia; then
		media_mounted=1
	fi

	if [ ! -e "$FILE" ]; then
		retval=4
	elif cp "$FILE" $2; then
		# only if the file exists, and the cp succeeds, do we return 0
		retval=0
	fi

	[ -n "$media_mounted" ] && umount /media || true
	return $retval
}
