1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 23:55:26 +02:00

[209552] API changes to use multiple and getting rid of deprecated

This commit is contained in:
David McKnight 2007-11-15 19:12:26 +00:00
parent 712e981fcc
commit ee4f4bb453
6 changed files with 11 additions and 391 deletions

View file

@ -48,6 +48,7 @@ import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.subsystems.RemoteChildrenContentsType;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
import org.eclipse.rse.services.files.IFileServiceConstants;
import org.eclipse.rse.services.files.IHostFile;
import org.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString;
import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility;
@ -349,7 +350,7 @@ public class RSEFileStoreImpl extends FileStore
if (subSys instanceof FileServiceSubSystem) {
FileServiceSubSystem fileServiceSubSystem = ((FileServiceSubSystem)subSys);
IHostFile[] results = fileServiceSubSystem.getFileService().getFilesAndFolders(remoteFile.getAbsolutePath(), "*", monitor); //$NON-NLS-1$
IHostFile[] results = fileServiceSubSystem.getFileService().list(remoteFile.getAbsolutePath(), "*", IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS, monitor); //$NON-NLS-1$
IRemoteFileSubSystemConfiguration config = subSys.getParentRemoteFileSubSystemConfiguration();
RemoteFileFilterString filterString = new RemoteFileFilterString(config, remoteFile.getAbsolutePath(), "*"); //$NON-NLS-1$
filterString.setShowFiles(true);
@ -424,7 +425,7 @@ public class RSEFileStoreImpl extends FileStore
if (subSys instanceof FileServiceSubSystem) {
FileServiceSubSystem fileServiceSubSystem = ((FileServiceSubSystem)subSys);
IHostFile[] results = fileServiceSubSystem.getFileService().getFilesAndFolders(remoteFile.getAbsolutePath(), "*", monitor); //$NON-NLS-1$
IHostFile[] results = fileServiceSubSystem.getFileService().list(remoteFile.getAbsolutePath(), "*", IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS, monitor); //$NON-NLS-1$
IRemoteFileSubSystemConfiguration config = subSys.getParentRemoteFileSubSystemConfiguration();
RemoteFileFilterString filterString = new RemoteFileFilterString(config, remoteFile.getAbsolutePath(), "*"); //$NON-NLS-1$
filterString.setShowFiles(true);

View file

@ -206,28 +206,4 @@ public abstract class AbstractFileService implements IFileService
public OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor) throws SystemMessageException {
return null;
}
/**
* @deprecated
*/
public IHostFile[] getFiles(String remoteParent, String fileFilter, IProgressMonitor monitor) throws SystemMessageException
{
return internalFetch(remoteParent, fileFilter, IFileServiceConstants.FILE_TYPE_FILES, monitor);
}
/**
* @deprecated
*/
public IHostFile[] getFolders(String remoteParent, String fileFilter, IProgressMonitor monitor) throws SystemMessageException
{
return internalFetch(remoteParent, fileFilter, IFileServiceConstants.FILE_TYPE_FOLDERS, monitor);
}
/**
* @deprecated
*/
public IHostFile[] getFilesAndFolders(String parentPath, String fileFilter, IProgressMonitor monitor) throws SystemMessageException
{
return internalFetch(parentPath, fileFilter, IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS, monitor);
}
}

View file

