View | Details | Raw Unified | Return to bug 207178
Collapse All | Expand All

(-)src/org/eclipse/rse/internal/subsystems/files/dstore/DStoreFileAdapter.java (-1 / +4 lines)
Lines 12-18 Link Here
12
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
12
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
13
 * 
13
 * 
14
 * Contributors:
14
 * Contributors:
15
 * {Name} (company) - description of contribution.
15
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
16
 *******************************************************************************/
16
 *******************************************************************************/
17
17
18
package org.eclipse.rse.internal.subsystems.files.dstore;
18
package org.eclipse.rse.internal.subsystems.files.dstore;
Lines 121-124 Link Here
121
			return null;
121
			return null;
122
		}
122
		}
123
	}
123
	}
124
125
126
124
}
127
}
(-)src/org/eclipse/rse/internal/subsystems/files/dstore/DStoreFileSubSystemSearchResultConfiguration.java (-1 / +2 lines)
Lines 16-21 Link Here
16
 * Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem
16
 * Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem
17
 * Kevin Doyle (IBM) - [190010] Added cancel() method that will call the search service to cancel
17
 * Kevin Doyle (IBM) - [190010] Added cancel() method that will call the search service to cancel
18
 * David McKnight   (IBM)        - [190010] performance improvement to use caching for dstore search
18
 * David McKnight   (IBM)        - [190010] performance improvement to use caching for dstore search
19
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
19
 *******************************************************************************/
20
 *******************************************************************************/
20
21
21
package org.eclipse.rse.internal.subsystems.files.dstore;
22
package org.eclipse.rse.internal.subsystems.files.dstore;
Lines 102-108 Link Here
102
							if (parentRemoteFile != null && !parentRemoteFile.hasContents(RemoteChildrenContentsType.getInstance()))
103
							if (parentRemoteFile != null && !parentRemoteFile.hasContents(RemoteChildrenContentsType.getInstance()))
103
							{
104
							{
104
								// query all files to save time (so we can retrieve cached files
105
								// query all files to save time (so we can retrieve cached files
105
								IRemoteFile[] children = _fileSubSystem.listFoldersAndFiles(parentRemoteFile, monitor);
106
								IRemoteFile[] children = _fileSubSystem.list(parentRemoteFile, monitor);
106
								for (int c = 0; c < children.length; c++)
107
								for (int c = 0; c < children.length; c++)
107
								{
108
								{
108
									if (!children[c].isFile())
109
									if (!children[c].isFile())
(-)src/org/eclipse/rse/internal/services/local/files/LocalFileService.java (-5 / +7 lines)
Lines 21-26 Link Here
21
 * Martin Oberhuber (Wind River) - [199394] Allow real files/folders containing String #virtual#
21
 * Martin Oberhuber (Wind River) - [199394] Allow real files/folders containing String #virtual#
22
 * Martin Oberhuber (Wind River) - [199548] Avoid touching files on setReadOnly() if unnecessary
22
 * Martin Oberhuber (Wind River) - [199548] Avoid touching files on setReadOnly() if unnecessary
23
 * Kevin Doyle (IBM) - [199871] LocalFileService needs to implement getMessage()
23
 * Kevin Doyle (IBM) - [199871] LocalFileService needs to implement getMessage()
24
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
24
 ********************************************************************************/
25
 ********************************************************************************/
25
26
26
package org.eclipse.rse.internal.services.local.files;
27
package org.eclipse.rse.internal.services.local.files;
Lines 58-63 Link Here
58
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
59
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
59
import org.eclipse.rse.services.files.AbstractFileService;
60
import org.eclipse.rse.services.files.AbstractFileService;
60
import org.eclipse.rse.services.files.IFileService;
61
import org.eclipse.rse.services.files.IFileService;
62
import org.eclipse.rse.services.files.IFileServiceConstants;
61
import org.eclipse.rse.services.files.IHostFile;
63
import org.eclipse.rse.services.files.IHostFile;
62
import org.eclipse.rse.services.files.RemoteFileException;
64
import org.eclipse.rse.services.files.RemoteFileException;
63
import org.eclipse.rse.services.files.RemoteFileIOException;
65
import org.eclipse.rse.services.files.RemoteFileIOException;
Lines 167-173 Link Here
167
				if (entry.isFile()) {
169
				if (entry.isFile()) {
168
					result = _matcher.matches(name);
170
					result = _matcher.matches(name);
169
				} else if (entry.isDirectory()) {
171
				} else if (entry.isDirectory()) {
170
					if (type == FILE_TYPE_FILES_AND_FOLDERS || type == FILE_TYPE_FOLDERS) {
172
					if (type == IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS || type == IFileServiceConstants.FILE_TYPE_FOLDERS) {
171
						result = true;
173
						result = true;
172
					}
174
					}
173
				}
175
				}
Lines 706-721 Link Here
706
				File file = files[i];
708
				File file = files[i];
707
				if (file.isDirectory())
709
				if (file.isDirectory())
708
				{
710
				{
709
					if (type == FILE_TYPE_FILES_AND_FOLDERS || 
711
					if (type == IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS || 
710
					    type == FILE_TYPE_FOLDERS)
712
					    type == IFileServiceConstants.FILE_TYPE_FOLDERS)
711
					{
713
					{
712
						results.add(new LocalHostFile(file));
714
						results.add(new LocalHostFile(file));
713
					}
715
					}
714
				}
716
				}
715
				else if (file.isFile())
717
				else if (file.isFile())
716
				{
718
				{
717
					if (type == FILE_TYPE_FILES_AND_FOLDERS || 
719
					if (type == IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS || 
718
						type == FILE_TYPE_FILES)
720
						type == IFileServiceConstants.FILE_TYPE_FILES)
719
					{
721
					{
720
						results.add(new LocalHostFile(file));
722
						results.add(new LocalHostFile(file));
721
					}
723
					}
(-)src/org/eclipse/rse/internal/efs/RSEFileStoreImpl.java (-2 / +3 lines)
Lines 23-28 Link Here
23
 * Martin Oberhuber (Wind River) - [197025][197167] Improved wait for model complete
23
 * Martin Oberhuber (Wind River) - [197025][197167] Improved wait for model complete
24
 * Martin Oberhuber (Wind River) - [191589] fix Rename by adding putInfo() for RSE EFS, and fetch symlink info
24
 * Martin Oberhuber (Wind River) - [191589] fix Rename by adding putInfo() for RSE EFS, and fetch symlink info
25
 * Martin Oberhuber (Wind River) - [199552] fix deadlock with dstore-backed efs access
25
 * Martin Oberhuber (Wind River) - [199552] fix deadlock with dstore-backed efs access
26
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
26
 ********************************************************************************/
27
 ********************************************************************************/
27
28
28
package org.eclipse.rse.internal.efs;
29
package org.eclipse.rse.internal.efs;
Lines 357-363 Link Here
357
					children = fileServiceSubSystem.getHostFileToRemoteFileAdapter().convertToRemoteFiles(fileServiceSubSystem, context, remoteFile, results);
358
					children = fileServiceSubSystem.getHostFileToRemoteFileAdapter().convertToRemoteFiles(fileServiceSubSystem, context, remoteFile, results);
358
				}
359
				}
359
				else {
360
				else {
360
					children = subSys.listFoldersAndFiles(remoteFile, "*", monitor); //$NON-NLS-1$
361
					children = subSys.list(remoteFile, monitor); 
361
				}
362
				}
362
				
363
				
363
				names = new String[children.length];
364
				names = new String[children.length];
Lines 432-438 Link Here
432
					children = fileServiceSubSystem.getHostFileToRemoteFileAdapter().convertToRemoteFiles(fileServiceSubSystem, context, remoteFile, results);
433
					children = fileServiceSubSystem.getHostFileToRemoteFileAdapter().convertToRemoteFiles(fileServiceSubSystem, context, remoteFile, results);
433
				}
434
				}
434
				else {
435
				else {
435
					children = subSys.listFoldersAndFiles(remoteFile, "*", monitor); //$NON-NLS-1$
436
					children = subSys.list(remoteFile, monitor); 
436
				}
437
				}
437
				
438
				
438
				infos = new FileInfo[children.length];
439
				infos = new FileInfo[children.length];
(-)src/org/eclipse/rse/shells/ui/view/CommandEntryContentAssistProcessor.java (-2 / +4 lines)
Lines 14-19 Link Here
14
 * Martin Oberhuber (Wind River) - fix 158766: content assist works 1st time only
14
 * Martin Oberhuber (Wind River) - fix 158766: content assist works 1st time only
15
 * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType 
15
 * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType 
16
 * Martin Oberhuber (Wind River) - [174945] Remove obsolete icons from rse.shells.ui
16
 * Martin Oberhuber (Wind River) - [174945] Remove obsolete icons from rse.shells.ui
17
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
17
 ********************************************************************************/
18
 ********************************************************************************/
18
19
19
package org.eclipse.rse.shells.ui.view;
20
package org.eclipse.rse.shells.ui.view;
Lines 36-41 Link Here
36
import org.eclipse.rse.core.subsystems.RemoteChildrenContentsType;
37
import org.eclipse.rse.core.subsystems.RemoteChildrenContentsType;
37
import org.eclipse.rse.internal.shells.ui.ShellsUIPlugin;
38
import org.eclipse.rse.internal.shells.ui.ShellsUIPlugin;
38
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
39
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
40
import org.eclipse.rse.services.files.IFileServiceConstants;
39
import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility;
41
import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility;
40
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
42
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
41
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
43
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
Lines 512-518 Link Here
512
				 }
514
				 }
513
				 else
515
				 else
514
				 {
516
				 {
515
				 	fileList = parent.getParentRemoteFileSubSystem().listFoldersAndFiles(parent, currentText + "*", monitor); //$NON-NLS-1$
517
				 	fileList = parent.getParentRemoteFileSubSystem().list(parent, currentText + "*", IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS, monitor); //$NON-NLS-1$
516
				 }
518
				 }
517
			
519
			
