public void download() {
        URL url = null;
        URLConnection con = null;
        int i;
        try {
            url = new URL("https://localhost:8080/AppName/FileName.txt");
            con = url.openConnection();
            File file = new File("/home/user/test.txt");
            //this can use the compressed streams in the same named package, did not do this to keep boilerplate broadly accessible
            BufferedInputStream bis = new BufferedInputStream(
                    con.getInputStream());
            BufferedOutputStream bos = new BufferedOutputStream(
                    new FileOutputStream(file.getName()));
            while ((i = bis.read()) != -1) {
                bos.write(i);
            }
            bos.flush();
            bis.close();
        } catch (MalformedInputException malformedInputException) {
            malformedInputException.printStackTrace();
        } catch (IOException ioException) {
            ioException.printStackTrace();
        }
    }