@ -389,7 +389,7 @@ public interface IFileService extends IService
* @param isBinary <code>true</code> if the file is a binary file, <code>false</code> otherwise.
* @param monitor the progress monitor.
* @return the input stream to access the contents of the remote file.
* @throws SystemMessageException if an error occurs.
* @throws SystemMessageException if an error occurs. S
* @since 2.0
*/
public InputStream getInputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor) throws SystemMessageException;
@ -405,51 +405,6 @@ public interface IFileService extends IService
* @since 2.0
*/
public OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor) throws SystemMessageException;
/**
* @param remoteParent - the name of the parent directory on the remote file
* system from which to retrieve the child list.
* @param fileFilter - a string that can be used to filter the children. Only
* those files matching the filter make it into the list. The interface
* does not dictate where the filtering occurs.
* @param monitor the monitor for this potentially long running operation
* @return the list of host files.
* @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the RemoteFileException family.
*
* @deprecated use list
*/
public IHostFile[] getFilesAndFolders(String remoteParent, String fileFilter, IProgressMonitor monitor) throws SystemMessageException;
/**
* @param remoteParent - the name of the parent directory on the remote file
* system from which to retrieve the child list.
* @param fileFilter - a string that can be used to filter the children. Only
* those files matching the filter make it into the list. The interface
* does not dictate where the filtering occurs.
* @param monitor the monitor for this potentially long running operation
* @return the list of host files.
* @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the RemoteFileException family.
*
* @deprecated use list
*/
public IHostFile[] getFiles(String remoteParent, String fileFilter, IProgressMonitor monitor) throws SystemMessageException;
/**
* @param remoteParent - the name of the parent directory on the remote file
* system from which to retrieve the child list.
* @param fileFilter - a string that can be used to filter the children. Only
* those files matching the filter make it into the list. The interface
* does not dictate where the filtering occurs.
* @param monitor the monitor for this potentially long running operation
* @return the list of host files.
* @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the RemoteFileException family.
*
* @deprecated use list
*/
public IHostFile[] getFolders(String remoteParent, String fileFilter, IProgressMonitor monitor) throws SystemMessageException;
}

View file