518
520
Lines 569-575 Link Here
569
		 {
571
		 {
570
			 try
572
			 try
571
			 {	
573
			 {	
572
				 fileList = workingDirectory.getParentRemoteFileSubSystem().listFoldersAndFiles(workingDirectory, filterString, null);
574
				 fileList = workingDirectory.getParentRemoteFileSubSystem().list(workingDirectory, filterString, IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS, new NullProgressMonitor());
573
			 }
575
			 }
574
			 catch (SystemMessageException e)
576
			 catch (SystemMessageException e)
575
			 {
577
			 {
(-)src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java (-5 / +9 lines)
Lines 30-35 Link Here
30
 * David McKnight   (IBM)        - [205819] Need to use input stream copy when EFS files are the src
30
 * David McKnight   (IBM)        - [205819] Need to use input stream copy when EFS files are the src
31
 * David McKnight   (IBM)        - [195285] mount path mapper changes
31
 * David McKnight   (IBM)        - [195285] mount path mapper changes
32
 * Kevin Doyle (IBM)	  - [203014] Copy/Paste Across Connections doesn't display Overwrite dialog when folder already exists
32
 * Kevin Doyle (IBM)	  - [203014] Copy/Paste Across Connections doesn't display Overwrite dialog when folder already exists
33
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
33
 ********************************************************************************/
34
 ********************************************************************************/
34
35
35
package org.eclipse.rse.files.ui.resources;
36
package org.eclipse.rse.files.ui.resources;
Lines 404-410 Link Here
404
						tempFolder = getTempFileFor(srcFileOrFolder);
405
						tempFolder = getTempFileFor(srcFileOrFolder);
405
						try
406
						try
406
						{
407
						{
407
							IRemoteFile[] children = srcFS.listFoldersAndFiles(srcFileOrFolder,monitor);
408
							IRemoteFile[] children = srcFS.list(srcFileOrFolder,monitor);
408
							
409
							
409
							
410
							
410
							SystemRemoteResourceSet childSet = new SystemRemoteResourceSet(srcFS, children);
411
							SystemRemoteResourceSet childSet = new SystemRemoteResourceSet(srcFS, children);
Lines 873-879 Link Here
873
				IRemoteFile[] children = null;
874
				IRemoteFile[] children = null;
874
				try
875
				try
875
				{
876
				{
876
					children = srcFS.listFoldersAndFiles(srcFileOrFolder, monitor);
877
					children = srcFS.list(srcFileOrFolder, monitor);
877
				}
878
				}
878
				catch (SystemMessageException e)
879
				catch (SystemMessageException e)
879
				{
880
				{
Lines 1054-1060 Link Here
1054
		SystemRemoteResourceSet existingFiles = null;
1055
		SystemRemoteResourceSet existingFiles = null;
1055
		try
1056
		try
1056
		{
1057
		{
1057
			existingFiles = targetFS.getRemoteFileObjects(newFilePathList, monitor);
1058
			String[] folderAndFilePaths = (String[])newFilePathList.toArray(new String[newFilePathList.size()]);
1059
			IRemoteFile[] results = targetFS.getRemoteFileObjects(folderAndFilePaths, monitor);
1060
			existingFiles = new SystemRemoteResourceSet(targetFS, results);
1058
		}
1061
		}
1059
		catch (Exception e)
1062
		catch (Exception e)
1060
		{
1063
		{
Lines 1251-1257 Link Here
1251
		
1254
		
1252
		try
1255
		try
1253
		{
1256
		{
1254
			resultSet = targetFS.getRemoteFileObjects(newFilePathList, monitor);
1257
			IRemoteFile[] results = targetFS.getRemoteFileObjects((String[])newFilePathList.toArray(new String[newFilePathList.size()]), monitor);
1258
			resultSet = new SystemRemoteResourceSet(targetFS, results);
1255
		}
1259
		}
1256
		catch (Exception e)
1260
		catch (Exception e)
1257
		{
1261
		{
Lines 1760-1766 Link Here
1760
						if (!shouldExtract)
1764
						if (!shouldExtract)
1761
						{
1765
						{
1762
						    // check for empty dir
1766
						    // check for empty dir
1763
						    IRemoteFile[] children = localSS.listFiles(currentSource, monitor);
1767
						    IRemoteFile[] children = localSS.list(currentSource, monitor);
1764
						    
1768
						    
1765
						    if (children == null || children.length == 0)
1769
						    if (children == null || children.length == 0)
1766
						    {
1770
						    {
(-)src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java (-1 / +2 lines)
Lines 32-37 Link Here
32
 * Kevin Doyle (IBM) 			 - [197855] Can't Delete/Rename/Move a Read-Only File
32
 * Kevin Doyle (IBM) 			 - [197855] Can't Delete/Rename/Move a Read-Only File
33
 * Xuan Chen (IBM)        - [202949] [archives] copy a folder from one connection to an archive file in a different connection does not work
33
 * Xuan Chen (IBM)        - [202949] [archives] copy a folder from one connection to an archive file in a different connection does not work
34
 * Kevin Doyle 		(IBM)		 - [204810] Saving file in Eclipse does not update remote file
34
 * Kevin Doyle 		(IBM)		 - [204810] Saving file in Eclipse does not update remote file
35
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
35
 ********************************************************************************/
36
 ********************************************************************************/
36
37
37
package org.eclipse.rse.internal.files.ui.view;
38
package org.eclipse.rse.internal.files.ui.view;
Lines 2243-2249 Link Here
2243
								IRemoteFile newTargetFolder = targetFS.getRemoteFileObject(newPath, monitor);
2244
								IRemoteFile newTargetFolder = targetFS.getRemoteFileObject(newPath, monitor);
2244
								targetFS.createFolder(newTargetFolder, monitor);
2245
								targetFS.createFolder(newTargetFolder, monitor);
2245
2246
2246
								IRemoteFile[] children = localFS.listFoldersAndFiles(srcFileOrFolder, monitor);
2247
								IRemoteFile[] children = localFS.list(srcFileOrFolder, monitor);
2247
								if (children != null)
2248
								if (children != null)
2248
								{
2249
								{
2249
									for (int i = 0; i < children.length; i++)
2250
									for (int i = 0; i < children.length; i++)
(-)src/org/eclipse/rse/internal/files/ui/propertypages/UniversalPreferencePage.java (+4 lines)
Lines 12-17 Link Here
12
 * 
12
 * 
13
 * Contributors:
13
 * Contributors:
14
 * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
14
 * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
15
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
15
 ********************************************************************************/
16
 ********************************************************************************/
16
17
17
package org.eclipse.rse.internal.files.ui.propertypages;
18
package org.eclipse.rse.internal.files.ui.propertypages;
Lines 777-782 Link Here
777
		super.performOk();
778
		super.performOk();
778
		if (modeMappings != null)
779
		if (modeMappings != null)
779
		{
780
		{
781
			IFileEditorMapping[] originalMappingArray = editorRegistry.getFileEditorMappings();
782
			
780
			// first save the transfer mode registry
783
			// first save the transfer mode registry
781
			Object[] array1 = modeMappings.toArray();
784
			Object[] array1 = modeMappings.toArray();
782
			SystemFileTransferModeMapping[] mappingArray1 = new SystemFileTransferModeMapping[array1.length];
785
			SystemFileTransferModeMapping[] mappingArray1 = new SystemFileTransferModeMapping[array1.length];
Lines 799-804 Link Here
799
			((EditorRegistry)editorRegistry).setFileEditorMappings(mappingArray2);
802
			((EditorRegistry)editorRegistry).setFileEditorMappings(mappingArray2);
800
			((EditorRegistry)editorRegistry).saveAssociations();
803
			((EditorRegistry)editorRegistry).saveAssociations();
801
			
804
			
805
			
802
			// editorRegistry.removePropertyListener(this);
806
			// editorRegistry.removePropertyListener(this);
803
			int defaultFileTransferMode = ISystemFilePreferencesConstants.FILETRANSFERMODE_BINARY;
807
			int defaultFileTransferMode = ISystemFilePreferencesConstants.FILETRANSFERMODE_BINARY;
804
			if (defaultBinaryButton.getSelection())
808
			if (defaultBinaryButton.getSelection())
(-)src/org/eclipse/rse/internal/files/ui/actions/SystemCopyRemoteFileAction.java (-1 / +2 lines)
Lines 16-21 Link Here
16
 * Martin Oberhuber (Wind River) - [186128][refactoring] Move IProgressMonitor last in public base classes 
16
 * Martin Oberhuber (Wind River) - [186128][refactoring] Move IProgressMonitor last in public base classes 
17
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
17
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
18
 * Kevin Doyle (IBM) - [196588] Move Dialog doesn't show Archives
18
 * Kevin Doyle (IBM) - [196588] Move Dialog doesn't show Archives
19
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
19
 ********************************************************************************/
20
 ********************************************************************************/
20
21
21
package org.eclipse.rse.internal.files.ui.actions;
22
package org.eclipse.rse.internal.files.ui.actions;
Lines 267-273 Link Here
267
   				
268
   				
268
   				IRemoteFile newTargetFolder = targetFS.getRemoteFileObject(newPath, monitor);
269
   				IRemoteFile newTargetFolder = targetFS.getRemoteFileObject(newPath, monitor);
269
   				targetFS.createFolder(newTargetFolder, monitor);
270
   				targetFS.createFolder(newTargetFolder, monitor);
270
   				IRemoteFile[] children = srcFS.listFoldersAndFiles(srcFileOrFolder, monitor);
271
   				IRemoteFile[] children = srcFS.list(srcFileOrFolder, monitor);
271
   				if (children != null)
272
   				if (children != null)
272
   				{
273
   				{
273
	   				for (int i = 0; i < children.length; i++)
274
	   				for (int i = 0; i < children.length; i++)
(-)src/org/eclipse/rse/internal/subsystems/files/ftp/model/FTPFileAdapter.java (-2 / +3 lines)
Lines 12-18 Link Here
12
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
12
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
13
 * 
13
 * 
14
 * Contributors:
14
 * Contributors:
15
 * {Name} (company) - description of contribution.
15
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
16
 *******************************************************************************/
16
 *******************************************************************************/
17
17
18
package org.eclipse.rse.internal.subsystems.files.ftp.model;
18
package org.eclipse.rse.internal.subsystems.files.ftp.model;
Lines 43-49 Link Here
43
		}
43
		}
44
		return (IRemoteFile[])results.toArray(new IRemoteFile[results.size()]);
44
		return (IRemoteFile[])results.toArray(new IRemoteFile[results.size()]);
45
	}
45
	}
46
46
	
47
	
47
	public IRemoteFile convertToRemoteFile(FileServiceSubSystem ss, IRemoteFileContext context, IRemoteFile parent, String name, boolean isDirectory, boolean isRoot) 
48
	public IRemoteFile convertToRemoteFile(FileServiceSubSystem ss, IRemoteFileContext context, IRemoteFile parent, String name, boolean isDirectory, boolean isRoot) 
48
	{
49
	{
49
		return null;
50
		return null;
(-)src/org/eclipse/rse/subsystems/files/core/subsystems/IRemoteFileSubSystem.java (-45 / +128 lines)
Lines 15-20 Link Here
15
 * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
15
 * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
16
 * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
16
 * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
17
 * Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem
17
 * Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem
18
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
18
 *******************************************************************************/
19
 *******************************************************************************/
19
20
20
package org.eclipse.rse.subsystems.files.core.subsystems;
21
package org.eclipse.rse.subsystems.files.core.subsystems;
Lines 22-31 Link Here
22
import java.io.InputStream;
23
import java.io.InputStream;
23
import java.io.OutputStream;
24
import java.io.OutputStream;
24
import java.net.InetAddress;
25
import java.net.InetAddress;
25
import java.util.List;
26
26
27
import org.eclipse.core.runtime.IProgressMonitor;
27
import org.eclipse.core.runtime.IProgressMonitor;
28
import org.eclipse.rse.core.model.SystemRemoteResourceSet;
29
import org.eclipse.rse.core.subsystems.ISubSystem;
28
import org.eclipse.rse.core.subsystems.ISubSystem;
30
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
29
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
31
import org.eclipse.rse.services.files.RemoteFileException;
30
import org.eclipse.rse.services.files.RemoteFileException;
Lines 106-156 Link Here
106
	 * This version is called directly by users.
105
	 * This version is called directly by users.
107
	 */
106
	 */
108
	public IRemoteFile[] listRoots(IProgressMonitor monitor) throws InterruptedException, SystemMessageException;
107
	public IRemoteFile[] listRoots(IProgressMonitor monitor) throws InterruptedException, SystemMessageException;
108
	
109
	
109
	/**
110
	/**
110
	 * Return a list of all remote folders in the given parent folder on the remote system
111
	 * Return a list of all remote folders and files in the given folder. The list is not subsetted.
111
	 * @param parent The parent folder to list folders in
112
	 * @param parents The parent folders to list folders and files in
112
	 * @param monitor the progress monitor
113
	 * @param fileType - indicates whether to query files, folders, both or some other type
113
	 */
114
	public IRemoteFile[] listFolders(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException;
115
116
	/**
117
	 * Return a full list of remote folders in the given parent folder on the remote system.
118
	 * @param parent The parent folder to list folders in
119
	 * @param fileNameFilter The name pattern for subsetting the file list when this folder is subsequently expanded
120
	 * @param monitor the progress monitor
114
	 * @param monitor the progress monitor
121
	 */
115
	 */
122
	public IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException;
116
	public IRemoteFile[] listMulti(IRemoteFile[] parents, int fileType, IProgressMonitor monitor) throws SystemMessageException;		
123
	
117
	
124
	/**
118
	/**
125
	 * Return a list of all remote files in the given parent folder on the remote system
119
	 * Return a list of remote folders and files in the given folder. Only file names are subsettable
126
	 * @param parent The parent folder to list files in
120
	 * by the given file name filter. It can be null for no subsetting.
121
	 * @param parents The parent folders to list folders and files in
122
	 * @param fileNameFilters The name patterns to subset the file list by, or null to return all files.
123
	 * @param fileType - indicates whether to query files, folders, both or some other type
127
	 * @param monitor the progress monitor
124
	 * @param monitor the progress monitor
128
	 */
125
	 */
129
	public IRemoteFile[] listFiles(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException;
126
	public IRemoteFile[] listMulti(IRemoteFile[] parents, String[] fileNameFilters, int fileType,  IProgressMonitor monitor) throws SystemMessageException;
130
		
127
128
131
	/**
129
	/**
132
	 * Return a list of remote files in the given folder, which match the given name pattern.
130
	 * Return a list of all remote folders and files in the given folder. The list is not subsetted.
133
	 * @param parent The parent folder to list files in
131
	 * @param parent The parent folder to list folders and files in
134
	 * @param fileNameFilter The name pattern to subset the list by, or null to return all files.
135
	 * @param monitor the progress monitor
132
	 * @param monitor the progress monitor
136
	 */
133
	 */
137
	public IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException;
134
	public IRemoteFile[] list(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException;
138
	
135
	
139
	/**
136
	/**
140
	 * Return a list of all remote folders and files in the given folder. The list is not subsetted.
137
	 * Return a list of all remote folders and files in the given folder. The list is not subsetted.
141
	 * @param parent The parent folder to list folders and files in
138
	 * @param parent The parent folder to list folders and files in
139
	 * @param fileType - indicates whether to query files, folders, both or some other type
142
	 * @param monitor the progress monitor
140
	 * @param monitor the progress monitor
143
	 */
141
	 */
144
	public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException;		
142
	public IRemoteFile[] list(IRemoteFile parent, int fileType, IProgressMonitor monitor) throws SystemMessageException;		
145
	
143
	
146
	/**
144
	/**
147
	 * Return a list of remote folders and files in the given folder. Only file names are subsettable
145
	 * Return a list of remote folders and files in the given folder. Only file names are subsettable
148
	 * by the given file name filter. It can be null for no subsetting.
146
	 * by the given file name filter. It can be null for no subsetting.
149
	 * @param parent The parent folder to list folders and files in
147
	 * @param parent The parent folder to list folders and files in
150
	 * @param fileNameFilter The name pattern to subset the file list by, or null to return all files.
148
	 * @param fileNameFilter The name pattern to subset the file list by, or null to return all files.
149
	 * @param fileType - indicates whether to query files, folders, both or some other type
151
	 * @param monitor the progress monitor
150
	 * @param monitor the progress monitor
152
	 */
151
	 */
153
	public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException;
152
	public IRemoteFile[] list(IRemoteFile parent, String fileNameFilter, int fileType,  IProgressMonitor monitor) throws SystemMessageException;
154
153
155
	/**
154
	/**
156
	 * Return a list of remote folders and files in the given folder. 
155
	 * Return a list of remote folders and files in the given folder. 
Lines 161-191 Link Here
161
	 * @param parent The parent folder to list folders and files in
160
	 * @param parent The parent folder to list folders and files in
162
	 * @param fileNameFilter The name pattern to subset the file list by, or null to return all files.
161
	 * @param fileNameFilter The name pattern to subset the file list by, or null to return all files.
163
	 * @param context The holder of state information
162
	 * @param context The holder of state information
163
	 * - indicates whether to query files, folders, both or some other type
164
	 * @param fileType - indicates whether to query files, folders, both or some other type
164
	 * @param monitor the progress monitor
165
	 * @param monitor the progress monitor
165
	 */
166
	public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor) throws SystemMessageException;
167
166
168
	/**
169
	 * Return a subsetted list of remote folders in the given parent folder on the remote system.
170
	 * This version is called by RemoteFileSubSystemImpl's resolveFilterString(s)
171
	 * <b>note</b>This method should be abstract but MOF doesn't allow abstract impl classes at this point
172
	 * @param parent The parent folder to list folders in
173
	 * @param fileNameFilter The name pattern for subsetting the file list when this folder is subsequently expanded
174
	 * @param context The holder of state information
175
	 * @param monitor the progress monitor
176
	 */
167
	 */
177
	public IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor) throws SystemMessageException;
168
	public IRemoteFile[] list(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, int fileType, IProgressMonitor monitor) throws SystemMessageException;
178
169
179
	/**
170
	
180
	 * Return a list of remote files in the given folder, which match the given name pattern.
181
	 * This version is called by RemoteFileSubSystemImpl's resolveFilterString(s)
182
	 * <b>note</b>This method should be abstract but MOF doesn't allow abstract impl classes at this point
183
	 * @param parent The parent folder to list files in
184
	 * @param fileNameFilter The name pattern to subset the list by, or null to return all files.
185
	 * @param context The holder of state information
186
	 * @param monitor the progress monitor
187
	 */
188
	public IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor) throws SystemMessageException;
189
171
190
	/**
172
	/**
191
	 * Given a search configuration, searches for its results.
173
	 * Given a search configuration, searches for its results.
Lines 243-249 Link Here
243
	 * 
225
	 * 
244
	 * @return the set of resources
226
	 * @return the set of resources
245
	 */
227
	 */
246
	public SystemRemoteResourceSet getRemoteFileObjects(List folderOrFileNames, IProgressMonitor monitor) throws SystemMessageException;
228
	public IRemoteFile[] getRemoteFileObjects(String[] folderOrFileNames, IProgressMonitor monitor) throws SystemMessageException;
247
	
229
	
248
	/**
230
	/**
249
	 * Given a fully qualified file or folder name, return an IRemoteFile
231
	 * Given a fully qualified file or folder name, return an IRemoteFile
Lines 570-573 Link Here
570
	 * @since 2.0
552
	 * @since 2.0
571
	 */
553
	 */
572
	public OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor) throws SystemMessageException;
554
	public OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor) throws SystemMessageException;
555
	
556
	/**
557
	 * Return a list of all remote folders in the given parent folder on the remote system
558
	 * @param parent The parent folder to list folders in
559
	 * @param monitor the progress monitor
560
	 * 
561
	 * @deprecated use list
562
	 */
563
	public IRemoteFile[] listFolders(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException;
564
565
	/**
566
	 * Return a full list of remote folders in the given parent folder on the remote system.
567
	 * @param parent The parent folder to list folders in
568
	 * @param fileNameFilter The name pattern for subsetting the file list when this folder is subsequently expanded
569
	 * @param monitor the progress monitor
570
	 * 
571
	 * @deprecated use list
572
	 */
573
	public IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException;
574
	
575
	/**
576
	 * Return a list of all remote files in the given parent folder on the remote system
577
	 * @param parent The parent folder to list files in
578
	 * @param monitor the progress monitor
579
	 * 
580
	 * @deprecated use list
581
	 */
582
	public IRemoteFile[] listFiles(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException;
583
		
584
	/**
585
	 * Return a list of remote files in the given folder, which match the given name pattern.
586
	 * @param parent The parent folder to list files in
587
	 * @param fileNameFilter The name pattern to subset the list by, or null to return all files.
588
	 * @param monitor the progress monitor
589
	 * 
590
	 * @deprecated use list
591
	 */
592
	public IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException;
593
	
594
595
	/**
596
	 * Return a subsetted list of remote folders in the given parent folder on the remote system.
597
	 * This version is called by RemoteFileSubSystemImpl's resolveFilterString(s)
598
	 * <b>note</b>This method should be abstract but MOF doesn't allow abstract impl classes at this point
599
	 * @param parent The parent folder to list folders in
600
	 * @param fileNameFilter The name pattern for subsetting the file list when this folder is subsequently expanded
601
	 * @param context The holder of state information
602
	 * @param monitor the progress monitor
603
	 * 
604
	 * @deprecated use list
605
	 */
606
	public IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor) throws SystemMessageException;
607
608
	/**
609
	 * Return a list of remote files in the given folder, which match the given name pattern.
610
	 * This version is called by RemoteFileSubSystemImpl's resolveFilterString(s)
611
	 * <b>note</b>This method should be abstract but MOF doesn't allow abstract impl classes at this point
612
	 * @param parent The parent folder to list files in
613
	 * @param fileNameFilter The name pattern to subset the list by, or null to return all files.
614
	 * @param context The holder of state information
615
	 * @param monitor the progress monitor
616
	 * 
617
	 * @deprecated use list
618
	 */
619
	public IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor) throws SystemMessageException;
620
621
	/**
622
	 * Return a list of all remote folders and files in the given folder. The list is not subsetted.
623
	 * @param parent The parent folder to list folders and files in
624
	 * @param monitor the progress monitor
625
	 * 
626
	 * @deprecated use list
627
	 */
628
	public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException;		
629
	
630
	/**
631
	 * Return a list of remote folders and files in the given folder. Only file names are subsettable
632
	 * by the given file name filter. It can be null for no subsetting.
633
	 * @param parent The parent folder to list folders and files in
634
	 * @param fileNameFilter The name pattern to subset the file list by, or null to return all files.
635
	 * @param monitor the progress monitor
636
	 * 
637
	 * @deprecated use list
638
	 */
639
	public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException;
640
641
	/**
642
	 * Return a list of remote folders and files in the given folder. 
643
	 * <p>
644
	 * The files part of the list is subsetted by the given file name filter. 
645
	 * It can be null for no subsetting.
646
	 * This version is called by RemoteFileSubSystemImpl's resolveFilterString(s).
647
	 * @param parent The parent folder to list folders and files in
648
	 * @param fileNameFilter The name pattern to subset the file list by, or null to return all files.
649
	 * @param context The holder of state information
650
	 * @param monitor the progress monitor
651
	 * 
652
	 * @deprecated use list
653
	 */
654
	public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor) throws SystemMessageException;
655
573
}
656
}
(-)src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java (-64 / +114 lines)
Lines 20-25 Link Here
20
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
20
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
21
 * David McKnight   (IBM)        - [196664] prevent unnecessary query on the parent
21
 * David McKnight   (IBM)        - [196664] prevent unnecessary query on the parent
22
 * Rupen Mardirossian (IBM)  	 - [204307] listFolders now deals with a null parameter for fileNameFilter preventing NPE
22
 * Rupen Mardirossian (IBM)  	 - [204307] listFolders now deals with a null parameter for fileNameFilter preventing NPE
23
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
23
 *******************************************************************************/
24
 *******************************************************************************/
24
25
25
package org.eclipse.rse.subsystems.files.core.subsystems;
26
package org.eclipse.rse.subsystems.files.core.subsystems;
Lines 37-43 Link Here
37
import java.util.Arrays;
38
import java.util.Arrays;
38
import java.util.HashMap;
39
import java.util.HashMap;
39
import java.util.Iterator;
40
import java.util.Iterator;
40
import java.util.List;
41
import java.util.Vector;
41
import java.util.Vector;
42
42
43
import org.eclipse.core.runtime.IPath;
43
import org.eclipse.core.runtime.IPath;
Lines 51-57 Link Here
51
import org.eclipse.rse.core.model.ISystemMessageObject;
51
import org.eclipse.rse.core.model.ISystemMessageObject;
52
import org.eclipse.rse.core.model.SystemChildrenContentsType;
52
import org.eclipse.rse.core.model.SystemChildrenContentsType;
53
import org.eclipse.rse.core.model.SystemMessageObject;
53
import org.eclipse.rse.core.model.SystemMessageObject;
54
import org.eclipse.rse.core.model.SystemRemoteResourceSet;
55
import org.eclipse.rse.core.subsystems.CommunicationsEvent;
54
import org.eclipse.rse.core.subsystems.CommunicationsEvent;
56
import org.eclipse.rse.core.subsystems.ICommunicationsListener;
55
import org.eclipse.rse.core.subsystems.ICommunicationsListener;
57
import org.eclipse.rse.core.subsystems.IConnectorService;
56
import org.eclipse.rse.core.subsystems.IConnectorService;
Lines 65-70 Link Here
65
import org.eclipse.rse.services.clientserver.NamePatternMatcher;
64
import org.eclipse.rse.services.clientserver.NamePatternMatcher;
66
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
65
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
67
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
66
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
67
import org.eclipse.rse.services.files.IFileServiceConstants;
68
import org.eclipse.rse.services.search.IHostSearchResult;
68
import org.eclipse.rse.services.search.IHostSearchResult;
69
import org.eclipse.rse.services.search.IHostSearchResultConfiguration;
69
import org.eclipse.rse.services.search.IHostSearchResultConfiguration;
70
import org.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString;
70
import org.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString;
Lines 661-677 Link Here
661
					else if (hasFileContents)
661
					else if (hasFileContents)
662
					{
662
					{
663
						// already have the files, now add the folders
663
						// already have the files, now add the folders
664
						listFolders(parent, filter, monitor);						
664
						list(parent, filter, IFileServiceConstants.FILE_TYPE_FOLDERS, monitor);						
665
					}
665
					}
666
					else if (hasFolderContents)
666
					else if (hasFolderContents)
667
					{
667
					{
668
						// already have the folders, now add the files
668
						// already have the folders, now add the files
669
						listFiles(parent, filter, monitor);				
669
						list(parent, filter, IFileServiceConstants.FILE_TYPE_FILES, monitor);				
670
					}
670
					}
671
					else
671
					else
672
					{
672
					{
673
						// don't have anything - query both
673
						// don't have anything - query both
674
						listFoldersAndFiles(parent, filter, monitor);
674
						list(parent, filter, IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS, monitor);
675
					}
675
					}
676
					children = parent.getContents(RemoteChildrenContentsType.getInstance(), filter);
676
					children = parent.getContents(RemoteChildrenContentsType.getInstance(), filter);
677
				}
677
				}
Lines 840-848 Link Here
840
		{
840
		{
841
			if (showDirs && showFiles)
841
			if (showDirs && showFiles)
842
				//children = listFoldersAndFiles((IRemoteFile)parent, filterString);
842
				//children = listFoldersAndFiles((IRemoteFile)parent, filterString);
843
				children = listFoldersAndFiles((IRemoteFile) parent, filterString, monitor);
843
				children = list((IRemoteFile) parent, filterString, IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS, monitor);
844
			else if (showDirs)
844
			else if (showDirs)
845
				children = listFolders((IRemoteFile) parent, filterString, monitor);
845
				children = list((IRemoteFile) parent, filterString, IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS, monitor);
846
			else
846
			else
847
				children = listFiles((IRemoteFile) parent, filterString, monitor);
847
				children = listFiles((IRemoteFile) parent, filterString, monitor);
848
			if (sort && (children != null) && (children.length > 1))
848
			if (sort && (children != null) && (children.length > 1))
Lines 866-934 Link Here
866
		return listRoots(getDefaultContext(), monitor);
866
		return listRoots(getDefaultContext(), monitor);
867
	}
867
	}
868
868
869
870
	/**
871
	 * Return a list of all remote folders in the given parent folder on the remote system
872
	 * @param parent The parent folder to list folders in
873
	 */
874
	public IRemoteFile[] listFolders(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException
875
	{
876
		return listFolders(parent, null, monitor);
877
	}
878
879
	/**
880
	 * Return a full list of remote folders in the given parent folder on the remote system.
881
	 * @param parent The parent folder to list folders in
882
	 * @param fileNameFilter The name pattern for subsetting the file list when this folder is subsequently expanded, or null to return all folders.
883
	 */
884
	public IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
885
	{
886
		fileNameFilter = (fileNameFilter == null) ? "*" : fileNameFilter; //$NON-NLS-1$
887
		RemoteFileFilterString filterString = new RemoteFileFilterString(getParentRemoteFileSubSystemConfiguration());
888
		filterString.setPath(parent.getAbsolutePath());
889
		filterString.setFile(fileNameFilter); 
890
		filterString.setShowFiles(false);
891
		filterString.setShowSubDirs(true);
892
		RemoteFileContext context = new RemoteFileContext(this, parent, filterString);
893
		//return listFolders(parent, fileNameFilter, context);		
894
		return listFolders(parent, fileNameFilter, context, monitor);
895
	}
896
897
	
869
	
898
	/**
870
	/**
899
	 * Return a list of all remote files in the given parent folder on the remote system
871
	 * Return a list of all remote folders and files in the given folder. The list is not subsetted.
900
	 * @param parent The parent folder to list files in
872
	 * @param parents The parent folders to list folders and files in
873
	 * @param fileType - indicates whether to query files, folders, both or some other type
874
	 * @param monitor the progress monitor
901
	 */
875
	 */
902
	public IRemoteFile[] listFiles(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException
876
	public IRemoteFile[] listMulti(IRemoteFile[] parents, int fileType, IProgressMonitor monitor) throws SystemMessageException
903
	{
877
	{
904
		return listFiles(parent, null, monitor);
878
		String[] fileNameFilters = new String[parents.length];
879
		for (int i = 0; i < parents.length; i++)
880
		{
881
			fileNameFilters[i] = "*"; // default filter //$NON-NLS-1$
882
		}
883
		
884
		return listMulti(parents, fileNameFilters, fileType, monitor);
905
	}
885
	}
906
886
	
907
	/**
887
	/**
908
	 * Return a list of remote files in the given folder, which match the given name pattern.
888
	 * Return a list of all remote folders and files in the given folder. The list is not subsetted.
909
	 * @param parent The parent folder to list files in
889
	 * @param parent The parent folder to list folders and files in
910
	 * @param fileNameFilter The name pattern to subset the list by, or null to return all files.
890
	 * @param monitor the progress monitor
911
	 */
891
	 */
912
	public IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
892
	public IRemoteFile[] list(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException
913
	{
893
	{
914
		fileNameFilter = (fileNameFilter == null) ? "*" : fileNameFilter; //$NON-NLS-1$
894
		return list(parent, IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS, monitor);
915
		String parentPath = parent.getAbsolutePath();
916
		IRemoteFileSubSystemConfiguration config = getParentRemoteFileSubSystemConfiguration();
917
		RemoteFileFilterString filterString = new RemoteFileFilterString(config, parentPath, fileNameFilter);
918
		filterString.setShowFiles(true);
919
		filterString.setShowSubDirs(false);
920
		RemoteFileContext context = new RemoteFileContext(this, parent, filterString);
921
		return listFiles(parent, fileNameFilter, context, monitor);
922
	}
895
	}
923
896
	
924
925
	/**
897
	/**
926
	 * Return a list of all remote folders and files in the given folder. The list is not subsetted.
898
	 * Return a list of all remote folders and files in the given folder. The list is not subsetted.
927
	 * @param parent The parent folder to list folders and files in
899
	 * @param parent The parent folder to list folders and files in
900
	 * @param fileType the type of file
901
	 * @param monitor the monitor
928
	 */
902
	 */
929
	public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException
903
	public IRemoteFile[] list(IRemoteFile parent, int fileType, IProgressMonitor monitor) throws SystemMessageException
930
	{
904
	{
931
		return listFoldersAndFiles(parent, (String) null, monitor);
905
		return list(parent, (String) null, fileType, monitor);
932
	}
906
	}
933
907
934
	/**
908
	/**
Lines 938-945 Link Here
938
	 * 
912
	 * 
939
	 * @param parent The parent folder to list folders and files in
913
	 * @param parent The parent folder to list folders and files in
940
	 * @param fileNameFilter The name pattern to subset the file list by, or null to return all files.
914
	 * @param fileNameFilter The name pattern to subset the file list by, or null to return all files.
915
	 * @param fileType the type of file
916
	 * @param monitor the monitor
941
	 */
917
	 */
942
	public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
918
	public IRemoteFile[] list(IRemoteFile parent, String fileNameFilter, int fileType, IProgressMonitor monitor) throws SystemMessageException
943
	{
919
	{
944
		String path = parent.getAbsolutePath();
920
		String path = parent.getAbsolutePath();
945
		fileNameFilter = (fileNameFilter == null) ? "*" : fileNameFilter; //$NON-NLS-1$
921
		fileNameFilter = (fileNameFilter == null) ? "*" : fileNameFilter; //$NON-NLS-1$
Lines 948-955 Link Here
948
		filterString.setShowFiles(true);
924
		filterString.setShowFiles(true);
949
		filterString.setShowSubDirs(true);
925
		filterString.setShowSubDirs(true);
950
		RemoteFileContext context = new RemoteFileContext(this, parent, filterString);
926
		RemoteFileContext context = new RemoteFileContext(this, parent, filterString);
951
		return listFoldersAndFiles(parent, fileNameFilter, context, monitor);
927
		return list(parent, fileNameFilter, context, fileType, monitor);
952
	}
928
	}
929
	
930
953
931
954
	/**
932
	/**
955
	 * Given a folder or file, return its parent folder name, fully qualified
933
	 * Given a folder or file, return its parent folder name, fully qualified
Lines 1013-1026 Link Here
1013
	 * Given a set of fully qualified file or folder names, return an ISystemResourceSet object for it.
991
	 * Given a set of fully qualified file or folder names, return an ISystemResourceSet object for it.
1014
	 * @param folderOrFileNames Fully qualified folder or file names
992
	 * @param folderOrFileNames Fully qualified folder or file names
1015
	 */
993
	 */
1016
	public SystemRemoteResourceSet getRemoteFileObjects(List folderOrFileNames, IProgressMonitor monitor) throws SystemMessageException
994
	public IRemoteFile[] getRemoteFileObjects(String[] folderOrFileNames, IProgressMonitor monitor) throws SystemMessageException
1017
	{
995
	{
1018
		SystemRemoteResourceSet results = new SystemRemoteResourceSet(this);
996
		IRemoteFile[] results = new IRemoteFile[folderOrFileNames.length];
1019
		for (int i = 0; i < folderOrFileNames.size(); i++)
997
		for (int i = 0; i < folderOrFileNames.length; i++)
1020
		{
998
		{
1021
			String path = (String)folderOrFileNames.get(i);
999
			String path = folderOrFileNames[i];
1022
			IRemoteFile nextFile = getRemoteFileObject(path, monitor);
1000
			results[i] = getRemoteFileObject(path, monitor);
1023
			if (nextFile != null) results.addResource(nextFile);
1024
		}
1001
		}
1025
		return results;
1002
		return results;
1026
	}
1003
	}
Lines 1479-1482 Link Here
1479
			return System.getProperty("file.encoding"); //$NON-NLS-1$
1456
			return System.getProperty("file.encoding"); //$NON-NLS-1$
1480
		}
1457
		}
1481
	}
1458
	}
1459
	
1460
	/**
1461
	 * Return a list of all remote folders in the given parent folder on the remote system
1462
	 * @param parent The parent folder to list folders in
1463
	 * 
1464
	 * @deprecated use list
1465
	 */
1466
	public IRemoteFile[] listFolders(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException
1467
	{
1468
		return list(parent, IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS, monitor);
1469
	}
1470
1471
	/**
1472
	 * Return a full list of remote folders in the given parent folder on the remote system.
1473
	 * @param parent The parent folder to list folders in
1474
	 * @param fileNameFilter The name pattern for subsetting the file list when this folder is subsequently expanded, or null to return all folders.
1475
	 * 
1476
	 * @deprecated use list
1477
	 */
1478
	public IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
1479
	{
1480
		return list(parent, fileNameFilter, IFileServiceConstants.FILE_TYPE_FOLDERS,  monitor);
1481
	}
1482
1483
	
1484
	/**
1485
	 * Return a list of all remote files in the given parent folder on the remote system
1486
	 * @param parent The parent folder to list files in
1487
	 * 
1488
	 * @deprecated use list
1489
	 */
1490
	public IRemoteFile[] listFiles(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException
1491
	{
1492
		return list(parent, IFileServiceConstants.FILE_TYPE_FILES, monitor);
1493
	}
1494
1495
	/**
1496
	 * Return a list of remote files in the given folder, which match the given name pattern.
1497
	 * @param parent The parent folder to list files in
1498
	 * @param fileNameFilter The name pattern to subset the list by, or null to return all files.
1499
	 * 
1500
	 * @deprecated use list
1501
	 */
1502
	public IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
1503
	{
1504
		return list(parent, fileNameFilter, IFileServiceConstants.FILE_TYPE_FILES, monitor);
1505
	}
1506
	
1507
	/**
1508
	 * Return a list of all remote folders and files in the given folder. The list is not subsetted.
1509
	 * @param parent The parent folder to list folders and files in
1510
	 * 
1511
	 * @deprecated use list
1512
	 */
1513
	public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException
1514
	{
1515
		return list(parent, monitor);
1516
	}
1517
1518
	/**
1519
	 * Return a list of remote folders and files in the given folder. 
1520
	 * <p>
1521
	 * The files part of the list is subsetted by the given file name filter. It can be null for no subsetting.
1522
	 * 
1523
	 * @param parent The parent folder to list folders and files in
1524
	 * @param fileNameFilter The name pattern to subset the file list by, or null to return all files.
1525
	 * 
1526
	 * @deprecated use list
1527
	 */
1528
	public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
1529
	{
1530
		return list(parent, fileNameFilter, IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS, monitor);
1531
	}
1482
}
1532
}
(-)src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileUniqueName.java (-2 / +2 lines)
Lines 12-18 Link Here
12
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
12
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
13
 * 
13
 * 
14
 * Contributors:
14
 * Contributors:
15
 * {Name} (company) - description of contribution.
15
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
16
 *******************************************************************************/
16
 *******************************************************************************/
17
17
18
package org.eclipse.rse.subsystems.files.core.util;
18
package org.eclipse.rse.subsystems.files.core.util;
Lines 82-88 Link Here
82
		                );  
82
		                );  
83
		try
83
		try
84
		{
84
		{
85
		IRemoteFile[] contents = parentFolder.getParentRemoteFileSubSystem().listFoldersAndFiles(parentFolder, null);
85
		IRemoteFile[] contents = parentFolder.getParentRemoteFileSubSystem().list(parentFolder, null);
86
		if (contents!=null)
86
		if (contents!=null)
87
		{
87
		{
88
		  String[] names = new String[contents.length];
88
		  String[] names = new String[contents.length];
(-)src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java (-84 / +234 lines)
Lines 21-26 Link Here
21
 * Javier Montalvo Orus (Symbian) - [199773] Default file transfer mode is ignored for some file types
21
 * Javier Montalvo Orus (Symbian) - [199773] Default file transfer mode is ignored for some file types
22
 * David McKnight   (IBM)        - [207095] Implicit connect on getRemoteFileObject
22
 * David McKnight   (IBM)        - [207095] Implicit connect on getRemoteFileObject
23
 * David McKnight   (IBM)        - [207100] fire event after upload and download
23
 * David McKnight   (IBM)        - [207100] fire event after upload and download
24
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
24
 *******************************************************************************/
25
 *******************************************************************************/
25
26
26
package org.eclipse.rse.subsystems.files.core.servicesubsystem;
27
package org.eclipse.rse.subsystems.files.core.servicesubsystem;
Lines 28-33 Link Here
28
import java.io.File;
29
import java.io.File;
29
import java.io.InputStream;
30
import java.io.InputStream;
30
import java.io.OutputStream;
31
import java.io.OutputStream;
32
import java.util.ArrayList;
33
import java.util.List;
31
34
32
import org.eclipse.core.runtime.IProgressMonitor;
35
import org.eclipse.core.runtime.IProgressMonitor;
33
import org.eclipse.core.runtime.NullProgressMonitor;
36
import org.eclipse.core.runtime.NullProgressMonitor;
Lines 56-61 Link Here
56
import org.eclipse.rse.subsystems.files.core.subsystems.IHostFileToRemoteFileAdapter;
59
import org.eclipse.rse.subsystems.files.core.subsystems.IHostFileToRemoteFileAdapter;
57
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
60
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
58
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileContext;
61
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileContext;
62
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileContext;
59
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem;
63
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem;
60
import org.eclipse.rse.ui.ISystemMessages;
64
import org.eclipse.rse.ui.ISystemMessages;
61
import org.eclipse.rse.ui.RSEUIPlugin;
65
import org.eclipse.rse.ui.RSEUIPlugin;
Lines 63-68 Link Here
63
67
64
public final class FileServiceSubSystem extends RemoteFileSubSystem implements IFileServiceSubSystem 
68
public final class FileServiceSubSystem extends RemoteFileSubSystem implements IFileServiceSubSystem 
65
{
69
{
70
	
66
	protected ILanguageUtilityFactory _languageUtilityFactory;
71
	protected ILanguageUtilityFactory _languageUtilityFactory;
67
	protected IFileService _hostFileService;
72
	protected IFileService _hostFileService;
68
	protected ISearchService _hostSearchService;
73
	protected ISearchService _hostSearchService;
Lines 153-158 Link Here
153
		return getHostFileToRemoteFileAdapter().convertToRemoteFile(this, getDefaultContext(), parent, node);
158
		return getHostFileToRemoteFileAdapter().convertToRemoteFile(this, getDefaultContext(), parent, node);
154
	}
159
	}
155
160
161
162
	
156
	/**
163
	/**
157
	 * Constructs and returns an IRemoteFile object given a fully-qualified 
164
	 * Constructs and returns an IRemoteFile object given a fully-qualified 
158
	 * file or folder name.
165
	 * file or folder name.
Lines 304-324 Link Here
304
		_userHome = root;
311
		_userHome = root;
305
		return root;
312
		return root;
306
	}
313
	}
307
	
314
	protected IHostFile[] internalList(String parentPath, String fileNameFilter, int fileType, IProgressMonitor monitor) throws SystemMessageException
308
	protected IHostFile[] getFolders(String parentPath, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
309
	{
310
		return getFileService().getFolders(parentPath, fileNameFilter, monitor);
311
	}
312
	
313
	protected IHostFile[] getFiles(String parentPath, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
314
	{
315
	{
315
		return getFileService().getFiles(parentPath, fileNameFilter, monitor);
316
		return getFileService().list(parentPath, fileNameFilter, fileType, monitor);
316
	}
317
	}
317
	
318
	
318
	protected IHostFile[] getFilesAndFolders(String parentPath, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
319
319
	{
320
		return getFileService().getFilesAndFolders(parentPath, fileNameFilter, monitor);
321
	}
322
	
320
	
323
	protected IHostFile getFile(String parentPath, String fileName, IProgressMonitor monitor) throws SystemMessageException
321
	protected IHostFile getFile(String parentPath, String fileName, IProgressMonitor monitor) throws SystemMessageException
324
	{
322
	{
Lines 330-421 Link Here
330
		return getFileService().getRoots(monitor);
328
		return getFileService().getRoots(monitor);
331
	}
329
	}
332
330
333
	/**
331
	public IRemoteFile[] getRemoteFileObjects(String[] folderOrFileNames,
334
	 * Return a list of remote folders and files in the given folder. 
332
			IProgressMonitor monitor) throws SystemMessageException 
335
	 * <p>
336
	 * The files part of the list is subsetted by the given file name filter. 
337
	 * It can be null for no subsetting.
338
	 * This version is called by RemoteFileSubSystemImpl's resolveFilterString(s).
339
	 * @param parent The parent folder to list folders and files in
340
	 * @param fileNameFilter The name pattern to subset the file list by, or null to return all files.
341
	 * @param context The holder of state information
342
	 */
343
	public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor) throws SystemMessageException
344
	{
333
	{
345
		String parentPath = null;
334
		String[] parentPaths = new String[folderOrFileNames.length];
346
		if (parent != null) {
335
		String[] names = new String[folderOrFileNames.length];
347
			parentPath = parent.getAbsolutePath();
336
		String sep = null;		
348
		} else { 
337
		for (int i = 0; i < folderOrFileNames.length; i++)
349
			parentPath = "/"; //$NON-NLS-1$
338
		{
350
		}
339
			String fofName = folderOrFileNames[i];
340
			if (sep == null)
341
				sep = PathUtility.getSeparator(fofName);
342
						
343
			String parentPath = null;
344
			String name = null;
345
			int lastSep = fofName.lastIndexOf(sep);
351
		
346
		
352
		if (parent != null && !parent.canRead())
347
			if (lastSep > -1) 
353
		{
348
			{			
354
			SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FOLDER_UNREADABLE).makeSubstitution(parentPath);
349
				parentPath = fofName.substring(0, lastSep);
355
			throw new SystemMessageException(msg);
350
				
351
				if (parentPath.length() == 0) parentPath = "/"; //$NON-NLS-1$
352
				name = fofName.substring(lastSep + 1, fofName.length());
353
			}
354
			
355
			parentPaths[i] = parentPath;
356
			names[i] = name;
356
		}
357
		}
357
		
358
			
358
		IHostFile[] results = getFilesAndFolders(parentPath, fileNameFilter, monitor); 
359
		RemoteFileContext context = getDefaultContext();
359
360
		IHostFile[] nodes = getFileService().getFileMulti(parentPaths, names, monitor);
360
		IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results);
361
		return getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, null, nodes); 		
361
		if (parent != null)
362
			parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr);
363
		return farr;
364
	}
362
	}
365
363
364
366
	/**
365
	/**
367
	 * Return the array of IRemoteFile instances, matching the given pattern, 
366
	 * Return a list of remote folders and files in the given folder. Only file names are subsettable
368
	 * that are contained in the given folder.
367
	 * by the given file name filter. It can be null for no subsetting.
369
	 * This version is called by RemoteFileSubSystemImpl's resolveFilterString(s)
368
	 * @param parents The parent folders to list folders and files in
370
	 * @param parent The parent folder to list files in
369
	 * @param fileNameFilters The name patterns to subset the file list by, or null to return all files.
371
	 * @param fileNameFilter The name pattern to subset the list by, or null to return all files.
370
	 * @param fileType - indicates whether to query files, folders, both or some other type
372
	 * @param context The holder of state information
371
	 * @param monitor the progress monitor
373
	 */
372
	 */
374
	public IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context,IProgressMonitor monitor) throws SystemMessageException
373
	public IRemoteFile[] listMulti(IRemoteFile[] parents, String[] fileNameFilters, int fileType,  IProgressMonitor monitor) throws SystemMessageException
375
	{
374
	{
376
		String parentPath = null;
375
		String[] parentPaths = new String[parents.length];
377
		if (parent != null) {
376
		for (int i = 0; i < parents.length; i++)
378
			parentPath = parent.getAbsolutePath();
379
		} else {
380
			parentPath = "/"; //$NON-NLS-1$
381
		}
382
		
383
		if (parent != null && !parent.canRead())
384
		{
377
		{
385
			SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FOLDER_UNREADABLE).makeSubstitution(parentPath);
378
			parentPaths[i] = parents[i].getAbsolutePath();
386
			throw new SystemMessageException(msg);
387
		}
379
		}
388
		
380
		
389
		IHostFile[] results = null;
381
		IHostFile[] results = getFileService().listMulti(parentPaths, fileNameFilters, fileType, monitor);
390
		try
382
		RemoteFileContext context = getDefaultContext();
391
		{
383
		
392
			results = getFiles(parentPath, fileNameFilter, monitor);
384
		IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, null, results);
393
		}
385
		
394
		catch (SystemMessageException e)
386
		// caching
387
		for (int i = 0; i < parents.length; i++)
395
		{
388
		{
389
			IRemoteFile parent = parents[i];
390
			String parentPath = parentPaths[i];
391
			String filter = fileNameFilters[i];
396
			
392
			
393
			List underParent = new ArrayList();
394
			// what files are under this one?
395
			for (int j = 0; j < farr.length; j++)
396
			{
397
				IRemoteFile child = farr[j];
398
				String childParentPath = child.getParentPath();
399
				
400
				if (parentPath.equals(childParentPath))
401
				{
402
					underParent.add(child);
403
				}
404
			}
405
			if (underParent.size() > 0)
406
			{
407
				parent.setContents(RemoteChildrenContentsType.getInstance(), filter, underParent.toArray());
408
			}			
397
		}
409
		}
398
		
410
399
		IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results);
400
		
401
		if (parent != null)
402
			parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr);
403
		return farr;
411
		return farr;
404
	}
412
	}
405
413
414
415
	
406
	/**
416
	/**
407
	 * Return a subsetted list of remote folders in the given parent folder on the remote system.
417
	 * Return a list of remote folders and files in the given folder. 
408
	 * This version is called by RemoteFileSubSystemImpl's resolveFilterString(s)
418
	 * <p>
409
	 * @param parent The parent folder to list folders in
419
	 * The files part of the list is subsetted by the given file name filter. 
410
	 * @param fileNameFilter The name pattern for subsetting the file list when this folder is subsequently expanded
420
	 * It can be null for no subsetting.
421
	 * This version is called by RemoteFileSubSystemImpl's resolveFilterString(s).
422
	 * @param parent The parent folder to list folders and files in
423
	 * @param fileNameFilter The name pattern to subset the file list by, or null to return all files.
411
	 * @param context The holder of state information
424
	 * @param context The holder of state information
425
	 * @param fileType the type of file to query
426
	 * @param monitor the progress monitor
412
	 */
427
	 */
413
	public IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor) throws SystemMessageException
428
	public IRemoteFile[] list(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, int fileType, IProgressMonitor monitor) throws SystemMessageException
414
	{
429
	{
415
		String parentPath = null;
430
		String parentPath = null;
416
		if (parent != null) {
431
		if (parent != null) {
417
			parentPath = parent.getAbsolutePath();
432
			parentPath = parent.getAbsolutePath();
418
		} else {
433
		} else { 
419
			parentPath = "/"; //$NON-NLS-1$
434
			parentPath = "/"; //$NON-NLS-1$
420
		}
435
		}
421
		
436
		
Lines 425-444 Link Here
425
			throw new SystemMessageException(msg);
440
			throw new SystemMessageException(msg);
426
		}
441
		}
427
		
442
		
428
		IHostFile[] results = null;
443
		IHostFile[] results = internalList(parentPath, fileNameFilter, fileType, monitor); 
429
		try
444
430
		{
431
			results = getFolders(parentPath, fileNameFilter, monitor);
432
		}
433
		catch (SystemMessageException e)
434
		{			
435
		}
436
		
437
		IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results);
445
		IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results);
438
		if (parent != null)
446
		if (parent != null)
439
			parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr);
