* complete dnd support for ubuntu :D

This commit is contained in:
Reinhard Pointner 2008-02-15 20:02:23 +00:00
parent 036eefc5b9
commit 9053df6316
2 changed files with 5 additions and 3 deletions

View File

@ -53,7 +53,7 @@ public class FileTransferable implements Transferable {
StringBuffer sb = new StringBuffer();
for (File file : files) {
sb.append(file.toURI());
sb.append("file:///" + file.toURI().getPath());
sb.append("\r\n");
}

View File

@ -39,7 +39,7 @@ public abstract class FileTransferablePolicy extends TransferablePolicy {
if (tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
return (List<File>) tr.getTransferData(DataFlavor.javaFileListFlavor);
} else if (tr.isDataFlavorSupported(FileBotUtil.uriListFlavor)) {
String transferString = (String) tr.getTransferData(DataFlavor.stringFlavor);
String transferString = (String) tr.getTransferData(FileBotUtil.uriListFlavor);
String lines[] = transferString.split("\r?\n");
ArrayList<File> files = new ArrayList<File>(lines.length);
@ -57,9 +57,11 @@ public abstract class FileTransferablePolicy extends TransferablePolicy {
files.add(file);
} catch (Exception e) {
// URISyntaxException, IllegalArgumentException
Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).log(Level.WARNING, "Invalid file url: " + line, e);
Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).log(Level.WARNING, "Invalid file url: " + line);
}
}
return files;
}
} catch (UnsupportedFlavorException e) {
e.printStackTrace();