@ -1027,145 +1027,5 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I
public OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor) throws SystemMessageException {
return new FileSubSystemOutputStream(getFileService().getOutputStream(remoteParent, remoteFile, isBinary, monitor), remoteParent, remoteFile, this);
}
/**
* Return the array of IRemoteFile instances, matching the given pattern,
* that are contained in the given folder.
* This version is called by RemoteFileSubSystemImpl's resolveFilterString(s)
* @param parent The parent folder to list files in
* @param fileNameFilter The name pattern to subset the list by, or null to return all files.
* @param context The holder of state information
*
* @deprecated use list
*/
public IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context,IProgressMonitor monitor) throws SystemMessageException
{
String parentPath = null;
if (parent != null) {
parentPath = parent.getAbsolutePath();
} else {
parentPath = "/"; //$NON-NLS-1$
}
if (parent != null && !parent.canRead())
{
SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FOLDER_UNREADABLE).makeSubstitution(parentPath);
throw new SystemMessageException(msg);
}
IHostFile[] results = null;
try
{
results = getFiles(parentPath, fileNameFilter, monitor);
}
catch (SystemMessageException e)
{
}
IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results);
if (parent != null)
parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr);
return farr;
}
/**
* Return a subsetted list of remote folders in the given parent folder on the remote system.
* This version is called by RemoteFileSubSystemImpl's resolveFilterString(s)
* @param parent The parent folder to list folders in
* @param fileNameFilter The name pattern for subsetting the file list when this folder is subsequently expanded
* @param context The holder of state information
*
* @deprecated use list
*/
public IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor) throws SystemMessageException
{
String parentPath = null;
if (parent != null) {
parentPath = parent.getAbsolutePath();
} else {
parentPath = "/"; //$NON-NLS-1$
}
if (parent != null && !parent.canRead())
{
SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FOLDER_UNREADABLE).makeSubstitution(parentPath);
throw new SystemMessageException(msg);
}
IHostFile[] results = null;
try
{
results = getFolders(parentPath, fileNameFilter, monitor);
}
catch (SystemMessageException e)
{
}
IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results);
if (parent != null)
parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr);
return farr;
}
/**
* Return a list of remote folders and files in the given folder.
* <p>
* The files part of the list is subsetted by the given file name filter.
* It can be null for no subsetting.
* This version is called by RemoteFileSubSystemImpl's resolveFilterString(s).
* @param parent The parent folder to list folders and files in
* @param fileNameFilter The name pattern to subset the file list by, or null to return all files.
* @param context The holder of state information
*
* @deprecated use list
*/
public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor) throws SystemMessageException
{
String parentPath = null;
if (parent != null) {
parentPath = parent.getAbsolutePath();
} else {
parentPath = "/"; //$NON-NLS-1$
}
if (parent != null && !parent.canRead())
{
SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FOLDER_UNREADABLE).makeSubstitution(parentPath);
throw new SystemMessageException(msg);
}
IHostFile[] results = getFilesAndFolders(parentPath, fileNameFilter, monitor);
IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results);
if (parent != null)
parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr);
return farr;
}
/**
* @deprecated
*/
protected IHostFile[] getFolders(String parentPath, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
{
return getFileService().getFolders(parentPath, fileNameFilter, monitor);
}
/**
* @deprecated
*/
protected IHostFile[] getFiles(String parentPath, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
{
return getFileService().getFiles(parentPath, fileNameFilter, monitor);
}
/**
* @deprecated
*/
protected IHostFile[] getFilesAndFolders(String parentPath, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
{
return getFileService().getFilesAndFolders(parentPath, fileNameFilter, monitor);
}
}

View file

@ -17,6 +17,7 @@
* Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem
* David McKnight (IBM) - [207178] changing list APIs for file service and subsystems
* David McKnight (IBM) - [162195] new APIs for upload multi and download multi
* David McKnight (IBM) - [209552] API changes to use multiple and getting rid of deprecated
*******************************************************************************/
package org.eclipse.rse.subsystems.files.core.subsystems;
@ -508,7 +509,7 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* Typically this would be one of those in the
* {@link RemoteFileException} family.
*/
public void downloadMulti(IRemoteFile[] sources, String[] destinations, String[] encodings, IProgressMonitor monitor) throws SystemMessageException;
public void downloadMultiple(IRemoteFile[] sources, String[] destinations, String[] encodings, IProgressMonitor monitor) throws SystemMessageException;
@ -574,7 +575,7 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* Typically this would be one of those in the
* {@link RemoteFileException} family.
*/
public void uploadMulti(String[] sources, IRemoteFile[] destinations, String[] encodings, IProgressMonitor monitor) throws SystemMessageException;
public void uploadMultiple(String[] sources, IRemoteFile[] destinations, String[] encodings, IProgressMonitor monitor) throws SystemMessageException;
/**
* Put the local copies of the remote files to the remote locations.
@ -595,7 +596,7 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* Typically this would be one of those in the
* {@link RemoteFileException} family.
*/
public void uploadMulti(String sources[], String[] srcEncodings, String[] remotePaths, String[] rmtEncodings, IProgressMonitor monitor) throws SystemMessageException;
public void uploadMultiple(String sources[], String[] srcEncodings, String[] remotePaths, String[] rmtEncodings, IProgressMonitor monitor) throws SystemMessageException;
/**
* Returns a language utility factory associated with this subsystem.
@ -653,105 +654,5 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* @since 2.0
*/
public OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor) throws SystemMessageException;
/**
* Return a list of all remote folders in the given parent folder on the remote system
* @param parent The parent folder to list folders in
* @param monitor the progress monitor
*
* @deprecated use list
*/
public IRemoteFile[] listFolders(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException;
/**
* Return a full list of remote folders in the given parent folder on the remote system.
* @param parent The parent folder to list folders in
* @param fileNameFilter The name pattern for subsetting the file list when this folder is subsequently expanded
* @param monitor the progress monitor
*
* @deprecated use list
*/
public IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException;
/**
* Return a list of all remote files in the given parent folder on the remote system
* @param parent The parent folder to list files in
* @param monitor the progress monitor
*
* @deprecated use list
*/
public IRemoteFile[] listFiles(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException;
/**
* Return a list of remote files in the given folder, which match the given name pattern.
* @param parent The parent folder to list files in
* @param fileNameFilter The name pattern to subset the list by, or null to return all files.
* @param monitor the progress monitor
*
* @deprecated use list
*/
public IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException;
/**
* Return a subsetted list of remote folders in the given parent folder on the remote system.
* This version is called by RemoteFileSubSystemImpl's resolveFilterString(s)
* <b>note</b>This method should be abstract but MOF doesn't allow abstract impl classes at this point
* @param parent The parent folder to list folders in
* @param fileNameFilter The name pattern for subsetting the file list when this folder is subsequently expanded
* @param context The holder of state information
* @param monitor the progress monitor
*
* @deprecated use list
*/
public IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor) throws SystemMessageException;
/**
* Return a list of remote files in the given folder, which match the given name pattern.
* This version is called by RemoteFileSubSystemImpl's resolveFilterString(s)
* <b>note</b>This method should be abstract but MOF doesn't allow abstract impl classes at this point
* @param parent The parent folder to list files in
* @param fileNameFilter The name pattern to subset the list by, or null to return all files.
* @param context The holder of state information
* @param monitor the progress monitor
*
* @deprecated use list
*/
public IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor) throws SystemMessageException;
/**
* Return a list of all remote folders and files in the given folder. The list is not subsetted.
* @param parent The parent folder to list folders and files in
* @param monitor the progress monitor
*
* @deprecated use list
*/
public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException;
/**
* Return a list of remote folders and files in the given folder. Only file names are subsettable
* by the given file name filter. It can be null for no subsetting.
* @param parent The parent folder to list folders and files in
* @param fileNameFilter The name pattern to subset the file list by, or null to return all files.
* @param monitor the progress monitor
*
* @deprecated use list
*/
public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException;
/**
* Return a list of remote folders and files in the given folder.
* <p>
* The files part of the list is subsetted by the given file name filter.
* It can be null for no subsetting.
* This version is called by RemoteFileSubSystemImpl's resolveFilterString(s).
* @param parent The parent folder to list folders and files in
* @param fileNameFilter The name pattern to subset the file list by, or null to return all files.
* @param context The holder of state information
* @param monitor the progress monitor
*
* @deprecated use list
*/
public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor) throws SystemMessageException;
}