447
			parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr);
440
		return farr;
448
		return farr;
441
	}
449
	}
450
451
442
	
452
	
443
	public IRemoteFile[] listRoots(IRemoteFileContext context, IProgressMonitor monitor) throws InterruptedException 
453
	public IRemoteFile[] listRoots(IRemoteFileContext context, IProgressMonitor monitor) throws InterruptedException 
444
	{
454
	{
Lines 830-835 Link Here
830
	 * @see org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem#getOutputStream(java.lang.String, java.lang.String, boolean, org.eclipse.core.runtime.IProgressMonitor)
840
	 * @see org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem#getOutputStream(java.lang.String, java.lang.String, boolean, org.eclipse.core.runtime.IProgressMonitor)
831
	 */
841
	 */
832
	public OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor) throws SystemMessageException {
842
	public OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor) throws SystemMessageException {
833
		return new FileSubSystemOutputStream(getFileService().getOutputStream(remoteParent, remoteFile, isBinary, monitor), remoteParent, remoteFile, this);	
843
		return new FileSubSystemOutputStream(getFileService().getOutputStream(remoteParent, remoteFile, isBinary, monitor), remoteParent, remoteFile, this);			
844
	}
845
	
846
	/**
847
	 * Return the array of IRemoteFile instances, matching the given pattern, 
848
	 * that are contained in the given folder.
849
	 * This version is called by RemoteFileSubSystemImpl's resolveFilterString(s)
850
	 * @param parent The parent folder to list files in
851
	 * @param fileNameFilter The name pattern to subset the list by, or null to return all files.
852
	 * @param context The holder of state information
853
	 * 
854
	 * @deprecated use list
855
	 */
856
	public IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context,IProgressMonitor monitor) throws SystemMessageException
