how to get url from inputstream in java