Improved GVFS error logging: GVFS: %s => %s

This commit is contained in:
Reinhard Pointner 2017-02-25 22:47:17 +08:00
parent 9f5867f295
commit 3d923da419
1 changed files with 5 additions and 4 deletions

View File

@ -7,6 +7,7 @@ import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable; import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException; import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.net.URI; import java.net.URI;
import java.nio.CharBuffer; import java.nio.CharBuffer;
@ -109,11 +110,11 @@ public class FileTransferable implements Transferable {
try { try {
File file = GVFS.getDefaultVFS().getPathForURI(new URI(line)); File file = GVFS.getDefaultVFS().getPathForURI(new URI(line));
if (file != null && file.exists()) { if (file == null || !file.exists()) {
files.add(file); throw new FileNotFoundException(file.getPath());
} else {
debug.warning(format("GVFS: %s => %s", line, file));
} }
files.add(file);
} catch (Throwable e) { } catch (Throwable e) {
debug.warning(format("GVFS: %s => %s", line, e)); debug.warning(format("GVFS: %s => %s", line, e));
} }