857
	{
858
		String parentPath = null;
859
		if (parent != null) {
860
			parentPath = parent.getAbsolutePath();
861
		} else {
862
			parentPath = "/"; //$NON-NLS-1$
863
		}
864
		
865
		if (parent != null && !parent.canRead())
866
		{
867
			SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FOLDER_UNREADABLE).makeSubstitution(parentPath);
868
			throw new SystemMessageException(msg);
869
		}
870
		
871
		IHostFile[] results = null;
872
		try
873
		{
874
			results = getFiles(parentPath, fileNameFilter, monitor);
875
		}
876
		catch (SystemMessageException e)
877
		{
878
			
879
		}
880
		
881
		IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results);
882
		
883
		if (parent != null)
884
			parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr);
885
		return farr;
886
	}
887
888
	/**
889
	 * Return a subsetted list of remote folders in the given parent folder on the remote system.
890
	 * This version is called by RemoteFileSubSystemImpl's resolveFilterString(s)
891
	 * @param parent The parent folder to list folders in
892
	 * @param fileNameFilter The name pattern for subsetting the file list when this folder is subsequently expanded
893
	 * @param context The holder of state information
894
	 * 
895
	 * @deprecated use list
896
	 */
897
	public IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor) throws SystemMessageException
898
	{
899
		String parentPath = null;
900
		if (parent != null) {
901
			parentPath = parent.getAbsolutePath();
902
		} else {
903
			parentPath = "/"; //$NON-NLS-1$
904
		}
905
		
906
		if (parent != null && !parent.canRead())
907
		{
908
			SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FOLDER_UNREADABLE).makeSubstitution(parentPath);
909
			throw new SystemMessageException(msg);
910
		}
