Fixed dropping of multiple file urls seperated by \r\n

This commit is contained in:
Reinhard Pointner 2007-12-24 11:36:11 +00:00
parent 61b63648ab
commit a94e60312c

View File

@ -69,7 +69,7 @@ public abstract class FileTransferablePolicy extends TransferablePolicy {
try { try {
String transferString = (String) tr.getTransferData(DataFlavor.stringFlavor); String transferString = (String) tr.getTransferData(DataFlavor.stringFlavor);
String lines[] = transferString.split("\n"); String lines[] = transferString.split("\r?\n");
ArrayList<File> files = new ArrayList<File>(lines.length); ArrayList<File> files = new ArrayList<File>(lines.length);
for (String line : lines) { for (String line : lines) {
@ -78,8 +78,8 @@ public abstract class FileTransferablePolicy extends TransferablePolicy {
if (file.exists()) if (file.exists())
files.add(file); files.add(file);
} catch (IllegalArgumentException e) { } catch (Exception e) {
// invalid file uri System.err.println(e);
} }
} }