Code example for URL

Methods: toString

0
    private boolean mOutputStreamClosed;
 
    public ContentURLConnection(ContentResolver resolver, URL url) {
        super(url);
        mResolver = resolver;
        String spec = url.toString();
        mUri = Uri.parse(spec);
    } 
 
    /** 
     * {@inheritDoc} 
     */ 
    @Override 
    public void connect() throws IOException { 
        if (getDoInput()) {
            InputStream in = mResolver.openInputStream(mUri);
            mInputStream = new ContentURLConnectionInputStream(in);
        } 
        if (getDoOutput()) {
            OutputStream out = mResolver.openOutputStream(mUri, "rwt");
            mOutputStream = new ContentURLConnectionOutputStream(out);