911
		
912
		IHostFile[] results = null;
913
		try
914
		{
915
			results = getFolders(parentPath, fileNameFilter, monitor);
916
		}
917
		catch (SystemMessageException e)
918
		{			
919
		}
920
		
921
		IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results);
922
		if (parent != null)
923
			parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr);
924
		return farr;
925
	}
926
	
927
	/**
928
	 * Return a list of remote folders and files in the given folder. 
929
	 * <p>
930
	 * The files part of the list is subsetted by the given file name filter. 
931
	 * It can be null for no subsetting.
932
	 * This version is called by RemoteFileSubSystemImpl's resolveFilterString(s).
933
	 * @param parent The parent folder to list folders and files in
934
	 * @param fileNameFilter The name pattern to subset the file list by, or null to return all files.
935
	 * @param context The holder of state information
936
	 * 
937
	 * @deprecated use list
938
	 */
939
	public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor) throws SystemMessageException
940
	{
941
		String parentPath = null;
942
		if (parent != null) {
943
			parentPath = parent.getAbsolutePath();
944
		} else { 
945
			parentPath = "/"; //$NON-NLS-1$
946
		}
947
		
948
		if (parent != null && !parent.canRead())
949
		{
950
			SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FOLDER_UNREADABLE).makeSubstitution(parentPath);
951
			throw new SystemMessageException(msg);
952
		}
