|
How do I get at the file that a particular node represents |
|
|
Just get the DataObject as a cookie and go from there:
Node n = ...;
DataObject dob = (DataObject) n.getCookie(DataObject.class);
if (dob == null) {
// not a file node
} else {
// could also get all files in the data object, if desired:
FileObject fo = dob.getPrimaryFile();
// do something with fo
}
|
In the other direction you can use DataObject.find and then DataObject.getNodeDelegate to get a node representing a file object.
Source: NetBeans FAQ
Related Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.