View file

@ -680,7 +680,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi
}
else
{
children = listFolders(parent, filter, monitor);
children = list(parent, filter, IFileServiceConstants.FILE_TYPE_FOLDERS, monitor);
}
}
else
@ -691,7 +691,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi
}
else
{
children = listFiles(parent, filter, monitor);
children = list(parent, filter, IFileServiceConstants.FILE_TYPE_FILES, monitor);
}
}
}
@ -841,7 +841,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi
else if (showDirs)
children = list((IRemoteFile) parent, filterString, IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS, monitor);
else
children = listFiles((IRemoteFile) parent, filterString, monitor);
children = list((IRemoteFile) parent, filterString, IFileServiceConstants.FILE_TYPE_FILES, monitor);
if (sort && (children != null) && (children.length > 1))
Arrays.sort(children);
}
@ -1470,77 +1470,4 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi
return System.getProperty("file.encoding"); //$NON-NLS-1$
}
}
/**
* Return a list of all remote folders in the given parent folder on the remote system
* @param parent The parent folder to list folders in
*
* @deprecated use list
*/
public IRemoteFile[] listFolders(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException
{
return list(parent, IFileServiceConstants.FILE_TYPE_FOLDERS, monitor);
}
/**
* Return a full list of remote folders in the given parent folder on the remote system.
* @param parent The parent folder to list folders in
* @param fileNameFilter The name pattern for subsetting the file list when this folder is subsequently expanded, or null to return all folders.
*
* @deprecated use list
*/
public IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
{
return list(parent, fileNameFilter, IFileServiceConstants.FILE_TYPE_FOLDERS, monitor);
}
/**
* Return a list of all remote files in the given parent folder on the remote system
* @param parent The parent folder to list files in
*
* @deprecated use list
*/
public IRemoteFile[] listFiles(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException
{
return list(parent, IFileServiceConstants.FILE_TYPE_FILES, monitor);
}
/**
* Return a list of remote files in the given folder, which match the given name pattern.
* @param parent The parent folder to list files in
* @param fileNameFilter The name pattern to subset the list by, or null to return all files.
*
* @deprecated use list
*/
public IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
{
return list(parent, fileNameFilter, IFileServiceConstants.FILE_TYPE_FILES, monitor);
}
/**
* Return a list of all remote folders and files in the given folder. The list is not subsetted.
* @param parent The parent folder to list folders and files in
*
* @deprecated use list
*/
public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException
{
return list(parent, monitor);
}
/**
* Return a list of remote folders and files in the given folder.
* <p>
* The files part of the list is subsetted by the given file name filter. It can be null for no subsetting.
*
* @param parent The parent folder to list folders and files in
* @param fileNameFilter The name pattern to subset the file list by, or null to return all files.
*
* @deprecated use list
*/
public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException
{
return list(parent, fileNameFilter, IFileServiceConstants.FILE_TYPE_FILES_AND_FOLDERS, monitor);
}
}