953
		
954
		IHostFile[] results = getFilesAndFolders(parentPath, fileNameFilter, monitor); 
955
956
		IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results);
957
		if (parent != null)
958
			parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr);
959
		return farr;
960
	}
961
	
962
	/**
963
	 * @deprecated
964
	 */
965
	protected IHostFile[] getFolders(String parentPath, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
966
	{
967
		return getFileService().getFolders(parentPath, fileNameFilter, monitor);
968
	}
969
	
970
	/**
971
	 * @deprecated
972
	 */
973
	protected IHostFile[] getFiles(String parentPath, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
974
	{
975
		return getFileService().getFiles(parentPath, fileNameFilter, monitor);
976
	}
977
	
978
	/**
979
	 * @deprecated
980
	 */
981
	protected IHostFile[] getFilesAndFolders(String parentPath, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
982
	{
983
		return getFileService().getFilesAndFolders(parentPath, fileNameFilter, monitor);
834
	}
984
	}
835
}
985
}
(-)src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java (-1 / +3 lines)
Lines 15-20 Link Here
15
 * Benjamin Muskalla (b.muskalla@gmx.net) - [174690][ssh] cannot delete symbolic links on remote systems
15
 * Benjamin Muskalla (b.muskalla@gmx.net) - [174690][ssh] cannot delete symbolic links on remote systems
16
 * Martin Oberhuber (Wind River) - [203490] Fix NPE in SftpService.getUserHome()
16
 * Martin Oberhuber (Wind River) - [203490] Fix NPE in SftpService.getUserHome()
17
 * Martin Oberhuber (Wind River) - [203500] Support encodings for SSH Sftp paths
17
 * Martin Oberhuber (Wind River) - [203500] Support encodings for SSH Sftp paths
18
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
18
 *******************************************************************************/
19
 *******************************************************************************/
19
20
20
package org.eclipse.rse.internal.services.ssh.files;
21
package org.eclipse.rse.internal.services.ssh.files;
Lines 61-66 Link Here
61
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
62
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
62
import org.eclipse.rse.services.files.AbstractFileService;
63
import org.eclipse.rse.services.files.AbstractFileService;
63
import org.eclipse.rse.services.files.IFileService;
64
import org.eclipse.rse.services.files.IFileService;
65
import org.eclipse.rse.services.files.IFileServiceConstants;
64
import org.eclipse.rse.services.files.IHostFile;
66
import org.eclipse.rse.services.files.IHostFile;
65
import org.eclipse.rse.services.files.RemoteFileCancelledException;
67
import org.eclipse.rse.services.files.RemoteFileCancelledException;
66
import org.eclipse.rse.services.files.RemoteFileIOException;
68
import org.eclipse.rse.services.files.RemoteFileIOException;
Lines 439-445 Link Here
439
			    			//don't show the trivial names
441
			    			//don't show the trivial names
440
			    			continue;
442
			    			continue;
441
			    		}
443
			    		}
442
			    		if (filematcher.matches(fileName) || (lsEntry.getAttrs().isDir() && fileType!=FILE_TYPE_FOLDERS)) {
444
			    		if (filematcher.matches(fileName) || (lsEntry.getAttrs().isDir() && fileType!=IFileServiceConstants.FILE_TYPE_FOLDERS)) {
443
							//get ALL directory names (unless looking for folders only)
445
							//get ALL directory names (unless looking for folders only)
444
			    			SftpHostFile node = makeHostFile(parentPath, fileName, lsEntry.getAttrs());
446
			    			SftpHostFile node = makeHostFile(parentPath, fileName, lsEntry.getAttrs());
445
			    			if (isRightType(fileType, node)) {
447
			    			if (isRightType(fileType, node)) {
(-)src/org/eclipse/rse/internal/services/files/ftp/FTPService.java (-1 / +3 lines)
Lines 64-69 Link Here
64
 * Martin Oberhuber (Wind River) - [203500] Support encodings for FTP paths
64
 * Martin Oberhuber (Wind River) - [203500] Support encodings for FTP paths
65
 * Javier Montalvo Orus (Symbian) - [196351] Delete a folder should do recursive Delete
65
 * Javier Montalvo Orus (Symbian) - [196351] Delete a folder should do recursive Delete
66
 * Javier Montalvo Orus (Symbian) - [187096] Drag&Drop + Copy&Paste shows error message on FTP connection
66
 * Javier Montalvo Orus (Symbian) - [187096] Drag&Drop + Copy&Paste shows error message on FTP connection
67
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
67
 ********************************************************************************/
68
 ********************************************************************************/
68
69
69
package org.eclipse.rse.internal.services.files.ftp;
70
package org.eclipse.rse.internal.services.files.ftp;
Lines 105-110 Link Here
105
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
106
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
106
import org.eclipse.rse.services.files.AbstractFileService;
107
import org.eclipse.rse.services.files.AbstractFileService;
107
import org.eclipse.rse.services.files.IFileService;
108
import org.eclipse.rse.services.files.IFileService;
109
import org.eclipse.rse.services.files.IFileServiceConstants;
108
import org.eclipse.rse.services.files.IHostFile;
110
import org.eclipse.rse.services.files.IHostFile;
109
import org.eclipse.rse.services.files.RemoteFileCancelledException;
111
import org.eclipse.rse.services.files.RemoteFileCancelledException;
110
import org.eclipse.rse.services.files.RemoteFileIOException;
112
import org.eclipse.rse.services.files.RemoteFileIOException;
Lines 710-716 Link Here
710
							if (name.equals(".") || name.equals("..")) { //$NON-NLS-1$ //$NON-NLS-2$
712
							if (name.equals(".") || name.equals("..")) { //$NON-NLS-1$ //$NON-NLS-2$
711
								//Never return the default directory names
713
								//Never return the default directory names
712
								continue;
714
								continue;
713
							} else if (f.isDirectory() && fileType!=FILE_TYPE_FOLDERS) {
715
							} else if (f.isDirectory() && fileType!=IFileServiceConstants.FILE_TYPE_FOLDERS) {
714
								//get ALL directory names (unless looking for folders only)
716
								//get ALL directory names (unless looking for folders only)
715
								results.add(f);
717
								results.add(f);
716
							} else if (filematcher.matches(name)) { 
718
							} else if (filematcher.matches(name)) { 
(-)src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java (-9 / +77 lines)
Lines 21-26 Link Here
21
 * Xuan Chen        (IBM)        - [202670] [Supertransfer] After doing a copy to a directory that contains folders some folders name's display "deleted"
21
 * Xuan Chen        (IBM)        - [202670] [Supertransfer] After doing a copy to a directory that contains folders some folders name's display "deleted"
22
 * Xuan Chen        (IBM)        - [190824] Incorrect result for DStore#getSeparator() function when parent is "/" 
22
 * Xuan Chen        (IBM)        - [190824] Incorrect result for DStore#getSeparator() function when parent is "/" 
23
 * David McKnight   (IBM)        - [207095] check for null datastore 
23
 * David McKnight   (IBM)        - [207095] check for null datastore 
24
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
24
 ********************************************************************************/
25
 ********************************************************************************/
25
26
26
package org.eclipse.rse.internal.services.dstore.files;
27
package org.eclipse.rse.internal.services.dstore.files;
Lines 64-69 Link Here
64
import org.eclipse.rse.services.dstore.util.DownloadListener;
65
import org.eclipse.rse.services.dstore.util.DownloadListener;
65
import org.eclipse.rse.services.dstore.util.FileSystemMessageUtil;
66
import org.eclipse.rse.services.dstore.util.FileSystemMessageUtil;
66
import org.eclipse.rse.services.files.IFileService;
67
import org.eclipse.rse.services.files.IFileService;
68
import org.eclipse.rse.services.files.IFileServiceConstants;
67
import org.eclipse.rse.services.files.IHostFile;
69
import org.eclipse.rse.services.files.IHostFile;
68
import org.eclipse.rse.services.files.RemoteFileSecurityException;
70
import org.eclipse.rse.services.files.RemoteFileSecurityException;
69
71
Lines 811-816 Link Here
811
			return null;
813
			return null;
812
		}
814
		}
813
	}
815
	}
816
	
817
	public IHostFile[] getFileMulti(String remoteParents[], String names[], IProgressMonitor monitor) 
818
		throws SystemMessageException
819
	{
820
		// TODO optimize dstore version of this to do mass queries then wait for last status
821
		List results = new ArrayList();
822
		for (int i = 0; i < remoteParents.length; i++)
823
		{
824
			results.add(getFile(remoteParents[i], names[i], monitor));
825
		}
826
		return (IHostFile[])results.toArray(new IHostFile[results.size()]);
827
	}
814
828
815
	/**
829
	/**
816
	 * Returns what the next part of the path should be, given the current
830
	 * Returns what the next part of the path should be, given the current
Lines 1291-1311 Link Here
1291
	
1305
	
1292
	
1306
	
1293
1307
1294
	
1308
	public IHostFile[] list(String remoteParent, String fileFilter, int fileType, IProgressMonitor monitor)
1295
	public IHostFile[] getFolders(String remoteParent, String fileFilter, IProgressMonitor monitor)
1296
	{
1309
	{
1297
		return fetch(remoteParent, fileFilter, IUniversalDataStoreConstants.C_QUERY_VIEW_FOLDERS, monitor);
1310
		String queryString = null;
1311
		switch (fileType)
1312
		{
1313
		case IFileServiceConstants.FILE_TYPE_FILES:
1314
			queryString = IUniversalDataStoreConstants.C_QUERY_VIEW_FILES;
1315
			break;
1316
			
1317
		case IFileServiceConstants.FILE_TYPE_FOLDERS:
1318
			queryString = IUniversalDataStoreConstants.C_QUERY_VIEW_FOLDERS;
1319
			break;
1320
			
1321
		case IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS:
1322
		default:				
1323
			queryString = IUniversalDataStoreConstants.C_QUERY_VIEW_ALL;
1324
			break;
1325
		}
1326
		
1327
		return fetch(remoteParent, fileFilter, queryString, monitor);
1298
	}
1328
	}
1329
1299
	
1330
	
1300
	public IHostFile[] getFiles(String remoteParent, String fileFilter, IProgressMonitor monitor)
1331
	public IHostFile[] listMulti(String[] remoteParents,
1332
			String[] fileFilters, int fileType, IProgressMonitor monitor)
1333
			throws SystemMessageException 
1301
	{
1334
	{
1302
		return fetch(remoteParent, fileFilter, IUniversalDataStoreConstants.C_QUERY_VIEW_FILES, monitor);
1335
		// TODO - optimize dstore implementation to do mass queries then wait for last result
1336
		
1337
		
1338
		List files = new ArrayList();
1339
		for (int i = 0; i < remoteParents.length; i++)
1340
		{
1341
			IHostFile[] result = list(remoteParents[i], fileFilters[i], fileType, monitor);
1342
			for (int j = 0; j < result.length; j++)
1343
			{
1344
				files.add(result[j]);
1345
			}
1346
		}
1347
		
1348
		return (IHostFile[])files.toArray(new IHostFile[files.size()]);
1303
	}
1349
	}
1304
	
1350
	
1305
	public IHostFile[] getFilesAndFolders(String remoteParent, String fileFilter, IProgressMonitor monitor)
1306
	{
1307
		return fetch(remoteParent, fileFilter, IUniversalDataStoreConstants.C_QUERY_VIEW_ALL, monitor);
1308
	}
1309
	
1351
	
1310
	protected DataElement getElementFor(String path)
1352
	protected DataElement getElementFor(String path)
1311
	{
1353
	{
Lines 1503-1506 Link Here
1503
	public void setIsUnixStyle(boolean isUnixStyle) {
1545
	public void setIsUnixStyle(boolean isUnixStyle) {
1504
		this.unixStyle = isUnixStyle;
1546
		this.unixStyle = isUnixStyle;
1505
	}
1547
	}
1548
	
1549
1550
	
1551
	/**
1552
	 * Deprecated
1553
	 */
1554
	public IHostFile[] getFolders(String remoteParent, String fileFilter, IProgressMonitor monitor)
1555
	{
1556
		return fetch(remoteParent, fileFilter, IUniversalDataStoreConstants.C_QUERY_VIEW_FOLDERS, monitor);
1557
	}
1558
	
1559
	/**
1560
	 * Deprecated
1561
	 */
1562
	public IHostFile[] getFiles(String remoteParent, String fileFilter, IProgressMonitor monitor)
1563
	{
1564
		return fetch(remoteParent, fileFilter, IUniversalDataStoreConstants.C_QUERY_VIEW_FILES, monitor);
1565
	}
1566
	
1567
	/**
1568
	 * Deprecated
1569
	 */
1570
	public IHostFile[] getFilesAndFolders(String remoteParent, String fileFilter, IProgressMonitor monitor)
1571
	{
1572
		return fetch(remoteParent, fileFilter, IUniversalDataStoreConstants.C_QUERY_VIEW_ALL, monitor);
1573
	}
1506
}
1574
}
(-)miners/org/eclipse/rse/internal/dstore/universal/miners/command/OutputHandler.java (-11 / +8 lines)
Lines 12-18 Link Here
12
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
12
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
13
 * 
