public TorrentFileInfo (long length, Path path) {
        if (path == null) {
            throw new NullPointerException();
        }
        if (length < 0) {
            throw new IllegalArgumentException();
        }

        this.length = length;
        this.path = path.isAbsolute() ? Paths.get("/").relativize(path) : path;
    }