List of usage examples for org.apache.commons.io FileUtils toFile
public static File toFile(URL url)
URL
to a File
. From source file:wtf.cowbay.libraven.bencode.TorrentFileChecker.java
@Test public void checkTorrentFile() throws IOException { System.out.println("==ENCODE INFO==="); TorrentMeta torrent = TorrentMeta//from w w w . j a v a 2 s. c o m .loadFromFile(FileUtils.toFile(getClass().getResource("/test.torrent")).getAbsolutePath()); System.out.println("Name" + torrent.info.name); System.out.println("Info hash: " + torrent.infoHash); List<String> announces = torrent.announces; for (String announce : announces) { System.out.println("Announce: " + announce); } System.out.println("================"); }