Fixed dropping of multiple file urls seperated by \r\n
This commit is contained in:
parent
61b63648ab
commit
a94e60312c
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user