Package org.torrcast.model

Examples of org.torrcast.model.TorrentFile


            @RequestParam(value = "id", required = true) int id,
            HttpServletResponse response) throws IOException {

//        logger.debug("Data:" + torrentFile.getData());

        TorrentFile torrentFile = podcastDao.getTorrentFile(id);
        response.setContentType("application/x-bittorrent");
        response.setHeader("Content-Disposition", "attachment; filename=\"test_torrent.torrent\"");
        response.getOutputStream().write(torrentFile.getData());
    }
View Full Code Here


                System.out.println("Hashing the files...");
                System.out.flush();
                tp.generatePieceHashes();
                System.out.println("Hash complete... Saving...");

                TorrentFile torrentFile = new TorrentFile(tp.generateTorrent(item.getFileUrl()));
               
                torrent.setCreatedDate(new Date());
                torrent.setFile(torrentFile);

                OutputStream fos = new FileOutputStream("/tmp/file-989.mp3.torrent");
                fos.write(torrentFile.getData());

//                 Save the new data (TorrentFile & Torrent).
//                podcastDao.storeTorrent(torrent);
               
                item.setTorrent(torrent);
View Full Code Here

TOP

Related Classes of org.torrcast.model.TorrentFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.