-
Notifications
You must be signed in to change notification settings - Fork 1
DevFaqFolderOfInstances
Often registries of objects are created by placing files with the extension .instance
into some folder in the system filesystem. The task, then, is to turn a folder full of files into a collection of objects, and make sure we only get objects of the type we are interested in. In NetBeans 6 it is very simple to do that:
Lookup myObjects = Lookups.forPath ("path/to/folder/in/sysfs");
Collection <? extends MyType> c = myObjects.lookupAll(MyType.class);
(note the separator is always / with NetBeans filesystems).
If you have a single .instance
file and need to get an object for that, see this FAQ entry.
The content in this page was kindly donated by Oracle Corp. to the Apache Software Foundation.
This page was exported from http://wiki.netbeans.org/DevFaqFolderOfInstances , that was last modified by NetBeans user Jtulach on 2010-07-24T19:43:48Z.
NOTE: This document was automatically converted to the AsciiDoc format on 2018-01-26, and needs to be reviewed.
Apache NetBeans is an effort undergoing incubation at The Apache Software Foundation (ASF).
Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects.
While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
This wiki is an experiment pending Apache NetBeans Community approval.