Code example for URLConnection

Methods: getOutputStream

0
        if (isReference()) { 
            return ((Resource) getCheckedRef()).getOutputStream(); 
        } 
        connect(); 
        try { 
            return conn.getOutputStream();
        } finally { 
            conn = null;
        } 
    } 
 
    /** 
     * Ensure that we have a connection. 
     * @throws IOException if the connection cannot be established. 
     */ 
    protected synchronized void connect() throws IOException { 
        URL u = getURL();
        if (u == null) {
            throw new BuildException("URL not set"); 
        } 
        if (conn == null) {