* don't crash just because if there's something wrong with GVFS
This commit is contained in:
parent
a5ed0351d1
commit
21fa1a19c4
|
@ -122,19 +122,23 @@ public class FileTransferable implements Transferable {
|
|||
file = new File(uri);
|
||||
} catch (IllegalArgumentException e) {
|
||||
// try handle other GVFS URI schemes
|
||||
try {
|
||||
if (GVFS.isSupported()) {
|
||||
file = GVFS.getPathForURI(uri);
|
||||
}
|
||||
} catch (LinkageError error) {
|
||||
Logger.getLogger(FileTransferable.class.getName()).log(Level.WARNING, "Unable to resolve GVFS URI", e);
|
||||
}
|
||||
}
|
||||
|
||||
if (!file.exists()) {
|
||||
throw new FileNotFoundException(file.toString());
|
||||
if (file == null || !file.exists()) {
|
||||
throw new FileNotFoundException(line);
|
||||
}
|
||||
|
||||
files.add(file);
|
||||
} catch (Throwable e) {
|
||||
// URISyntaxException, IllegalArgumentException, FileNotFoundException, LinkageError, etc
|
||||
Logger.getLogger(FileTransferable.class.getName()).log(Level.WARNING, "Invalid file URI: " + line, e);
|
||||
Logger.getLogger(FileTransferable.class.getName()).log(Level.WARNING, "Invalid file URI: " + line);
|
||||
}
|
||||
return files;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue