chameria-webview-factory/src/main/java/de/akquinet/chameria/webview/WebViewFactory.java
public void save(QNetworkReply reply) {
        if (m_download) {
            String fn = QFileDialog.getSaveFileName();
            if (fn != null && fn.length()>0) {
                m_logger.info("File name : " + fn);
                try {
                    URL u = new URL(reply.url().toString());
                    FileOutputStream out = new FileOutputStream(new File(fn));
                    InputStream in = u.openStream();
                    write(in, out);
                } catch (IOException e) {
                    m_logger.error("Cannot download file " + e.getMessage(), e);
                }
            } else {
                m_logger.warn("No File Name - Download request cancelled");
            }
        } else {
            m_logger.warn("Download disabled");
        }

    }
public void save(QNetworkReply reply) {
        if (m_download) {
            String fn = QFileDialog.getSaveFileName();
            if (fn != null && fn.length()>0) {
                m_logger.info("File name : " + fn);
                try {
                    URL u = new URL(reply.url().toString());
                    FileOutputStream out = new FileOutputStream(new File(fn));
                    InputStream in = u.openStream();
                    write(in, out);
                } catch (IOException e) {
                    m_logger.error("Cannot download file " + e.getMessage(), e);
                }
            } else {
                m_logger.warn("No File Name - Download request cancelled");
            }
        } else {
            m_logger.warn("Download disabled");
        }

    }
public void save ( QNetworkReply reply ) { if ( m_download ) { String fn = QFileDialog . getSaveFileName ( ) ; if ( fn != null && fn . length ( ) > 0 ) { m_logger . info ( "File name : " + fn ) ; try { URL u = new URL ( reply . url ( ) . toString ( ) ) ; FileOutputStream out = new FileOutputStream ( new File ( fn ) ) ; InputStream in = u . openStream ( ) ; write ( in , out ) ; } catch ( IOException e ) { m_logger . error ( "Cannot download file " + e . getMessage ( ) , e ) ; } } else { m_logger . warn ( "No File Name - Download request cancelled" ) ; } } else { m_logger . warn ( "Download disabled" ) ; } }
Save callback (for unsupported content).
Checks if the 'save' feature is enabled. If so, launch the system
save dialog.
@param reply the url to save
Save callback ( for unsupported content ) . Checks if the save feature is enabled . If so launch the system save dialog .