Example usage for org.apache.commons.io FileUtils toFile

List of usage examples for org.apache.commons.io FileUtils toFile

Introduction

In this page you can find the example usage for org.apache.commons.io FileUtils toFile.

Prototype

public static File toFile(URL url) 

Source Link

Document

Convert from a URL to a File.

Usage

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("================");
}