use of com.biglybt.core.logging.LogAlert in project BiglyBT by BiglySoftware.
the class TorrentUtil method moveTorrentFile.
protected static void moveTorrentFile(Shell shell, DownloadManager[] dms) {
if (dms != null && dms.length > 0) {
DirectoryDialog dd = new DirectoryDialog(shell);
String filter_path = TorrentOpener.getFilterPathTorrent();
// torrent.
if (filter_path == null || filter_path.trim().length() == 0) {
filter_path = new File(dms[0].getTorrentFileName()).getParent();
}
dd.setFilterPath(filter_path);
dd.setText(MessageText.getString("MyTorrentsView.menu.movedata.dialog"));
String path = dd.open();
if (path != null) {
File target = new File(path);
TorrentOpener.setFilterPathTorrent(target.toString());
for (int i = 0; i < dms.length; i++) {
try {
dms[i].moveTorrentFile(target);
} catch (Throwable e) {
Logger.log(new LogAlert(dms[i], LogAlert.REPEATABLE, "Download torrent move operation failed", e));
}
}
}
}
}
use of com.biglybt.core.logging.LogAlert in project BiglyBT by BiglySoftware.
the class TorrentUtil method moveDataFiles.
protected static void moveDataFiles(Shell shell, DownloadManager[] dms) {
if (dms != null && dms.length > 0) {
DirectoryDialog dd = new DirectoryDialog(shell);
String filter_path = TorrentOpener.getFilterPathData();
// torrent.
if (filter_path == null || filter_path.trim().length() == 0) {
filter_path = new File(dms[0].getTorrentFileName()).getParent();
}
dd.setFilterPath(filter_path);
dd.setText(MessageText.getString("MyTorrentsView.menu.movedata.dialog"));
String path = dd.open();
if (path != null) {
TorrentOpener.setFilterPathData(path);
File target = new File(path);
for (int i = 0; i < dms.length; i++) {
try {
dms[i].moveDataFilesLive(target);
} catch (Throwable e) {
Logger.log(new LogAlert(dms[i], LogAlert.REPEATABLE, "Download data move operation failed", e));
}
}
}
}
}
Aggregations