}
String creator = String.format("%s (ttorrent)",
System.getProperty("user.name"));
Torrent torrent = null;
if (source.isDirectory()) {
File[] files = source.listFiles();
Arrays.sort(files);
torrent = Torrent.create(source, Arrays.asList(files),
announceList, creator);
} else {
torrent = Torrent.create(source, announceList, creator);
}
torrent.save(fos);
} else {
Torrent.load(new File(filenameValue), true);
}
} catch (Exception e) {
logger.error("{}", e.getMessage(), e);