public static boolean downloadFile(String srcUrl, String fileName) {
        boolean success = false;
        InputStream in = null;
        FileOutputStream fos = null;
        try {
            URL url = new URL(srcUrl);
            in = url.openStream();
            fos = new FileOutputStream(fileName);
            int b;
            while ((b = in.read()) != -1) {
                fos.write(b);
            }
            success = true;
        } catch (MalformedURLException e) {
            throw new RuntimeException("new URL error.", e);
        } catch (IOException e) {
            throw new RuntimeException("io exception.", e);
        } finally {
            try {
                if (fos != null) {
                    fos.close();
                }
                if (in != null) {
                    in.close();
                }
            } catch (IOException e) {
                throw new RuntimeException("close stream error. ", e);
            }

        }
        return success;

    }