1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-10 01:35:39 +02:00

[226574][api] Add ISubSystemConfiguration#supportsEncoding()

This commit is contained in:
Martin Oberhuber 2008-04-11 10:02:15 +00:00
parent 56237a00c6
commit d2324098ef
2 changed files with 132 additions and 148 deletions

View file

@ -7,10 +7,10 @@
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
@ -20,6 +20,7 @@
* David McKnight (IBM) - [209552] API changes to use multiple and getting rid of deprecated * David McKnight (IBM) - [209552] API changes to use multiple and getting rid of deprecated
* Kevin Doyle (IBM) - [208778] new API getOutputSteam for getting an output stream in append mode * Kevin Doyle (IBM) - [208778] new API getOutputSteam for getting an output stream in append mode
* David McKnight (IBM) - [209704] added supportsEncodingConversion() * David McKnight (IBM) - [209704] added supportsEncodingConversion()
* Martin Oberhuber (Wind River) - [226574][api] Add ISubSystemConfiguration#supportsEncoding()
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.subsystems.files.core.subsystems; package org.eclipse.rse.subsystems.files.core.subsystems;
@ -53,11 +54,11 @@ public interface IRemoteFileSubSystem extends ISubSystem {
// ---------------------- // ----------------------
// HELPER METHODS... // HELPER METHODS...
// ---------------------- // ----------------------
/** /**
* Return parent subsystem factory, cast to a RemoteFileSubSystemConfiguration * Return parent subsystem factory, cast to a RemoteFileSubSystemConfiguration
*/ */
public IRemoteFileSubSystemConfiguration getParentRemoteFileSubSystemConfiguration(); public IRemoteFileSubSystemConfiguration getParentRemoteFileSubSystemConfiguration();
/** /**
* Return true if file names are case-sensitive. Used when doing name or type filtering * Return true if file names are case-sensitive. Used when doing name or type filtering
*/ */
@ -65,7 +66,7 @@ public interface IRemoteFileSubSystem extends ISubSystem {
// -------------------------------- // --------------------------------
// FILE SYSTEM ATTRIBUTE METHODS... // FILE SYSTEM ATTRIBUTE METHODS...
// -------------------------------- // --------------------------------
/** /**
* Return in string format the character used to separate folders. Eg, "\" or "/". * Return in string format the character used to separate folders. Eg, "\" or "/".
* <br> * <br>
@ -77,21 +78,21 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* Return in character format the character used to separate folders. Eg, "\" or "/" * Return in character format the character used to separate folders. Eg, "\" or "/"
* <br> * <br>
* Shortcut to {@link #getParentRemoteFileSubSystemConfiguration()}.getSeparatorChar() * Shortcut to {@link #getParentRemoteFileSubSystemConfiguration()}.getSeparatorChar()
*/ */
public char getSeparatorChar(); public char getSeparatorChar();
/** /**
* Return in string format the character used to separate paths. Eg, ";" or ":" * Return in string format the character used to separate paths. Eg, ";" or ":"
* <br> * <br>
* Shortcut to {@link #getParentRemoteFileSubSystemConfiguration()}.getPathSeparator() * Shortcut to {@link #getParentRemoteFileSubSystemConfiguration()}.getPathSeparator()
*/ */
public String getPathSeparator(); public String getPathSeparator();
/** /**
* Return in char format the character used to separate paths. Eg, ";" or ":" * Return in char format the character used to separate paths. Eg, ";" or ":"
* <br> * <br>
* Shortcut to {@link #getParentRemoteFileSubSystemConfiguration()}.getPathSeparatorChar() * Shortcut to {@link #getParentRemoteFileSubSystemConfiguration()}.getPathSeparatorChar()
*/ */
public char getPathSeparatorChar(); public char getPathSeparatorChar();
/** /**
@ -100,7 +101,7 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* Shortcut to {@link #getParentRemoteFileSubSystemConfiguration()}.getLineSeparator() * Shortcut to {@link #getParentRemoteFileSubSystemConfiguration()}.getLineSeparator()
*/ */
public String getLineSeparator(); public String getLineSeparator();
// ---------------------- // ----------------------
// FILE SYSTEM METHODS... // FILE SYSTEM METHODS...
// ---------------------- // ----------------------
@ -110,28 +111,28 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* This version is called directly by users. * This version is called directly by users.
*/ */
public IRemoteFile[] listRoots(IProgressMonitor monitor) throws InterruptedException, SystemMessageException; public IRemoteFile[] listRoots(IProgressMonitor monitor) throws InterruptedException, SystemMessageException;
/** /**
* Return a list of all remote folders and/or files in the given folders. This list is not filtered. * Return a list of all remote folders and/or files in the given folders. This list is not filtered.
* *
* @param parents The parent folders to list folders and/or files in * @param parents The parent folders to list folders and/or files in
* @param fileTypes - indicates whether to query files, folders, both or some other type. There * @param fileTypes - indicates whether to query files, folders, both or some other type. There
* should be exactly one fileType specified per parent. * should be exactly one fileType specified per parent.
* For the default list of available file types see <code>IFileServiceContants</code> * For the default list of available file types see <code>IFileServiceContants</code>
* @param monitor the progress monitor * @param monitor the progress monitor
* @since 3.0 * @since 3.0
*/ */
public IRemoteFile[] listMultiple(IRemoteFile[] parents, int[] fileTypes, IProgressMonitor monitor) throws SystemMessageException; public IRemoteFile[] listMultiple(IRemoteFile[] parents, int[] fileTypes, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Return a list of remote folders and/or files in the given folder. Only file names are filtered * Return a list of remote folders and/or files in the given folder. Only file names are filtered
* by the given file name filters. It can be null for no sub-setting. * by the given file name filters. It can be null for no sub-setting.
* *
* @param parents The parent folders to list folders and files in * @param parents The parent folders to list folders and files in
* @param fileNameFilters The name patterns to subset the file list by, or null to return all files. * @param fileNameFilters The name patterns to subset the file list by, or null to return all files.
* There should be exactly one fileNameFilter per parent. * There should be exactly one fileNameFilter per parent.
* @param fileTypes - indicates whether to query files, folders, both or some other type. There * @param fileTypes - indicates whether to query files, folders, both or some other type. There
* should be exactly one fileType specified per parent. * should be exactly one fileType specified per parent.
* For the default list of available file types see <code>IFileServiceContants</code> * For the default list of available file types see <code>IFileServiceContants</code>
* @param monitor the progress monitor * @param monitor the progress monitor
@ -141,58 +142,58 @@ public interface IRemoteFileSubSystem extends ISubSystem {
/** /**
* Return a list of all remote folders and/or files in the given folders. This list is not filtered. * Return a list of all remote folders and/or files in the given folders. This list is not filtered.
* *
* @param parents The parent folders to list folders and/or files in * @param parents The parent folders to list folders and/or files in
* @param fileType - indicates whether to query files, folders, both or some other type. This fileType is used for each parent query. * @param fileType - indicates whether to query files, folders, both or some other type. This fileType is used for each parent query.
* For the default list of available file types see <code>IFileServiceContants</code> * For the default list of available file types see <code>IFileServiceContants</code>
* @param monitor the progress monitor * @param monitor the progress monitor
* @since 3.0 * @since 3.0
*/ */
public IRemoteFile[] listMultiple(IRemoteFile[] parents, int fileType, IProgressMonitor monitor) throws SystemMessageException; public IRemoteFile[] listMultiple(IRemoteFile[] parents, int fileType, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Return a list of remote folders and/or files in the given folder. Only file names are filtered * Return a list of remote folders and/or files in the given folder. Only file names are filtered
* by the given file name filters. It can be null for no sub-setting. * by the given file name filters. It can be null for no sub-setting.
* *
* @param parents The parent folders to list folders and files in * @param parents The parent folders to list folders and files in
* @param fileNameFilters The name patterns to subset the file list by, or null to return all files. * @param fileNameFilters The name patterns to subset the file list by, or null to return all files.
* There should be exactly one fileNameFilter per parent. * There should be exactly one fileNameFilter per parent.
* @param fileType - indicates whether to query files, folders, both or some other type. * @param fileType - indicates whether to query files, folders, both or some other type.
* Available file types include {@link IFileService#FILE_TYPE_FILES}, * Available file types include {@link IFileService#FILE_TYPE_FILES},
* {@link IFileService#FILE_TYPE_FOLDERS}, and * {@link IFileService#FILE_TYPE_FOLDERS}, and
* {@link IFileService#FILE_TYPE_FILES_AND_FOLDERS}. * {@link IFileService#FILE_TYPE_FILES_AND_FOLDERS}.
* @param monitor the progress monitor * @param monitor the progress monitor
* @since 3.0 * @since 3.0
*/ */
public IRemoteFile[] listMultiple(IRemoteFile[] parents, String[] fileNameFilters, int fileType, IProgressMonitor monitor) throws SystemMessageException; public IRemoteFile[] listMultiple(IRemoteFile[] parents, String[] fileNameFilters, int fileType, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Return a list of all remote folders and/or files in the given folder. The list is not filtered. * Return a list of all remote folders and/or files in the given folder. The list is not filtered.
* *
* @param parent The parent folder to list folders and/or files in * @param parent The parent folder to list folders and/or files in
* @param monitor the progress monitor * @param monitor the progress monitor
* @since 3.0 * @since 3.0
*/ */
public IRemoteFile[] list(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException; public IRemoteFile[] list(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Return a list of all remote folders and/or files in the given folder. The list is not filtered. * Return a list of all remote folders and/or files in the given folder. The list is not filtered.
* *
* @param parent The parent folder to list folders and files in * @param parent The parent folder to list folders and files in
* @param fileType - indicates whether to query files, folders, both or some other type. * @param fileType - indicates whether to query files, folders, both or some other type.
* Available file types include {@link IFileService#FILE_TYPE_FILES}, * Available file types include {@link IFileService#FILE_TYPE_FILES},
* {@link IFileService#FILE_TYPE_FOLDERS}, and * {@link IFileService#FILE_TYPE_FOLDERS}, and
* {@link IFileService#FILE_TYPE_FILES_AND_FOLDERS}. * {@link IFileService#FILE_TYPE_FILES_AND_FOLDERS}.
* @param monitor the progress monitor * @param monitor the progress monitor
* @since 3.0 * @since 3.0
*/ */
public IRemoteFile[] list(IRemoteFile parent, int fileType, IProgressMonitor monitor) throws SystemMessageException; public IRemoteFile[] list(IRemoteFile parent, int fileType, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Return a list of remote folders and/or files in the given folder. Only file names are filtered * Return a list of remote folders and/or files in the given folder. Only file names are filtered
* by the given file name filter. It can be null for no filtering. * by the given file name filter. It can be null for no filtering.
* *
* @param parent The parent folder to list folders and files in * @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 fileNameFilter The name pattern to subset the file list by, or null to return all files.
* @param fileType - indicates whether to query files, folders, both or some other type. * @param fileType - indicates whether to query files, folders, both or some other type.
@ -203,9 +204,9 @@ public interface IRemoteFileSubSystem extends ISubSystem {
public IRemoteFile[] list(IRemoteFile parent, String fileNameFilter, int fileType, IProgressMonitor monitor) throws SystemMessageException; public IRemoteFile[] list(IRemoteFile parent, String fileNameFilter, int fileType, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Return a list of remote folders and/or files in the given folder. The files part of the list is filtered * Return a list of remote folders and/or files in the given folder. The files part of the list is filtered
* by the given file name filter. It can be null for no filtering. * by the given file name filter. It can be null for no filtering.
* *
* @param parent The parent folder to list folders and files in * @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 fileNameFilter The name pattern to subset the file list by, or null to return all files.
* @param context The holder of state information * @param context The holder of state information
@ -218,7 +219,7 @@ public interface IRemoteFileSubSystem extends ISubSystem {
*/ */
public IRemoteFile[] list(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, int fileType, IProgressMonitor monitor) throws SystemMessageException; public IRemoteFile[] list(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, int fileType, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Given a search configuration, searches for its results. * Given a search configuration, searches for its results.
@ -236,7 +237,7 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* Given a folder or file, return its parent folder object. * Given a folder or file, return its parent folder object.
* @param folderOrFile folder or file to return parent of. * @param folderOrFile folder or file to return parent of.
* @param monitor the progress monitor * @param monitor the progress monitor
* *
* @return the remote file * @return the remote file
*/ */
public IRemoteFile getParentFolder(IRemoteFile folderOrFile, IProgressMonitor monitor); public IRemoteFile getParentFolder(IRemoteFile folderOrFile, IProgressMonitor monitor);
@ -246,39 +247,30 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* @param folderOrFile folder or file to return parent of. * @param folderOrFile folder or file to return parent of.
*/ */
public String getParentFolderName(IRemoteFile folderOrFile); public String getParentFolderName(IRemoteFile folderOrFile);
/**
* Returns whether the file subsystem supports encodings. There are file subsystems that deal with codepages and encodings
* using other mechanisms besides encodings, and such platforms should return <code>false</code>. Other file subsystems
* may not deal with encodings at all.
* @return <code>true<code> if the file subsystem supports encodings, <code>false</code> otherwise.
* @since 2.0
*/
public boolean supportsEncoding();
/** /**
* Returns the encoding of the remote system. * Returns the encoding of the remote system.
* @return the encoding of the remote system. * @return the encoding of the remote system.
*/ */
public String getRemoteEncoding(); public String getRemoteEncoding();
/** /**
* Returns the encoding of the file with the remote path. * Returns the encoding of the file with the remote path.
* @param remotePath the remote path of the file. * @param remotePath the remote path of the file.
* @return the encoding of the remote file. * @return the encoding of the remote file.
*/ */
// public String getEncoding(String remotePath); // public String getEncoding(String remotePath);
/** /**
* Given a set of fully qualified file or folder names, return an ISystemResourceSet object for it. * Given a set of fully qualified file or folder names, return an ISystemResourceSet object for it.
* @param folderOrFileNames Fully qualified folder or file names * @param folderOrFileNames Fully qualified folder or file names
* @param monitor the progress monitor * @param monitor the progress monitor
* *
* @return the set of resources * @return the set of resources
* @since 3.0 * @since 3.0
*/ */
public IRemoteFile[] getRemoteFileObjects(String[] folderOrFileNames, IProgressMonitor monitor) throws SystemMessageException; public IRemoteFile[] getRemoteFileObjects(String[] folderOrFileNames, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Given a fully qualified file or folder name, return an IRemoteFile * Given a fully qualified file or folder name, return an IRemoteFile
* object for it. * object for it.
@ -295,22 +287,22 @@ public interface IRemoteFileSubSystem extends ISubSystem {
public IRemoteFile getRemoteFileObject(String folderOrFileName, IProgressMonitor monitor) throws SystemMessageException; public IRemoteFile getRemoteFileObject(String folderOrFileName, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Given a un-qualified file or folder name, and its parent folder object, * Given a un-qualified file or folder name, and its parent folder object,
* return an IRemoteFile object for the file. * return an IRemoteFile object for the file.
* @param parent Folder containing the folder or file * @param parent Folder containing the folder or file
* @param folderOrFileName Un-qualified folder or file name * @param folderOrFileName Un-qualified folder or file name
* @param monitor the progress monitor * @param monitor the progress monitor
* *
* @return the requested IRemoteFile object * @return the requested IRemoteFile object
*/ */
public IRemoteFile getRemoteFileObject(IRemoteFile parent, String folderOrFileName, IProgressMonitor monitor) throws SystemMessageException; public IRemoteFile getRemoteFileObject(IRemoteFile parent, String folderOrFileName, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Given a key, returns a search result object for it. For the key, see < * Given a key, returns a search result object for it. For the key, see <
* @param key the key that uniquely identifies a search result. * @param key the key that uniquely identifies a search result.
*/ */
public IRemoteSearchResult getRemoteSearchResultObject(String key) throws SystemMessageException; public IRemoteSearchResult getRemoteSearchResultObject(String key) throws SystemMessageException;
/** /**
* Create a new file, given its IRemoteFile object (these do not have to represent existing files). * Create a new file, given its IRemoteFile object (these do not have to represent existing files).
* <p> * <p>
@ -319,13 +311,13 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* <li>If this file already exists, this is a no-op. * <li>If this file already exists, this is a no-op.
* <li>If the given object is a folder, not a file, this is a no-op. * <li>If the given object is a folder, not a file, this is a no-op.
* </ul> * </ul>
* *
* @see #createFolders(IRemoteFile,IProgressMonitor) * @see #createFolders(IRemoteFile,IProgressMonitor)
* *
* @param fileToCreate The object representing the file to be created. * @param fileToCreate The object representing the file to be created.
* @return The same input object returned for convenience. Will throw exception if it fails. * @return The same input object returned for convenience. Will throw exception if it fails.
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the * Typically this would be one of those in the
* {@link RemoteFileException} family. * {@link RemoteFileException} family.
*/ */
public IRemoteFile createFile(IRemoteFile fileToCreate, IProgressMonitor monitor) throws SystemMessageException; public IRemoteFile createFile(IRemoteFile fileToCreate, IProgressMonitor monitor) throws SystemMessageException;
@ -338,18 +330,18 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* <li>If this folder already exists, this is a no-op. * <li>If this folder already exists, this is a no-op.
* <li>If the given object is a file, not a folder, this is a no-op. * <li>If the given object is a file, not a folder, this is a no-op.
* </ul> * </ul>
* *
* @see #createFolders(IRemoteFile, IProgressMonitor) * @see #createFolders(IRemoteFile, IProgressMonitor)
* *
* @param folderToCreate The object representing the folder to be created. * @param folderToCreate The object representing the folder to be created.
* @param monitor the progress monitor * @param monitor the progress monitor
* @return The same input object returned for convenience. Will throw exception if it fails. * @return The same input object returned for convenience. Will throw exception if it fails.
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the * Typically this would be one of those in the
* {@link RemoteFileException} family. * {@link RemoteFileException} family.
*/ */
public IRemoteFile createFolder(IRemoteFile folderToCreate, IProgressMonitor monitor) throws SystemMessageException; public IRemoteFile createFolder(IRemoteFile folderToCreate, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Given an IRemoteFile for a folder, this will create that folder and any missing parent folders in its path. * Given an IRemoteFile for a folder, this will create that folder and any missing parent folders in its path.
* Use getParentFolder to get the parent object of your file or folder in order to call this method. * Use getParentFolder to get the parent object of your file or folder in order to call this method.
@ -358,35 +350,35 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* <li>If this folder already exists, this is a no-op. * <li>If this folder already exists, this is a no-op.
* <li>If the given object is a file, not a folder, this is a no-op. * <li>If the given object is a file, not a folder, this is a no-op.
* </ul> * </ul>
* *
* @see #getParentFolder(IRemoteFile, IProgressMonitor) * @see #getParentFolder(IRemoteFile, IProgressMonitor)
* *
* @param folderToCreate The object representing the folder to be created, along with its parents. * @param folderToCreate The object representing the folder to be created, along with its parents.
* @param monitor the progress monitor * @param monitor the progress monitor
* @return The same input object returned for convenience. Will throw exception if it fails. * @return The same input object returned for convenience. Will throw exception if it fails.
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the * Typically this would be one of those in the
* {@link RemoteFileException} family. * {@link RemoteFileException} family.
*/ */
public IRemoteFile createFolders(IRemoteFile folderToCreate, IProgressMonitor monitor) throws SystemMessageException; public IRemoteFile createFolders(IRemoteFile folderToCreate, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Delete the given remote file or folder. * Delete the given remote file or folder.
* <ul> * <ul>
* <li>If the input is a folder, that folder must be empty for this to succeed. * <li>If the input is a folder, that folder must be empty for this to succeed.
* </ul> * </ul>
* *
* @param folderOrFile represents the object to be deleted. * @param folderOrFile represents the object to be deleted.
* @param monitor progressMonitor * @param monitor progressMonitor
* @return false if the given folder/file didn't exist to begin with, else true. Throws an exception if anything fails. * @return false if the given folder/file didn't exist to begin with, else true. Throws an exception if anything fails.
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the * Typically this would be one of those in the
* {@link RemoteFileException} family. * {@link RemoteFileException} family.
*/ */
public boolean delete(IRemoteFile folderOrFile, IProgressMonitor monitor) throws SystemMessageException; public boolean delete(IRemoteFile folderOrFile, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Delete the given batch of remote file or folder. * Delete the given batch of remote file or folder.
* <ul> * <ul>
* <li>If any of the inputs are a folder, those folders must be empty for this to succeed. * <li>If any of the inputs are a folder, those folders must be empty for this to succeed.
* </ul> * </ul>
@ -395,8 +387,8 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* @param folderOrFiles represents the objects to be deleted. * @param folderOrFiles represents the objects to be deleted.
* @param monitor progressMonitor * @param monitor progressMonitor
* @return false if any of the given folder/file dont exist to begin with, else true. Throws an exception if anything fails. * @return false if any of the given folder/file dont exist to begin with, else true. Throws an exception if anything fails.
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the * Typically this would be one of those in the
* {@link RemoteFileException} family. * {@link RemoteFileException} family.
*/ */
public boolean deleteBatch(IRemoteFile[] folderOrFiles, IProgressMonitor monitor) throws SystemMessageException; public boolean deleteBatch(IRemoteFile[] folderOrFiles, IProgressMonitor monitor) throws SystemMessageException;
@ -407,26 +399,26 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* @param newName new name to give it. * @param newName new name to give it.
* @param monitor the progress monitor * @param monitor the progress monitor
* @return false if the given folder/file didn't exist on disk (still renamed in memory), else true. Throws an exception if anything fails. * @return false if the given folder/file didn't exist on disk (still renamed in memory), else true. Throws an exception if anything fails.
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the * Typically this would be one of those in the
* {@link RemoteFileException} family. * {@link RemoteFileException} family.
*/ */
public boolean rename(IRemoteFile folderOrFile, String newName, IProgressMonitor monitor) throws SystemMessageException; public boolean rename(IRemoteFile folderOrFile, String newName, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Move a file or folder to a new target parent folder. * Move a file or folder to a new target parent folder.
* *
* @param sourceFolderOrFile The file or folder to move * @param sourceFolderOrFile The file or folder to move
* @param targetFolder The folder to move to. No guarantee it is on the same system, so be sure to check getSystemConnection()! * @param targetFolder The folder to move to. No guarantee it is on the same system, so be sure to check getSystemConnection()!
* @param newName The new name for the moved file or folder * @param newName The new name for the moved file or folder
* @param monitor progress monitor * @param monitor progress monitor
* @return true if the move succeeded * @return true if the move succeeded
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the * Typically this would be one of those in the
* {@link RemoteFileException} family. * {@link RemoteFileException} family.
*/ */
public boolean move(IRemoteFile sourceFolderOrFile, IRemoteFile targetFolder, String newName,IProgressMonitor monitor) throws SystemMessageException; public boolean move(IRemoteFile sourceFolderOrFile, IRemoteFile targetFolder, String newName,IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Set the last modified date for the given file or folder. Like a Unix "touch" operation. * Set the last modified date for the given file or folder. Like a Unix "touch" operation.
* Folder or file must exist on disk for this to succeed. * Folder or file must exist on disk for this to succeed.
@ -434,8 +426,8 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* @param newDate new date, in milliseconds from epoch, to assign. * @param newDate new date, in milliseconds from epoch, to assign.
* @param monitor the progress monitor * @param monitor the progress monitor
* @return false if the given folder/file didn't exist on disk (operation fails), else true. Throws an exception if anything fails. * @return false if the given folder/file didn't exist on disk (operation fails), else true. Throws an exception if anything fails.
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the * Typically this would be one of those in the
* {@link RemoteFileException} family. * {@link RemoteFileException} family.
*/ */
public boolean setLastModified(IRemoteFile folderOrFile, long newDate, IProgressMonitor monitor) throws SystemMessageException; public boolean setLastModified(IRemoteFile folderOrFile, long newDate, IProgressMonitor monitor) throws SystemMessageException;
@ -447,29 +439,29 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* @param readOnly whether to set it to be read-only or not * @param readOnly whether to set it to be read-only or not
* @param monitor the progress monitor * @param monitor the progress monitor
* @return false if the given folder/file didn't exist on disk (operation fails), else true. Throws an exception if anything fails. * @return false if the given folder/file didn't exist on disk (operation fails), else true. Throws an exception if anything fails.
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the * Typically this would be one of those in the
* {@link RemoteFileException} family. * {@link RemoteFileException} family.
*/ */
public boolean setReadOnly(IRemoteFile folderOrFile, boolean readOnly, IProgressMonitor monitor) throws SystemMessageException; public boolean setReadOnly(IRemoteFile folderOrFile, boolean readOnly, IProgressMonitor monitor) throws SystemMessageException;
// ---------------------------- // ----------------------------
// METHODS FOR FILE TRANSFER... // METHODS FOR FILE TRANSFER...
// ---------------------------- // ----------------------------
// Beginning of methods for downloading remote files from the server // Beginning of methods for downloading remote files from the server
/** /**
* Copy a file or folder to a new target parent folder. * Copy a file or folder to a new target parent folder.
* *
* @param sourceFolderOrFile The file or folder to copy * @param sourceFolderOrFile The file or folder to copy
* @param targetFolder The folder to copy to. No guarantee it is on the same system, so be sure to check getSystemConnection()! * @param targetFolder The folder to copy to. No guarantee it is on the same system, so be sure to check getSystemConnection()!
* @param newName The new name for the copied file or folder * @param newName The new name for the copied file or folder
* @param monitor progress monitor * @param monitor progress monitor
* @return true if the copy succeeded * @return true if the copy succeeded
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the * Typically this would be one of those in the
* {@link RemoteFileException} family. * {@link RemoteFileException} family.
*/ */
public boolean copy(IRemoteFile sourceFolderOrFile, IRemoteFile targetFolder, String newName, IProgressMonitor monitor) throws SystemMessageException; public boolean copy(IRemoteFile sourceFolderOrFile, IRemoteFile targetFolder, String newName, IProgressMonitor monitor) throws SystemMessageException;
@ -477,22 +469,22 @@ public interface IRemoteFileSubSystem extends ISubSystem {
/** /**
* Copy a set of remote files or folders to a new target parent folder. Precondition: Sources and target must all be on the same system! * Copy a set of remote files or folders to a new target parent folder. Precondition: Sources and target must all be on the same system!
* @param sourceFolderOrFile The file or folder to copy * @param sourceFolderOrFile The file or folder to copy
* @param targetFolder The folder to copy to. * @param targetFolder The folder to copy to.
* @param monitor progress monitor * @param monitor progress monitor
* @return true if all copies succeeded * @return true if all copies succeeded
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the * Typically this would be one of those in the
* {@link RemoteFileException} family. * {@link RemoteFileException} family.
*/ */
public boolean copyBatch(IRemoteFile[] sourceFolderOrFile, IRemoteFile targetFolder, IProgressMonitor monitor) throws SystemMessageException; public boolean copyBatch(IRemoteFile[] sourceFolderOrFile, IRemoteFile targetFolder, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Get the remote file and save it locally. * Get the remote file and save it locally.
* *
* The file is saved in the encoding specified, with two exceptions: * The file is saved in the encoding specified, with two exceptions:
* <ul> * <ul>
* <li>If the remote file is binary, encoding does not apply.</li> * <li>If the remote file is binary, encoding does not apply.</li>
* <li>If the remote file is a XML file, then it will be * <li>If the remote file is a XML file, then it will be
* copied to local in the encoding specified in the XML * copied to local in the encoding specified in the XML
* declaration, or as determined from the XML specification.</li> * declaration, or as determined from the XML specification.</li>
* </ul> * </ul>
@ -500,20 +492,20 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* @param destination the absolute path of the local file * @param destination the absolute path of the local file
* @param encoding the encoding of the local file * @param encoding the encoding of the local file
* @param monitor the progress monitor * @param monitor the progress monitor
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the * Typically this would be one of those in the
* {@link RemoteFileException} family. * {@link RemoteFileException} family.
*/ */
public void download(IRemoteFile source, String destination, String encoding, IProgressMonitor monitor) throws SystemMessageException; public void download(IRemoteFile source, String destination, String encoding, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Get the remote files and save them locally. * Get the remote files and save them locally.
* *
* The files are saved in the encodings specified, with two exceptions: * The files are saved in the encodings specified, with two exceptions:
* <ul> * <ul>
* <li>If a remote file is binary, encoding does not apply.</li> * <li>If a remote file is binary, encoding does not apply.</li>
* <li>If a remote file is a XML file, then it will be * <li>If a remote file is a XML file, then it will be
* copied to local in the encoding specified in the XML * copied to local in the encoding specified in the XML
* declaration, or as determined from the XML specification.</li> * declaration, or as determined from the XML specification.</li>
* </ul> * </ul>
@ -521,19 +513,19 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* @param destinations the absolute paths of the local files * @param destinations the absolute paths of the local files
* @param encodings the encodings of the local files * @param encodings the encodings of the local files
* @param monitor the progress monitor * @param monitor the progress monitor
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the * Typically this would be one of those in the
* {@link RemoteFileException} family. * {@link RemoteFileException} family.
* @since 3.0 * @since 3.0
*/ */
public void downloadMultiple(IRemoteFile[] sources, String[] destinations, String[] encodings, IProgressMonitor monitor) throws SystemMessageException; public void downloadMultiple(IRemoteFile[] sources, String[] destinations, String[] encodings, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Put the local copy of the remote file back to the remote location. * Put the local copy of the remote file back to the remote location.
* *
* The file is assumed to be in the encoding specified, with * The file is assumed to be in the encoding specified, with
* two exceptions: * two exceptions:
* <ul> * <ul>
@ -546,15 +538,15 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* @param destination remote file that represents the file on the server * @param destination remote file that represents the file on the server
* @param encoding the encoding of the local copy * @param encoding the encoding of the local copy
* @param monitor the progress monitor * @param monitor the progress monitor
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the * Typically this would be one of those in the
* {@link RemoteFileException} family. * {@link RemoteFileException} family.
*/ */
public void upload(String source, IRemoteFile destination, String encoding, IProgressMonitor monitor) throws SystemMessageException; public void upload(String source, IRemoteFile destination, String encoding, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Put the local copy of the remote file back to the remote location. * Put the local copy of the remote file back to the remote location.
* *
* The file is assumed to be in the encoding of the local operating system, * The file is assumed to be in the encoding of the local operating system,
* with two exceptions: * with two exceptions:
* <ul> * <ul>
@ -567,15 +559,15 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* @param srcEncoding the encoding of the local copy * @param srcEncoding the encoding of the local copy
* @param remotePath remote file that represents the file on the server * @param remotePath remote file that represents the file on the server
* @param rmtEncoding the encoding of the remote file. * @param rmtEncoding the encoding of the remote file.
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the * Typically this would be one of those in the
* {@link RemoteFileException} family. * {@link RemoteFileException} family.
*/ */
public void upload(String source, String srcEncoding, String remotePath, String rmtEncoding, IProgressMonitor monitor) throws SystemMessageException; public void upload(String source, String srcEncoding, String remotePath, String rmtEncoding, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Put the local copies of the remote files to the remote locations. * Put the local copies of the remote files to the remote locations.
* *
* The files are assumed to be in the encodings specified, with * The files are assumed to be in the encodings specified, with
* two exceptions: * two exceptions:
* <ul> * <ul>
@ -588,8 +580,8 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* @param destinations remote files that represent the files on the server * @param destinations remote files that represent the files on the server
* @param encodings the encodings of the local copies * @param encodings the encodings of the local copies
* @param monitor the progress monitor * @param monitor the progress monitor
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the * Typically this would be one of those in the
* {@link RemoteFileException} family. * {@link RemoteFileException} family.
* @since 3.0 * @since 3.0
*/ */
@ -597,7 +589,7 @@ public interface IRemoteFileSubSystem extends ISubSystem {
/** /**
* Put the local copies of the remote files to the remote locations. * Put the local copies of the remote files to the remote locations.
* *
* The files are assumed to be in the encodings of the local operating system, * The files are assumed to be in the encodings of the local operating system,
* with two exceptions: * with two exceptions:
* <ul> * <ul>
@ -610,46 +602,46 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* @param srcEncodings the encodings of the local copies * @param srcEncodings the encodings of the local copies
* @param remotePaths remote files that represents the files on the server * @param remotePaths remote files that represents the files on the server
* @param rmtEncodings the encodings of the remote files. * @param rmtEncodings the encodings of the remote files.
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* Typically this would be one of those in the * Typically this would be one of those in the
* {@link RemoteFileException} family. * {@link RemoteFileException} family.
* @since 3.0 * @since 3.0
*/ */
public void uploadMultiple(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. * Returns a language utility factory associated with this subsystem.
* @return the language utility factory associated with this subsystem. * @return the language utility factory associated with this subsystem.
*/ */
public ILanguageUtilityFactory getLanguageUtilityFactory(); public ILanguageUtilityFactory getLanguageUtilityFactory();
/** /**
* Returns an unused port number on the remote host that could be used * Returns an unused port number on the remote host that could be used
* by any tool on the host. * by any tool on the host.
* @return an unused port number on the host, or -1 if none could be found. * @return an unused port number on the host, or -1 if none could be found.
*/ */
public int getUnusedPort(); public int getUnusedPort();
/** /**
* Return a list of roots/drives on the remote system. * Return a list of roots/drives on the remote system.
* This version is called by RemoteFileSubSystemImpl's resolveFilterString(s) * 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 * <b>note</b>This method should be abstract but MOF doesn't allow abstract impl classes at this point
*/ */
public IRemoteFile[] listRoots(IRemoteFileContext context, IProgressMonitor monitor) throws InterruptedException; public IRemoteFile[] listRoots(IRemoteFileContext context, IProgressMonitor monitor) throws InterruptedException;
/** /**
* Returns the TCP/IP address for the local system that is accessible from * Returns the TCP/IP address for the local system that is accessible from
* the remote server. If the local system has multiple IP addresses (because of multiple * the remote server. If the local system has multiple IP addresses (because of multiple
* network cards or VPN), then this will return the address that the remote system * network cards or VPN), then this will return the address that the remote system
* can use to "call back" to the PC. There must be a network connection between the local * can use to "call back" to the PC. There must be a network connection between the local
* system and the remote system for this method to work. If no network connection exists, * system and the remote system for this method to work. If no network connection exists,
* then this method returns <code>null</code>. * then this method returns <code>null</code>.
* *
* @return the local TCP/IP address accessible from the remote system, or <code>null</code> if * @return the local TCP/IP address accessible from the remote system, or <code>null</code> if
* no address can be resolved. * no address can be resolved.
*/ */
public InetAddress getLocalAddress(); public InetAddress getLocalAddress();
/** /**
* Gets the input stream to access the contents a remote file. Clients should close the input stream when done. Implementations should not return <code>null</code>. * Gets the input stream to access the contents a remote file. Clients should close the input stream when done. Implementations should not return <code>null</code>.
* @param remoteParent the absolute path of the parent. * @param remoteParent the absolute path of the parent.
@ -657,11 +649,11 @@ public interface IRemoteFileSubSystem extends ISubSystem {
* @param isBinary <code>true</code> if the file is a binary file, <code>false</code> otherwise. * @param isBinary <code>true</code> if the file is a binary file, <code>false</code> otherwise.
* @return the input stream to access the contents of the remote file. * @return the input stream to access the contents of the remote file.
* @param monitor the progress monitor. * @param monitor the progress monitor.
* @throws SystemMessageException if an error occurs. * @throws SystemMessageException if an error occurs.
* @since 2.0 * @since 2.0
*/ */
public InputStream getInputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor) throws SystemMessageException; public InputStream getInputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor) throws SystemMessageException;
/** /**
* Gets the output stream to write to a remote file. Clients should close the output stream when done. Implementations should not return <code>null</code>. * Gets the output stream to write to a remote file. Clients should close the output stream when done. Implementations should not return <code>null</code>.
* @param remoteParent the absolute path of the parent. * @param remoteParent the absolute path of the parent.
@ -689,10 +681,10 @@ public interface IRemoteFileSubSystem extends ISubSystem {
/** /**
* Indicates whether this file subsystem supports code page conversion using * Indicates whether this file subsystem supports code page conversion using
* the IFileServiceCodePageConverter mechanism. Certain extensions, such as * the IFileServiceCodePageConverter mechanism. Certain extensions, such as
* property pages for encoding conversion can determine whether or not to * property pages for encoding conversion can determine whether or not to
* display or enable themselves based on result of this call. * display or enable themselves based on result of this call.
* *
* @return whether this service supports encoding conversion * @return whether this service supports encoding conversion
* @since 3.0 * @since 3.0
*/ */

View file

@ -26,6 +26,7 @@
* David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
* David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared * David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
* Martin Oberhuber (Wind River) - [218304] Improve deferred adapter loading * Martin Oberhuber (Wind River) - [218304] Improve deferred adapter loading
* Martin Oberhuber (Wind River) - [226574][api] Add ISubSystemConfiguration#supportsEncoding()
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.subsystems.files.core.subsystems; package org.eclipse.rse.subsystems.files.core.subsystems;
@ -1035,10 +1036,10 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi
/** /**
* Return the object within the subsystem that corresponds to the specified * Return the object within the subsystem that corresponds to the specified
* unique ID. * unique ID.
* *
* For remote files, assuming the key is the absolute path of a file, this * For remote files, assuming the key is the absolute path of a file, this
* is simply a wrapper to getRemoteFileObject(). * is simply a wrapper to getRemoteFileObject().
* *
* @see SubSystem#getObjectWithAbsoluteName(String, IProgressMonitor) * @see SubSystem#getObjectWithAbsoluteName(String, IProgressMonitor)
*/ */
public Object getObjectWithAbsoluteName(String key, IProgressMonitor monitor) throws Exception public Object getObjectWithAbsoluteName(String key, IProgressMonitor monitor) throws Exception
@ -1443,15 +1444,6 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi
} }
/**
* Returns <code>true</code> by default. Subclasses should override if they do not support encodings.
* @see org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem#supportsEncoding()
* @since 2.0
*/
public boolean supportsEncoding() {
return true;
}
/** /**
* Returns the local platform encoding if the default encoding of the host was not set. * Returns the local platform encoding if the default encoding of the host was not set.
* Subclasses should override to return the actual remote encoding. * Subclasses should override to return the actual remote encoding.