This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I copied a file from Projects or Files window of Netbeans (RightClick->copy) , when I tried to paste it to a folder in one of my computer drives I got this error : Cannot copy file: the file name you specified is not valid or too long. Specify a different file name. the problem is also exists in Netbeans 6.5, but in 6.0 does not exist.
Stando, please take a look at this issue. Thanks.
for some reason the List that should hold the name of the copied/dragged file is empty when dropped into an external application. i have no idea why though...
*** Issue 125952 has been marked as a duplicate of this issue. ***
*** Issue 155807 has been marked as a duplicate of this issue. ***
While investigating 155807 I found out minimal test case which doesn't work. If ExTransferable is returned from org.openide.loaders.DataNode.clipboardCopy(), it fails when you drag&drop a file from IDE to external application on Windows. public Transferable clipboardCopy () throws IOException { Transferable t = null; FileObject fo = getDataObject().getPrimaryFile(); final File file = FileUtil.toFile(fo); if (null != file) { // this doesn't work t = ExTransferable.create(new ExTransferable.Single(DataFlavor.javaFileListFlavor) { public Object getData() { return Collections.singletonList(file); } }); // this works //t = new ExTransferable.Single(DataFlavor.javaFileListFlavor) { // public Object getData() { // return Collections.singletonList(file); // } //}; } return t; }
*** Issue 159589 has been marked as a duplicate of this issue. ***
We are expecting this to be fixed in 6.7... would this be done in 6.7.
i found out that after disabling netbeans TopSecurityManager drag and drop of files to other applications works as expected. cc'ing jarda and jesse who made changes in that class in the past. please note that this is broken in nb 6.5 but it used to work before.
as far as i can tell there's no SecurityException being thrown during drag'n'drop so it's complete mystery to me...
I don't see any interesting changes to this class since 6.5: diff -r f4e13fba708a -r 68c2cae99705 o.n.bootstrap/src/org/netbeans/TopSecurityManager.java --- a/o.n.bootstrap/src/org/netbeans/TopSecurityManager.java Mon Oct 13 20:24:51 2008 -0700 +++ b/o.n.bootstrap/src/org/netbeans/TopSecurityManager.java Tue Mar 24 17:58:36 2009 -0400 @@ -274,6 +274,7 @@ warnedClassesNH.add ("org.netbeans.updater.UpdateTracking"); // NOI18N warnedClassesNH.add("org.netbeans.core.ui.ProductInformationPanel"); // #47429; NOI18N warnedClassesNH.add("org.netbeans.lib.uihandler.LogFormatter"); + warnedClassesNH.add("org.netbeans.modules.j2ee.sun.ide.j2ee.PluginProperties"); // AS bundle is not in any cluster } /* ----------------- private methods ------------- */ @@ -551,7 +552,10 @@ public static void makeSwingUseSpecialClipboard (java.awt.datatransfer.Clipboard clip) { try { synchronized (TopSecurityManager.class) { - assert System.getSecurityManager() instanceof TopSecurityManager : "Our manager has to be active: " + System.getSecurityManager(); // NOI18N + if (! (System.getSecurityManager() instanceof TopSecurityManager)) { + LOG.warning("Our manager has to be active: " + System.getSecurityManager()); + return; + } // NOI18N if (CLIPBOARD_FORBIDDEN != null) { return; }
i've spent a couple of days trying to find a fix for this bug but with no results. the only known workaround is disabling netbeans TopSecurityManager in bootstrap module
*** Issue 161826 has been marked as a duplicate of this issue. ***
Created attachment 87869 [details] plain java application with custom SecurityManager and broken copy/paste
copy/paste of a file to other application isn't working in a plain java application when custom SecurityManager is set which allows all permissions, see the attached sample app. not sure whether this is a jdk bug or whether some permission types need special handling in the SecurityManager
*** Issue 173213 has been marked as a duplicate of this issue. ***
Please escalate this issue. It has been open for more than a year. This is very important for copying files eg. war file for which Netbeans does not provide a path that can be modified. User has to go through the complete file system to get to the file.
it's a bug in jdk tracked under id 6888182
Please confirm the link to the bug. I search thru the DB but could not find any bug # 6888182. Also, can we not fix this issue in Netbeans itself?
it's a security issue so it's not available to the public i've asked jdk team for a workaround but didn't get any:(
Oh you mean the Netbeans JDK team. I was thrown off into believing that it is a Sun Java bug! Anyways, if this cannot be resolved it seems this totally undermines the Files View Window. Most of my developers use it for copying packaged files like war out of a project.
no, it is a sun jdk bug
> this totally undermines the Files View Window > Most of my developers use it for copying packaged files like war out of a project You can do such copying in Favorites view or between Files view (the project folder content) and Favorites view (any other folder on disk)...
Again - you don't allow network shares to be added to Favorites !! Anyways thanks for the explanation!
*** Bug 176303 has been marked as a duplicate of this bug. ***
*** Bug 128670 has been marked as a duplicate of this bug. ***
*** Bug 188109 has been marked as a duplicate of this bug. ***
Works in Eclipse
the bug still exists in 6.9.1 Is there any possibility to solve the problem? It's 2 years from the time of bug report!
excuse me I forget that the bug is from JDK. where is the link to the bug number 6888182 ?
i was told it was a security issue in jdk so the bug report is not visible to the public
It would help to copy the file location to the clipboard so it can be used to locate the file. I have seen this in KDE under Linux.
Why is it acceptable that such a bug won't fix while the Eclipse IDE has no problem with this?
i happily integrate any working patch