Is somebody planning to implement Recycle/Trash Bin file sending under the jdic??????
Anybody knows how to programmatically send a file to the Trash Can in Mac OS X (through Cocoa)?
I looked inside Apple's documentation but couldn't find an answer.
I alreay sent the code via e-mail.
The method receives a File object and sends the file/directory to the Recycle Bin. It will return true if the operation is performed, even in the cases where the user press "No" in the Confirmation Box.
If the File Object doesn't reference any File, the method will show a native error dialog.
If someone know how this works in Gnome (is there an API method, like in Windows?), I might give it a look. I haven't find any references to that in Google.
I tested the code against a Windows XP box, but it should work in Windows 95 OSR2 too.
Also, I found this bug in Java bug database:
Need way to find free disk space
which gives more evaluation information. It maybe helpful to take a look.
I've implemented a method to do that in Windows, using JNI + Win32 API. The method receives a File object and sends the file or directory referenced by the File object to the Recycle Bin. It also shows the Windows' standard confirmation box.
Would you be interested in?
It's great ! It's a very interesting feature, I'd like to try it out. I fired an issue to track it:
Could you raise your comments there and provide a patch? We can include it in JDIC someway. :-)
There is no such planned feature at the moment. Do you any idea for that?
I imagine this as File class extension with method deleteToTrash. This method would need a dll for Windows systems. As far as know, for other systems you just need to move you file to Trash or .Trash folder.
So, it doesn't sound a very complicated, I think I could do that.....
There is an RFE on this:
I suggest voting for this bug if you like the idea.
I already did,
but I can not wait for years for next release....
Hi Anka and Will,
I viewed that RFE, and think it's quite a reasonable and doable request.
Though we can hope and wait for that in JDK 6.0, or 7.0+ (?), we can make it available in JDIC now, and try to integrate it into JDK someday.
On the other hand, that's a feature that well fits in with the scope of JDIC project. It can be directly integrated into the current FileExplorer demo. : )
Also, leveraging the current JDIC source structure, it's very much doable. All the other packages take the similar approach: Java API calls into JNI code to access the OS specific features.
If you can spare time to create a prototype, that would be great. I think we can integrate that into JDIC later releases.
What do you think ? : )
I am going to implement this feature soon...
I'm ready to try it out soon... : -)
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.