Книга: Embedded Linux development using Eclipse
6.2.2 Filters and Filter Pools
6.2.2 Filters and Filter Pools
The entries My Home and Root under Sftp Files in your first remote connection are known as filters. RSE automatically creates these two filters for every SSH connection. Right-click on My Home and select Properties. The Filter Information page tells you that this is a Filter Resource and gives its name. It also says that it belongs to a specified filter pool and profile. The Filter Strings page tells you that this filter points to the home folder “.” and that displayed file entries are filtered by name, but the file name filter, in fact, is “*” or everything. Note that none of this information is editable in the default filters that RSE creates.
You can create your own filters to simplify the management of remote resources. You might, for example, want a filter that lists just C/C++ source files, those with a .c, .h, or .cpp extension. Pick a folder on your remote system that has some source files in it, or in subfolders. In my case, it’s drivers/
that has some examples for my Linux device driver class.
Right-click the folder name and select New?Filter…. This brings up the dialog in Figure 6.8. Select Subset by file types, and click Select…. This brings up a list of file extensions, but sadly, .c and .h aren’t listed. In Other Extensions enter “c,h,cpp” and click OK.
Figure 6.8: Creating a filter.
Click Next and give the filter a name, “My C Files,” for example. On this screen you also have a choice of making this filter private to this connection or making it part of a filter pool, which makes it visible to other connections. Uncheck the Only create filter in this connection box to make it part of the default filter pool. Clicking Next brings up some “tips” about filters and filter pools. Click Finish.
The new filter shows up below Root under Sftp Files in your remote connection. For filters you create, you can modify the Filter Strings from the Properties page and add new filter strings.
Over time, you may end up with such a large number of filters that the system becomes hard to navigate. The solution is to aggregate related filters into filter pools. But in order to work with filter pools, we have to make them visible. Select Window?Preferences?Remote Systems and check the Show filter pools in Remote Systems view box. While you’re there have a look at some of the other preferences related to remote systems. Click Apply and then OK.[6]
Back in the Remote Systems view, the filters previously listed under Sftp Files have been replaced by a filter pool entry called <profile_name>:ssh.files
, where <profile_name>
is the name of the default RSE profile that defaults to the name of your local host system. Expand the filter pool entry to reveal the same set of filters we previously had. Right-click the pool entry and select Properties. Here we see that this is not a filter pool but is, in fact, a reference to a filter pool.
Filter pools are associated with profiles and then referenced by connections. To create a new filter pool, right-click on Sftp Files and select New?Filter Pool… Give it a name, “My New Pool,” perhaps. At this point there should be only one profile to which it can be attached named for your host computer. Click Finish and the new pool shows up under Sftp Files. You can now create new filters to add to this pool.
You might want to make your new filter pool visible to the second connection we created earlier. Right-click on the Sftp Files entry of your second connection and select New?Filter Pool Reference?<your_host_name>?My New Pool. The new pool is now visible in your second connection.
- Разработка приложений баз данных InterBase на Borland Delphi
- Open Source Insight and Discussion
- Introduction to Microprocessors and Microcontrollers
- Chapter 6. Traversing of tables and chains
- Chapter 8. Saving and restoring large rule-sets
- Chapter 11. Iptables targets and jumps
- Chapter 5 Installing and Configuring VirtualCenter 2.0
- Chapter 16. Commercial products based on Linux, iptables and netfilter
- Appendix A. Detailed explanations of special commands
- Appendix B. Common problems and questions
- Appendix E. Other resources and links
- What is an IP filter