13
 * 
14
 * Contributors:
14
 * Contributors:
15
 * {Name} (company) - description of contribution.
15
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
16
 *******************************************************************************/
16
 *******************************************************************************/
17
17
18
package org.eclipse.rse.internal.dstore.universal.miners.command;
18
package org.eclipse.rse.internal.dstore.universal.miners.command;
Lines 210-216 Link Here
210
						// output
210
						// output
211
						// the delimiters are therefore set to "\n\r"
211
						// the delimiters are therefore set to "\n\r"
212
						StringTokenizer tokenizer = new StringTokenizer(
212
						StringTokenizer tokenizer = new StringTokenizer(
213
								fullOutput, "\n\r"); //$NON-NLS-1$
213
								fullOutput, "\n\r");
214
						int numTokens = tokenizer.countTokens();
214
						int numTokens = tokenizer.countTokens();
215
						output = new String[numTokens];
215
						output = new String[numTokens];
216
						int index = 0;
216
						int index = 0;
Lines 220-228 Link Here
220
						}
220
						}
221
221
222
						String lastLine = output[index - 1];
222
						String lastLine = output[index - 1];
223
223
						if (!_endOfStream && (!fullOutput.endsWith("\n") && !fullOutput.endsWith("\r")))
224
						if (!_endOfStream && 
225
								(!fullOutput.endsWith("\n") && !fullOutput.endsWith("\r"))) //$NON-NLS-1$ //$NON-NLS-2$
226
						{
224
						{
227
							// our last line may be cut off		
225
							// our last line may be cut off		
228
							byte[] lastBytes = new byte[MAX_OFFSET];
226
							byte[] lastBytes = new byte[MAX_OFFSET];
Lines 252-261 Link Here
252
									else
250
									else
253
									{
251
									{
254
										lastBytes[lastIndex] = (byte)c;
252
										lastBytes[lastIndex] = (byte)c;
255
																
253
																	
256
										
257
										// check for end of line
254
										// check for end of line
258
										String suffix = new String(lastBytes, 0, lastIndex + 1, encoding);		
255
										String suffix = new String(lastBytes, 0, lastIndex + 1, encoding);
259
										int rBreak = suffix.indexOf("\r");
256
										int rBreak = suffix.indexOf("\r");
260
										int nBreak = suffix.indexOf("\n");
257
										int nBreak = suffix.indexOf("\n");
261
										if (nBreak != -1 || rBreak != -1) 
258
										if (nBreak != -1 || rBreak != -1) 
Lines 276-290 Link Here
276
						return output;
273
						return output;
277
					}
274
					}
278
				} catch (Exception e) {
275
				} catch (Exception e) {
276
					e.printStackTrace();
279
				}
277
				}
280
			}
278
			}
281
		} catch (Exception e) {
279
		} catch (Exception e) {
282
280
			e.printStackTrace();
283
		}
281
		}
284
		return output;
282
		return output;
285
	}
283
	}
286
284
	
