Community
Participate
Working Groups
Using an ftp connection create a new filter and select show files only. The new filter will display folders still. Steps to Reproduce: 1. Create an ftp-only connection. 2. Find a folder with files and folders under it. 3. Right click on the folder and select New -> Filter. 4. Select "Show Files Only" and click Next. 5. Enter some name and Click Finish. 6. Go to the new filter and it will display files and folders. -----------Enter bugs above this line----------- TM 2.0RC2 Testing installation : eclipse-SDK-3.3RC3 RSE install : RSE 2.0 RC2 java.runtime : Sun 1.5.0_11-b03 os.name: : Windows XP, Service Pack 2 ------------------------------------------------
Created attachment 71596 [details] Patch Patch showing files only when required by a filter
After RC3, all available committers must also review and agree in a vote after reviewing the bug for appropriateness and risk. TM committers: Can you review and vote it for 2.0RC4 ? Otherwise, the fix will go to RSE 2.0.1.
Marked as fixed by mistake, reopened
Marked to be fixed in RSE 2.0.1 as agreed in the committer conference call
Hm... looking at the patch, it appears that if only folders are requested, the name is not checked and ANY folder will be allowed. Is this expected? Or wouldn't we want to restrict folders to those matching the pattern, if only folders are requested? NOT approving (-1) until this is resolved. Adding DaveD to CC for comments since he is the Filter expert.
(In reply to comment #5) > Hm... looking at the patch, it appears that if only folders are requested, the > name is not checked and ANY folder will be allowed. Is this expected? Or > wouldn't we want to restrict folders to those matching the pattern, if only > folders are requested? The filter only get applied to file names. Folders are shown to allow browsing the subfolders as well. In fact, I won't expect the "folders only" option to be used from RSE, I have implemented it just to cover all the possible values of file types.
Applied the patch allowing top show files only in the filters
Javier I'm not happy that you commit a patch that I have voted "-" on. This has not been approved -- we should have sorted out my concerns. Although you are right that FILE_TYPE_FOLDERS might never be used from within the RSE UI, I think it makes sense to implement it properly from an API point of view. The fix is relatively simple: switch(fileType) { case FILE_TYPE_FOLDERS: if(f.isDirectory() && filematcher.matches(f.getName())) { results.add(f); } break; This will ensure that in case only folders are requested, the name matcher is used; if files and folders are requested, or only files are requested, it always returns any folder name. Reopening to address this concern.
(In reply to comment #8) > Javier I'm not happy that you commit a patch that I have voted "-" on. > This has not been approved -- we should have sorted out my concerns. > > Although you are right that FILE_TYPE_FOLDERS might never be used from within > the RSE UI, I think it makes sense to implement it properly from an API point > of view. The fix is relatively simple: > > switch(fileType) { > case FILE_TYPE_FOLDERS: > if(f.isDirectory() && filematcher.matches(f.getName())) { > results.add(f); > } > break; > > This will ensure that in case only folders are requested, the name matcher is > used; if files and folders are requested, or only files are requested, it > always returns any folder name. The same behaviour is followed by ssh, so folders are never filtered by name. If it makes more sense, I can use org.eclipse.rse.services.files.AbstractFileService.isRightType(int, IHostFile) instead of a custom swtich
Created attachment 74162 [details] Patch using isRightType(fileType, f) Patch replacing the custom switch by isRightType
Created attachment 74169 [details] Patch to filter folders if fileType==FILE_TYPE_FOLDERS Javier, you did not get what I meant -- your new patch is nice because it reduces code but still it always returns all the folders. I meant that if only folders are requested, the pattern matcher should be applied to the folders! Attached patch fixes the issue for both FTP and SSH -- you were right that ssh also did it wrongly. I also verified with DStore. WHen I'm reading the code right, the relevant place is in UniversalFileSystemMiner line 80: if (includeFilesOrFolders != IClientServerConstants.INCLUDE_ALL) match = matcher.matches(name); When not both files and folders are requested (but only folders), then the pattern matcher is always applied, so it also filters the folders, and it does NOT return all the folders. Please read, understand, and commit attached patch.
Dave's -- can you confirm my view of things?
The patch looks good to me.
Patch committed, thanks: [192724] Fixed logic to filter folders if FILE_TYPE_FOLDERS FTPService SftpFileService
Released for I20070723
Verified with I20070724-0735.
Comment on attachment 71596 [details] Patch Javier's Patch was not used.