287
288
	public synchronized void waitForInput() {
285
	public synchronized void waitForInput() {
289
		try {
286
		try {
290
			Thread.sleep(100);
287
			Thread.sleep(100);
(-)src/org/eclipse/rse/internal/importexport/files/UniFilePlus.java (-5 / +6 lines)
Lines 9-14 Link Here
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
10
 * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
11
 * Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem
11
 * Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem
12
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
12
 *******************************************************************************/
13
 *******************************************************************************/
13
package org.eclipse.rse.internal.importexport.files;
14
package org.eclipse.rse.internal.importexport.files;
14
15
Lines 195-201 Link Here
195
	public IRemoteFile[] listIRemoteFiles() {
196
	public IRemoteFile[] listIRemoteFiles() {
196
		IRemoteFile[] result = null;
197
		IRemoteFile[] result = null;
197
		try {
198
		try {
198
			result = remoteFile.getParentRemoteFileSubSystem().listFoldersAndFiles(remoteFile, getNullMonitor());
199
			result = remoteFile.getParentRemoteFileSubSystem().list(remoteFile, getNullMonitor());
199
		} catch (SystemMessageException e) {
200
		} catch (SystemMessageException e) {
200
			SystemBasePlugin.logError("unexpected exception", e); //$NON-NLS-1$
201
			SystemBasePlugin.logError("unexpected exception", e); //$NON-NLS-1$
201
		}
202
		}
Lines 205-211 Link Here
205
	public String[] list() {
206
	public String[] list() {
206
		IRemoteFile[] files = null;
207
		IRemoteFile[] files = null;
207
		try {
208
		try {
208
			files = remoteFile.getParentRemoteFileSubSystem().listFoldersAndFiles(remoteFile, getNullMonitor());
209
			files = remoteFile.getParentRemoteFileSubSystem().list(remoteFile, getNullMonitor());
209
		} catch (SystemMessageException e) {
210
		} catch (SystemMessageException e) {
210
			SystemBasePlugin.logError("unexpected exception", e); //$NON-NLS-1$
211
			SystemBasePlugin.logError("unexpected exception", e); //$NON-NLS-1$
211
		}
212
		}
Lines 221-227 Link Here
221
	public String[] list(FilenameFilter filter) {
222
	public String[] list(FilenameFilter filter) {
222
		IRemoteFile[] files = null;
223
		IRemoteFile[] files = null;
223
		try {
224
		try {
224
			files = remoteFile.getParentRemoteFileSubSystem().listFoldersAndFiles(remoteFile, getNullMonitor());
225
			files = remoteFile.getParentRemoteFileSubSystem().list(remoteFile, getNullMonitor());
225
		} catch (SystemMessageException e) {
226
		} catch (SystemMessageException e) {
226
			SystemBasePlugin.logError("unexpected exception", e); //$NON-NLS-1$
227
			SystemBasePlugin.logError("unexpected exception", e); //$NON-NLS-1$
227
		}
228
		}
Lines 243-249 Link Here
243
	public File[] listFiles(FileFilter filter) {
244
	public File[] listFiles(FileFilter filter) {
244
		IRemoteFile[] files = null;
245
		IRemoteFile[] files = null;
245
		try {
246
		try {
246
			files = remoteFile.getParentRemoteFileSubSystem().listFoldersAndFiles(remoteFile, getNullMonitor());
247
			files = remoteFile.getParentRemoteFileSubSystem().list(remoteFile, getNullMonitor());
247
		} catch (SystemMessageException e) {
248
		} catch (SystemMessageException e) {
248
			SystemBasePlugin.logError("unexpected exception", e); //$NON-NLS-1$
249
			SystemBasePlugin.logError("unexpected exception", e); //$NON-NLS-1$
249
		}
250
		}
Lines 265-271 Link Here
265
	public File[] listFiles(FilenameFilter filter) {
266
	public File[] listFiles(FilenameFilter filter) {
266
		IRemoteFile[] files = null;
267
		IRemoteFile[] files = null;
267
		try {
268
		try {
268
			files = remoteFile.getParentRemoteFileSubSystem().listFoldersAndFiles(remoteFile, getNullMonitor());
269
			files = remoteFile.getParentRemoteFileSubSystem().list(remoteFile, getNullMonitor());
269
		} catch (SystemMessageException e) {
270
		} catch (SystemMessageException e) {
270
			SystemBasePlugin.logError("unexpected exception", e); //$NON-NLS-1$
271
			SystemBasePlugin.logError("unexpected exception", e); //$NON-NLS-1$
271
		}
272
		}
(-)src/org/eclipse/rse/tests/core/connection/RSEBaseConnectionTestCase.java (-1 / +3 lines)
Lines 10-15 Link Here
10
 * Uwe Stieber (Wind River) - refactoring and cleanup.
10
 * Uwe Stieber (Wind River) - refactoring and cleanup.
11
 * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
11
 * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
12
 * Xuan Chen (IBM)               - [198859] Update the API doc for getRemoteSystemConnection.
12
 * Xuan Chen (IBM)               - [198859] Update the API doc for getRemoteSystemConnection.
13
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
13
 ********************************************************************************/
14
 ********************************************************************************/
14
package org.eclipse.rse.tests.core.connection;
15
package org.eclipse.rse.tests.core.connection;
15
16
Lines 106-112 Link Here
106
		properties.setProperty(IRSEConnectionProperties.ATTR_ADDRESS, systemAddress); //$NON-NLS-1$
107
		properties.setProperty(IRSEConnectionProperties.ATTR_ADDRESS, systemAddress); //$NON-NLS-1$
107
		properties.setProperty(IRSEConnectionProperties.ATTR_NAME, systemName); //$NON-NLS-1$
108
		properties.setProperty(IRSEConnectionProperties.ATTR_NAME, systemName); //$NON-NLS-1$
108
		properties.setProperty(IRSEConnectionProperties.ATTR_USERID, userID); //$NON-NLS-1$
109
		properties.setProperty(IRSEConnectionProperties.ATTR_USERID, userID); //$NON-NLS-1$
109
		properties.setProperty(IRSEConnectionProperties.ATTR_PASSWORD, password); //$NON-NLS-1$
110
		if (password != null)
111
			properties.setProperty(IRSEConnectionProperties.ATTR_PASSWORD, password); //$NON-NLS-1$
110
		
112
		
111
		IRSEConnectionProperties remoteSystemConnectionProperties;
113
		IRSEConnectionProperties remoteSystemConnectionProperties;
112
		remoteSystemConnectionProperties = getConnectionManager().loadConnectionProperties(properties, false);
114
		remoteSystemConnectionProperties = getConnectionManager().loadConnectionProperties(properties, false);
(-)src/org/eclipse/rse/services/files/AbstractFileService.java (-19 / +60 lines)
Lines 12-23 Link Here
12
 * 
12
 * 
13
 * Contributors:
13
 * Contributors:
14
 * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
14
 * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
15
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
15
 ********************************************************************************/
16
 ********************************************************************************/
16
17
17
package org.eclipse.rse.services.files;
18
package org.eclipse.rse.services.files;
18
19
19
import java.io.InputStream;
20
import java.io.InputStream;
20
import java.io.OutputStream;
21
import java.io.OutputStream;
22
import java.util.ArrayList;
23
import java.util.List;
21
24
22
import org.eclipse.core.runtime.IProgressMonitor;
25
import org.eclipse.core.runtime.IProgressMonitor;
23
26
Lines 28-62 Link Here
28
public abstract class AbstractFileService implements IFileService
31
public abstract class AbstractFileService implements IFileService
29
{
32
{
30
33
31
	public static final int FILE_TYPE_FILES_AND_FOLDERS = 0;
34
	protected abstract IHostFile[] internalFetch(String parentPath, String fileFilter, int fileType, IProgressMonitor monitor) throws SystemMessageException;
32
	public static final int FILE_TYPE_FILES = 1;
35
	
33
	public static final int FILE_TYPE_FOLDERS = 2;
36
	public IHostFile[] getFileMulti(String remoteParents[], String names[], IProgressMonitor monitor) 
34
 
37
								throws SystemMessageException
35
	public IHostFile[] getFiles(String remoteParent, String fileFilter, IProgressMonitor monitor) throws SystemMessageException 
36
	{
38
	{
37
		return internalFetch(remoteParent, fileFilter, FILE_TYPE_FILES, monitor);
39
		List results = new ArrayList();
40
		for (int i = 0; i < remoteParents.length; i++)
41
		{
42
			results.add(getFile(remoteParents[i], names[i], monitor));
43
		}
44
		return (IHostFile[])results.toArray(new IHostFile[results.size()]);
38
	}
45
	}
39
46
40
	public IHostFile[] getFolders(String remoteParent, String fileFilter, IProgressMonitor monitor) throws SystemMessageException 
47
	public IHostFile[] list(String remoteParent, String fileFilter, 
48
			int fileType, IProgressMonitor monitor) throws SystemMessageException
41
	{
49
	{
42
		return internalFetch(remoteParent, fileFilter, FILE_TYPE_FOLDERS, monitor);
50
		return internalFetch(remoteParent, fileFilter, fileType, monitor);
43
	}
51
	}
44
	
52
	
45
	public IHostFile[] getFilesAndFolders(String parentPath, String fileFilter, IProgressMonitor monitor) throws SystemMessageException
53
	public IHostFile[] listMulti(String[] remoteParents,
46
	{
54
			String[] fileFilters, int fileType, IProgressMonitor monitor)
47
		return internalFetch(parentPath, fileFilter, FILE_TYPE_FILES_AND_FOLDERS, monitor);
55
			throws SystemMessageException {
56
57
		List files = new ArrayList();
58
		for (int i = 0; i < remoteParents.length; i++)
59
		{
60
			IHostFile[] result = list(remoteParents[i], fileFilters[i], fileType, monitor);
61
			for (int j = 0; j < result.length; j++)
62
			{
63
				files.add(result[j]);
64
			}
65
		}
66
		
67
		return (IHostFile[])files.toArray(new IHostFile[files.size()]);
48
	}
68
	}
49
	
69
50
	protected abstract IHostFile[] internalFetch(String parentPath, String fileFilter, int fileType, IProgressMonitor monitor) throws SystemMessageException;
51
	
52
	
53
	protected boolean isRightType(int fileType, IHostFile node)
70
	protected boolean isRightType(int fileType, IHostFile node)
54
	{
71
	{
55
		switch (fileType)
72
		switch (fileType)
56
		{
73
		{
57
		case FILE_TYPE_FILES_AND_FOLDERS:
74
		case IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS:
58
			return true;
75
			return true;
59
		case FILE_TYPE_FILES:
76
		case IFileServiceConstants.FILE_TYPE_FILES:
60
			if (node.isFile())
77
			if (node.isFile())
61
			{
78
			{
62
				return true;			
79
				return true;			
Lines 65-71 Link Here
65
			{
82
			{
66
				return false;
83
				return false;
67
			}				
84
			}				
68
		case FILE_TYPE_FOLDERS:
85
		case IFileServiceConstants.FILE_TYPE_FOLDERS:
69
			if (node.isDirectory())
86
			if (node.isDirectory())
70
			{
87
			{
71
				return true;
88
				return true;
Lines 76-82 Link Here
76
			}
93
			}
77
			default:
94
			default:
78
				return true;
95
				return true;
79
		}
96
		} 
80
	}
97
	}
81
	
98
	
82
	/**
99
	/**
Lines 121-124 Link Here
121
	public OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor) throws SystemMessageException {
138
	public OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor) throws SystemMessageException {
122
		return null;
139
		return null;
123
	}
140
	}
141
	
142
	/**
143
	 * @deprecated
144
	 */
145
	public IHostFile[] getFiles(String remoteParent, String fileFilter, IProgressMonitor monitor) throws SystemMessageException 
146
	{
147
		return internalFetch(remoteParent, fileFilter, IFileServiceConstants.FILE_TYPE_FILES, monitor);
148
	}
149
150
	/**
151
	 * @deprecated
152
	 */
153
	public IHostFile[] getFolders(String remoteParent, String fileFilter, IProgressMonitor monitor) throws SystemMessageException 
154
	{
155
		return internalFetch(remoteParent, fileFilter, IFileServiceConstants.FILE_TYPE_FOLDERS, monitor);
156
	}
157
	
158
	/**
159
	 * @deprecated
160
	 */
161
	public IHostFile[] getFilesAndFolders(String parentPath, String fileFilter, IProgressMonitor monitor) throws SystemMessageException
162
	{
163
		return internalFetch(parentPath, fileFilter, IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS, monitor);
164
	}
124
}
165
}
(-)src/org/eclipse/rse/services/files/IFileService.java (-15 / +72 lines)
Lines 15-20 Link Here
15
 * Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem
15
 * Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem
16
 * Martin Oberhuber (Wind River) - [199548] Avoid touching files on setReadOnly() if unnecessary
16
 * Martin Oberhuber (Wind River) - [199548] Avoid touching files on setReadOnly() if unnecessary
17
 * Martin Oberhuber (Wind River) - [204710] Update Javadoc to mention that getUserHome() may return null
17
 * Martin Oberhuber (Wind River) - [204710] Update Javadoc to mention that getUserHome() may return null
18
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
18
 ********************************************************************************/
19
 ********************************************************************************/
19
20
20
package org.eclipse.rse.services.files;
21
package org.eclipse.rse.services.files;
Lines 105-149 Link Here
105
	 */
106
	 */
106
	public IHostFile getFile(String remoteParent, String name, IProgressMonitor monitor) throws SystemMessageException;
107
	public IHostFile getFile(String remoteParent, String name, IProgressMonitor monitor) throws SystemMessageException;
107
	
108
	
109
	
108
	/**
110
	/**
109
	 * @param remoteParent - the name of the parent directory on the remote file 
111
	 * @param remoteParent - the name of the parent directory on the remote file 
110
	 * system from which to retrieve the child list.
112
	 * system from which to retrieve the child list.
111
	 * @param fileFilter - a string that can be used to filter the children.  Only
113
	 * @param fileFilter - a string that can be used to filter the children.  Only
112
	 * those files matching the filter make it into the list.  The interface 
114
	 * those files matching the filter make it into the list.  The interface 
113
	 * does not dictate where the filtering occurs.
115
	 * does not dictate where the filtering occurs.
116
	 * @param fileType - indicates whether to query files, folders, both or some other type
114
	 * @param monitor the monitor for this potentially long running operation
117
	 * @param monitor the monitor for this potentially long running operation
115
	 * @return the list of host files. 
118
	 * @return the list of host files. 
116
	 * @throws SystemMessageException if an error occurs. 
119
	 * @throws SystemMessageException if an error occurs. 
117
	 * Typically this would be one of those in the RemoteFileException family.
120
	 * Typically this would be one of those in the RemoteFileException family.
121
	 * 
118
	 */
122
	 */
119
	public IHostFile[] getFilesAndFolders(String remoteParent, String fileFilter, IProgressMonitor monitor) throws SystemMessageException;
123
	public IHostFile[] list(String remoteParent, String fileFilter, int fileType, IProgressMonitor monitor) throws SystemMessageException;
120
  
124
  
125
	
126
127
	
128
	
121
	/**
129
	/**
122
	 * @param remoteParent - the name of the parent directory on the remote file 
130
	 * @param remoteParents - the list of remote parents
123
	 * system from which to retrieve the child list.
131
	 * @param names - the list of file names
124
	 * @param fileFilter - a string that can be used to filter the children.  Only
125
	 * those files matching the filter make it into the list.  The interface 
126
	 * does not dictate where the filtering occurs.
127
	 * @param monitor the monitor for this potentially long running operation
132
	 * @param monitor the monitor for this potentially long running operation
128
	 * @return the list of host files. 
133
	 * @return the host files given the parent paths and file names.  This is basically a batch version of getFile().
134
	 *     Must not return <code>null</code>, non-existing files should be
135
	 *     reported with an IHostFile object where {@link IHostFile#exists()}
136
	 *     returns <code>false</code>.
129
	 * @throws SystemMessageException if an error occurs. 
137
	 * @throws SystemMessageException if an error occurs. 
130
	 * Typically this would be one of those in the RemoteFileException family.
138
	 * Typically this would be one of those in the RemoteFileException family.
131
	 */
139
	 */
132
	public IHostFile[] getFiles(String remoteParent, String fileFilter, IProgressMonitor monitor) throws SystemMessageException;
140
	public IHostFile[] getFileMulti(String remoteParents[], String names[], IProgressMonitor monitor) throws SystemMessageException;
133
  
141
	
134
	/**
142
	/**
135
	 * @param remoteParent - the name of the parent directory on the remote file 
143
	 * @param remoteParents - the names of the parent directories on the remote file 
136
	 * system from which to retrieve the child list.
144
	 * system from which to retrieve the collective child list.
137
	 * @param fileFilter - a string that can be used to filter the children.  Only
145
	 * @param fileFilters - a set of strings that can be used to filter the children.  Only
138
	 * those files matching the filter make it into the list.  The interface 
146
	 * those files matching the filter corresponding to it's remoteParent make it into the list.  The interface 
139
	 * does not dictate where the filtering occurs.
147
	 * does not dictate where the filtering occurs.
148
	 * @param fileType - indicates whether to query files, folders, both or some other type
140
	 * @param monitor the monitor for this potentially long running operation
149
	 * @param monitor the monitor for this potentially long running operation
141
	 * @return the list of host files. 
150
	 * @return the collective list of host files that reside in each of the remoteParents with it's corresponding filter. 
142
	 * @throws SystemMessageException if an error occurs. 
151
	 * @throws SystemMessageException if an error occurs. 
143
	 * Typically this would be one of those in the RemoteFileException family.
152
	 * Typically this would be one of those in the RemoteFileException family.
144
	 */
153
	 */
145
	public IHostFile[] getFolders(String remoteParent, String fileFilter, IProgressMonitor monitor) throws SystemMessageException;
154
	public IHostFile[] listMulti(String[] remoteParents, String[] fileFilters, int fileType, IProgressMonitor monitor) throws SystemMessageException;
146
  
155
  
156
147
	/**
157
	/**
148
	 * @param monitor the monitor for this potentially long running operation
158
	 * @param monitor the monitor for this potentially long running operation
149
	 * Return the list of roots for this system
159
	 * Return the list of roots for this system
Lines 336-339 Link Here
336
	 * @since 2.0
346
	 * @since 2.0
337
	 */
347
	 */
338
	public OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor) throws SystemMessageException;
348
	public OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor) throws SystemMessageException;
349
	
350
	/**
351
	 * @param remoteParent - the name of the parent directory on the remote file 
352
	 * system from which to retrieve the child list.
353
	 * @param fileFilter - a string that can be used to filter the children.  Only
354
	 * those files matching the filter make it into the list.  The interface 
355
	 * does not dictate where the filtering occurs.
356
	 * @param monitor the monitor for this potentially long running operation
357
	 * @return the list of host files. 
358
	 * @throws SystemMessageException if an error occurs. 
359
	 * Typically this would be one of those in the RemoteFileException family.
360
	 * 
361
	 * @deprecated use list
362
	 */
363
	public IHostFile[] getFilesAndFolders(String remoteParent, String fileFilter, IProgressMonitor monitor) throws SystemMessageException;
364
  
365
	/**
366
	 * @param remoteParent - the name of the parent directory on the remote file 
367
	 * system from which to retrieve the child list.
368
	 * @param fileFilter - a string that can be used to filter the children.  Only
369
	 * those files matching the filter make it into the list.  The interface 
370
	 * does not dictate where the filtering occurs.
371
	 * @param monitor the monitor for this potentially long running operation
372
	 * @return the list of host files. 
373
	 * @throws SystemMessageException if an error occurs. 
374
	 * Typically this would be one of those in the RemoteFileException family.
375
	 * 
376
	 * @deprecated use list
377
	 */
378
	public IHostFile[] getFiles(String remoteParent, String fileFilter, IProgressMonitor monitor) throws SystemMessageException;
379
  
380
	/**
381
	 * @param remoteParent - the name of the parent directory on the remote file 
382
	 * system from which to retrieve the child list.
383
	 * @param fileFilter - a string that can be used to filter the children.  Only
384
	 * those files matching the filter make it into the list.  The interface 
385
	 * does not dictate where the filtering occurs.
386
	 * @param monitor the monitor for this potentially long running operation
387
	 * @return the list of host files. 
388
	 * @throws SystemMessageException if an error occurs. 
389
	 * Typically this would be one of those in the RemoteFileException family.
390
	 * 
391
	 * @deprecated use list
392
	 */
393
	public IHostFile[] getFolders(String remoteParent, String fileFilter, IProgressMonitor monitor) throws SystemMessageException;
394
  
395
	
339
}
396
}
(-)src/org/eclipse/rse/services/files/IFileServiceConstants.java (+22 lines)
Added Link Here
1
/********************************************************************************
2
 * Copyright (c) 2007 IBM Corporation. All rights reserved.
3
 * This program and the accompanying materials are made available under the terms
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is 
5
 * available at http://www.eclipse.org/legal/epl-v10.html
6
 * 
7
 * Initial Contributors:
8
 * The following IBM employees contributed to the Remote System Explorer
9
 * component that contains this file: David McKnight.
10
 * 
11
 * Contributors:
12
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
13
 ********************************************************************************/
14
package org.eclipse.rse.services.files;
15
16
public interface IFileServiceConstants {
17
18
	public static final int FILE_TYPE_FILES = 1;
19
	public static final int FILE_TYPE_FILES_AND_FOLDERS = 0;
20
	public static final int FILE_TYPE_FOLDERS = 2;
21
22
}
(-)src/samples/ui/propertypages/FolderInfoPropertyPage.java (-1 / +2 lines)
Lines 14-19 Link Here
14
 * Contributors:
14
 * Contributors:
15
 * Martin Oberhuber (Wind River) - Adapted original tutorial code to Open RSE.
15
 * Martin Oberhuber (Wind River) - Adapted original tutorial code to Open RSE.
16
 * Kevin Doyle 		(IBM)		 - [150492] FolderInfoPropertyPage doesn't work reliably
16
 * Kevin Doyle 		(IBM)		 - [150492] FolderInfoPropertyPage doesn't work reliably
17
 * David McKnight   (IBM)        - [207178] changing list APIs for file service and subsystems
17
 *******************************************************************************/
18
 *******************************************************************************/
18
19
19
package samples.ui.propertypages;
20
package samples.ui.propertypages;
Lines 200-206 Link Here
200
		{
201
		{
201
			try
202
			try
202
			{
203
			{
203
			IRemoteFile[] folders = currFolder.getParentRemoteFileSubSystem().listFoldersAndFiles( currFolder, null);
204
			IRemoteFile[] folders = currFolder.getParentRemoteFileSubSystem().list( currFolder, null);
204
			if ((folders != null) && (folders.length>0))
205
			if ((folders != null) && (folders.length>0))
205
			{
206
			{
206
				for (int idx=0; !stopped && (idx<folders.length); idx++)
207
				for (int idx=0; !stopped && (idx<folders.length); idx++)

Return to bug 207178