Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'rse/plugins/org.eclipse.rse.services/src/org/eclipse')
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/Activator.java117
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/IService.java29
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/Mutex.java168
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/AbstractFileService.java98
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/IFileService.java267
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/IHostFile.java156
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileCancelledException.java66
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileException.java122
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileIOException.java71
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileSecurityException.java70
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFolderNotEmptyException.java71
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/processes/AbstractHostProcess.java299
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/processes/AbstractProcessService.java94
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/processes/IProcessService.java126
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/AbstractSearchResult.java252
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/AbstractSearchResultConfiguration.java223
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/AbstractSearchService.java51
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/HostSearchResultSet.java292
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchConstants.java40
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchResult.java94
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchResultConfiguration.java141
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchResultConfigurationFactory.java24
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchResultSet.java147
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/ISearchHandler.java25
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/ISearchService.java27
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/AbstractHostShell.java37
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/AbstractHostShellOutputReader.java188
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/CommandPattern.java60
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/HostShellChangeEvent.java67
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/HostShellOutputStream.java67
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/HostShellProcessAdapter.java169
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostOutput.java20
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShell.java32
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellChangeEvent.java25
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellOutputListener.java22
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellOutputNotifier.java23
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellOutputReader.java26
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IShellService.java77
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/OutputPattern.java98
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/ParsedOutput.java38
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/Patterns.java120
-rw-r--r--rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/SimpleHostOutput.java33
42 files changed, 0 insertions, 4172 deletions
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/Activator.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/Activator.java
deleted file mode 100644
index b6833c4da..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/Activator.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class Activator extends Plugin {
-
- //The shared instance.
- private static Activator plugin;
-
- /**
- * The constructor.
- */
- public Activator() {
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- }
-
- /**
- * Returns the shared instance.
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- /**
- * Logs an throwable to the log for this plugin.
- * @param t the Throwable to be logged.
- */
- public void logException(Throwable t) {
- ILog log = getLog();
- String id = getBundle().getSymbolicName();
- IStatus status = new Status(IStatus.ERROR, id, 0, "Unexpected exception", t);
- log.log(status);
- }
-
- //<tracing code>----------------------------------------------------
-
- private static Boolean fTracingOn = null;
- public static boolean isTracingOn() {
- if (fTracingOn==null) {
- String id = plugin.getBundle().getSymbolicName();
- String val = Platform.getDebugOption(id + "/debug"); //$NON-NLS-1$
- if ("true".equals(val)) { //$NON-NLS-1$
- fTracingOn = Boolean.TRUE;
- } else {
- fTracingOn = Boolean.FALSE;
- }
- }
- return fTracingOn.booleanValue();
- }
- public static String getTimestamp() {
- try {
- DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); //$NON-NLS-1$
- return formatter.format(new Date());
- } catch (Exception e) {
- // If there were problems writing out the date, ignore and
- // continue since that shouldn't stop us from logging the rest
- // of the information
- }
- return Long.toString(System.currentTimeMillis());
- }
- public static void trace(String msg) {
- if (isTracingOn()) {
- String fullMsg = getTimestamp() + " | " + Thread.currentThread().getName() + " | " + msg; //$NON-NLS-1$ //$NON-NLS-2$
- System.out.println(fullMsg);
- System.out.flush();
- }
- }
-
- //</tracing code>---------------------------------------------------
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/IService.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/IService.java
deleted file mode 100644
index 70e3c5a91..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/IService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-
-public interface IService
-{
- public String getName();
- public String getDescription();
- public void initService(IProgressMonitor monitor);
- public void uninitService(IProgressMonitor monitor);
- public SystemMessage getMessage(String messageID);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/Mutex.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/Mutex.java
deleted file mode 100644
index 60816c069..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/Mutex.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Wind River Systems, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Martin Oberhuber (Wind River) - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.rse.services;
-
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-/**
- * A Mutual Exclusion Lock for Threads that need to access a resource
- * in a serialized manner.
- *
- * Usage Example:
- * <code>
- * private Mutex fooMutex;
- * boolean doFooSerialized()(IProgressMonitor monitor) {
- * if (fooMutex.waitForLock(monitor, 1000)) {
- * try {
- * return doFoo();
- * } finally {
- * fooMutex.release();
- * }
- * }
- * return false;
- * }
- * </code>
- */
-public class Mutex {
-
- private boolean fLocked = false;
- private List fWaitQueue = new LinkedList();
-
- /**
- * Try to acquire the lock maintained by this mutex.
- *
- * If the thread needs to wait before it can acquire the mutex, it
- * will wait in a first-come-first-serve fashion. In case a progress
- * monitor was given, it will be updated and checked for cancel every
- * second.
- *
- * @param monitor Eclipse Progress Monitor. May be <code>null</code>.
- * @param timeout Maximum wait time given in milliseconds.
- * @return <code>true</code> if the lock was obtained successfully.
- */
- public boolean waitForLock(IProgressMonitor monitor, long timeout) {
- if (Thread.interrupted()) {
- return false;
- }
- final Thread myself = Thread.currentThread();
- synchronized(fWaitQueue) {
- if (!fLocked) {
- //acquire the lock immediately.
- fLocked = true;
- return true;
- } else {
- fWaitQueue.add(myself);
- Activator.trace("Mutex: added "+myself+", size="+fWaitQueue.size()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- //need to wait for the lock.
- boolean lockAcquired = false;
- try {
- long start = System.currentTimeMillis();
- long timeLeft = timeout;
- long pollTime = (monitor!=null) ? 1000 : timeLeft;
- long nextProgressUpdate = start+500;
- boolean canceled = false;
- while (timeLeft>0 && !canceled && !lockAcquired) {
- //is it my turn yet? Check wait queue and wait
- synchronized(fWaitQueue) {
- if (!fLocked && fWaitQueue.get(0) == myself) {
- fWaitQueue.remove(0);
- Activator.trace("Mutex: SUCCESS, removed "+myself+", size="+fWaitQueue.size()); //$NON-NLS-1$ //$NON-NLS-2$
- fLocked = true;
- lockAcquired = true;
- } else {
- fWaitQueue.wait(timeLeft > pollTime ? pollTime : timeLeft);
- if (!fLocked && fWaitQueue.get(0) == myself) {
- fWaitQueue.remove(0);
- Activator.trace("Mutex: SUCCESS, removed "+myself+", size="+fWaitQueue.size()); //$NON-NLS-1$ //$NON-NLS-2$
- fLocked = true;
- lockAcquired = true;
- }
- }
- }
- if (!lockAcquired) {
- //Need to continue waiting
- Activator.trace("Mutex: wakeup "+myself+" ?"); //$NON-NLS-1$ //$NON-NLS-2$
- long curTime = System.currentTimeMillis();
- timeLeft = start + timeout - curTime;
- if (monitor!=null) {
- canceled = monitor.isCanceled();
- if (!canceled && (curTime>nextProgressUpdate)) {
- monitor.worked(1);
- nextProgressUpdate+=1000;
- }
- }
- }
- }
- } catch(InterruptedException e) {
- //canceled waiting -> no lock aquired
- } finally {
- if (!lockAcquired) {
- synchronized(fWaitQueue) {
- fWaitQueue.remove(myself);
- Activator.trace("Mutex: FAIL, removed "+myself+", size="+fWaitQueue.size()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
- return lockAcquired;
- }
-
- /**
- * Release this mutex's lock.
- *
- * May only be called by the same thread that originally acquired
- * the Mutex.
- */
- public void release() {
- synchronized(fWaitQueue) {
- fLocked=false;
- if (!fWaitQueue.isEmpty()) {
- Object nextOneInQueue = fWaitQueue.get(0);
- Activator.trace("Mutex: releasing "+nextOneInQueue); //$NON-NLS-1$
- fWaitQueue.notifyAll();
- }
- }
- }
-
- /**
- * Return this Mutex's lock status.
- * @return <code>true</code> if this mutex is currently acquired by a thread.
- */
- public boolean isLocked() {
- synchronized(fWaitQueue) {
- return fLocked;
- }
- }
-
- /**
- * Interrupt all threads waiting for the Lock, causing their
- * {@link #waitForLock(IProgressMonitor, long)} method to return
- * <code>false</code>.
- * This should be called if the resource that the Threads are
- * contending for, becomes unavailable for some other reason.
- */
- public void interruptAll() {
- synchronized(fWaitQueue) {
- Iterator it = fWaitQueue.iterator();
- while (it.hasNext()) {
- Thread aThread = (Thread)it.next();
- aThread.interrupt();
- }
- }
- }
-
-}
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/AbstractFileService.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/AbstractFileService.java
deleted file mode 100644
index 3044c7269..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/AbstractFileService.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.files;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-
-
-public abstract class AbstractFileService implements IFileService
-{
-
- public static final int FILE_TYPE_FILES_AND_FOLDERS = 0;
- public static final int FILE_TYPE_FILES = 1;
- public static final int FILE_TYPE_FOLDERS = 2;
-
- public IHostFile[] getFiles(IProgressMonitor monitor, String remoteParent, String fileFilter) throws SystemMessageException
- {
- return internalFetch(monitor, remoteParent, fileFilter, FILE_TYPE_FILES);
- }
-
- public IHostFile[] getFolders(IProgressMonitor monitor, String remoteParent, String fileFilter) throws SystemMessageException
- {
- return internalFetch(monitor, remoteParent, fileFilter, FILE_TYPE_FOLDERS);
- }
-
- public IHostFile[] getFilesAndFolders(IProgressMonitor monitor, String parentPath, String fileFilter) throws SystemMessageException
- {
- return internalFetch(monitor, parentPath, fileFilter, FILE_TYPE_FILES_AND_FOLDERS);
- }
-
- protected abstract IHostFile[] internalFetch(IProgressMonitor monitor, String parentPath, String fileFilter, int fileType) throws SystemMessageException;
-
-
- protected boolean isRightType(int fileType, IHostFile node)
- {
- switch (fileType)
- {
- case FILE_TYPE_FILES_AND_FOLDERS:
- return true;
- case FILE_TYPE_FILES:
- if (node.isFile())
- {
- return true;
- }
- else
- {
- return false;
- }
- case FILE_TYPE_FOLDERS:
- if (node.isDirectory())
- {
- return true;
- }
- else
- {
- return false;
- }
- default:
- return true;
- }
- }
-
- /**
- * Dummy impl for now
- */
- public SystemMessage getMessage(String messageID)
- {
- return null;
- }
-
- public boolean deleteBatch(IProgressMonitor monitor, String[] remoteParents, String[] fileNames) throws SystemMessageException
- {
- boolean ok = true;
- for (int i = 0; i < remoteParents.length; i++)
- {
- ok = ok && delete(monitor, remoteParents[i], fileNames[i]);
- }
- return ok;
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/IFileService.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/IFileService.java
deleted file mode 100644
index b7867b584..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/IFileService.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.files;
-
-import java.io.File;
-import java.io.InputStream;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.rse.services.IService;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-
-
-/**
- * A IFileService is an abstraction of a file service that runs over some sort of connection.
- * It can be shared among multiple instances of a subsystem. At some point this file
- * service layer may become official API but for now it is experimental. Each
- * subsystem is currently responsible for layering an abstraction over whatever it
- * wants to construct as a service.
- * <p>
- * This is a very bare bones definition. A real definition would probably have changed
- * terminology, use URI's rather than Strings, and have much more robust error handling.
- * <p>
- * Implementers of this interface will have to either be instantiated, initialized, or
- * somehow derive a connection as part of its state.
- */
-public interface IFileService extends IService
-{
-
- /**
- * Copy a file to the remote file system. The remote target is denoted by a
- * string representing the parent and a string representing the file.
- * @param monitor the monitor for this potentially long running operation
- * @param stream input stream to transfer
- * @param remoteParent - a string designating the parent folder of the target for this file.
- * @param remoteFile - a string designating the name of the file to be written on the remote system.
- * @param isBinary - indicates whether the file is text or binary
- * @param hostEncoding - the tgt encoding of the file (if text)
- * @return true if the file was uploaded
- * @throws SystemMessageException if an error occurs.
- * Typically this would be one of those in the RemoteFileException family.
- */
- public boolean upload(IProgressMonitor monitor, InputStream stream, String remoteParent, String remoteFile, boolean isBinary, String hostEncoding) throws SystemMessageException;
-
- /**
- * Copy a file to the remote file system. The remote target is denoted by a
- * string representing the parent and a string representing the file.
- * @param monitor the monitor for this potentially long running operation
- * @param localFile - a real file in the local file system.
- * @param remoteParent - a string designating the parent folder of the target for this file.
- * @param remoteFile - a string designating the name of the file to be written on the remote system.
- * @param isBinary - indicates whether the file is text or binary
- * @param srcEncoding - the src encoding of the file (if text)
- * @param hostEncoding - the tgt encoding of the file (if text)
- * @return true if the file was uploaded
- * @throws SystemMessageException if an error occurs.
- * Typically this would be one of those in the RemoteFileException family.
- */
- public boolean upload(IProgressMonitor monitor, File localFile, String remoteParent, String remoteFile, boolean isBinary, String srcEncoding, String hostEncoding) throws SystemMessageException;
-
- /**
- * Copy a file from the remote file system to the local system.
- * @param monitor the monitor for this potentially long running operation
- * @param remoteParent - a String designating the remote parent.
- * @param remoteFile - a String designating the remote file residing in the parent.
- * @param localFile - The file that is to be written. If the file exists it is
- * overwritten.
- * @param isBinary - indicates whether the file is text on binary
- * @param hostEncoding - the encoding on the host (if text)
- * @return true if the file was copied from the remote system.
- * @throws SystemMessageException if an error occurs.
- * Typically this would be one of those in the RemoteFileException family.
- */
- public boolean download(IProgressMonitor monitor, String remoteParent, String remoteFile, File localFile, boolean isBinary, String hostEncoding) throws SystemMessageException;
-
- /**
- * @param monitor the monitor for this potentially long running operation
- * @param remoteParent
- * @param name
- * @return the host file given the parent path and file name
- * @throws SystemMessageException if an error occurs.
- * Typically this would be one of those in the RemoteFileException family.
- */
- public IHostFile getFile(IProgressMonitor monitor, String remoteParent, String name) throws SystemMessageException;
-
- /**
- * @param monitor the monitor for this potentially long running operation
- * @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.
- * @return the list of host files.
- * @throws SystemMessageException if an error occurs.
- * Typically this would be one of those in the RemoteFileException family.
- */
- public IHostFile[] getFilesAndFolders(IProgressMonitor monitor, String remoteParent, String fileFilter) throws SystemMessageException;
-
- /**
- * @param monitor the monitor for this potentially long running operation
- * @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.
- * @return the list of host files.
- * @throws SystemMessageException if an error occurs.
- * Typically this would be one of those in the RemoteFileException family.
- */
- public IHostFile[] getFiles(IProgressMonitor monitor, String remoteParent, String fileFilter) throws SystemMessageException;
-
- /**
- * @param monitor the monitor for this potentially long running operation
- * @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.
- * @return the list of host files.
- * @throws SystemMessageException if an error occurs.
- * Typically this would be one of those in the RemoteFileException family.
- */
- public IHostFile[] getFolders(IProgressMonitor monitor, String remoteParent, String fileFilter) throws SystemMessageException;
-
- /**
- * @param monitor the monitor for this potentially long running operation
- * Return the list of roots for this system
- * @return the list of host files.
- * @throws SystemMessageException if an error occurs.
- * Typically this would be one of those in the RemoteFileException family.
- */
- public IHostFile[] getRoots(IProgressMonitor monitor) throws SystemMessageException;
-
- /**
- * @return the String containing the name of the user's home directory on this
- * connection that would be contained in implementations of this service.
- */
- public IHostFile getUserHome();
-
- /**
- * Create a file on the host
- * @param monitor the monitor for this potentially long running operation
- * @param remoteParent the parent directory
- * @param fileName the name of the new file
- * @return the newly created file
- * @throws SystemMessageException if an error occurs.
- * Typically this would be one of those in the RemoteFileException family.
- */
- public IHostFile createFile(IProgressMonitor monitor, String remoteParent, String fileName) throws SystemMessageException;
-
- /**
- * Create a folder on the host
- * @param monitor the progress monitor
- * @param remoteParent the parent directory
- * @param folderName the name of the new folder
- * @return the newly created folder
- * @throws SystemMessageException if an error occurs.
- * Typically this would be one of those in the RemoteFileException family.
- */
- public IHostFile createFolder(IProgressMonitor monitor, String remoteParent, String folderName) throws SystemMessageException;
-
- /**
- * Deletes a file or folder on the host
- * @param monitor the progress monitor
- * @param remoteParent the folder containing the file to delete
- * @param fileName the name of the file or folder to delete
- * @return true if successful
- * @throws SystemMessageException if an error occurs.
- * Typically this would be one of those in the RemoteFileException family.
- */
- public boolean delete(IProgressMonitor monitor, String remoteParent, String fileName) throws SystemMessageException;
-
- /**
- * Deletes a set of files or folders on the host. Should throw an exception if some files and folders were deleted and others were not
- * due to an exception during the operation. Without an exception thrown in such cases, views may not be refreshed correctly to account
- * for deleted resources.
- * @param monitor the progress monitor
- * @param remoteParents the array of folders containing the files to delete
- * @param fileNames the names of the files or folders to delete
- * @return true iff all deletes are successful
- * @throws SystemMessageException if an error occurs.
- * Typically this would be one of those in the RemoteFileException family.
- */
- public boolean deleteBatch(IProgressMonitor monitor, String[] remoteParents, String[] fileNames) throws SystemMessageException;
-
- /**
- * Renames a file or folder on the host
- * @param monitor the progress monitor
- * @param remoteParent the folder containing the file to rename
- * @param oldName the old name of the file or folder to rename
- * @param newName the new name for the file
- * @return true if successful
- * @throws SystemMessageException if an error occurs.
- * Typically this would be one of those in the RemoteFileException family.
- */
- public boolean rename(IProgressMonitor monitor, String remoteParent, String oldName, String newName) throws SystemMessageException;
-
- /**
- * Renames a file or folder on the host
- * @param monitor the progress monitor
- * @param remoteParent the folder containing the file to rename
- * @param oldName the old name of the file or folder to rename
- * @param newName the new name for the file
- * @param oldFile the file to update with the change
- * @return true if successful
- * @throws SystemMessageException if an error occurs.
- * Typically this would be one of those in the RemoteFileException family.
- */
- public boolean rename(IProgressMonitor monitor, String remoteParent, String oldName, String newName, IHostFile oldFile) throws SystemMessageException;
-
- /**
- * Move the file or folder specified
- * @param monitor the progress monitor
- * @param srcParent the folder containing the file or folder to move
- * @param srcName the new of the file or folder to move
- * @param tgtParent the destination folder for the move
- * @param tgtName the name of the moved file or folder
- * @return true if the file was moved
- * @throws SystemMessageException if an error occurs.
- * Typically this would be one of those in the RemoteFileException family.
- */
- public boolean move(IProgressMonitor monitor, String srcParent, String srcName, String tgtParent, String tgtName) throws SystemMessageException;
-
- /**
- * Copy the file or folder to the specified destination
- * @param monitor the progress monitor
- * @param srcParent the folder containing the file or folder to copy
- * @param srcName the new of the file or folder to copy
- * @param tgtParent the destination folder for the copy
- * @param tgtName the name of the copied file or folder
- * @return true if the file was copied successfully
- * @throws SystemMessageException if an error occurs.
- * Typically this would be one of those in the RemoteFileException family.
- */
- public boolean copy(IProgressMonitor monitor, String srcParent, String srcName, String tgtParent, String tgtName) throws SystemMessageException;
-
- /**
- * Copy a set of files or folders to the specified destination
- * @param monitor the progress monitor
- * @param srcParents the folders containing each file or folder to copy
- * @param srcNames the names of the files or folders to copy
- * @param tgtParent the destination folder for the copy
- * @return true if all files were copied
- * @throws SystemMessageException if an error occurs.
- * Typically this would be one of those in the RemoteFileException family.
- */
- public boolean copyBatch(IProgressMonitor monitor, String[] srcParents, String[] srcNames, String tgtParent) throws SystemMessageException;
-
- /**
- * Indicates whether the file system is case sensitive
- * @return true if the file system has case sensitive file names
- */
- public boolean isCaseSensitive();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/IHostFile.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/IHostFile.java
deleted file mode 100644
index 6e4d1947c..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/IHostFile.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.files;
-
-/**
- * Objects that conform to this interface are delivered by the file services to their clients.
- * These objects are meant to represent objects that are files or file-like objects on a
- * remote system. These would include files, folders, directories, archives and the like.
- * <p>
- * These objects are typically "handle" objects and can be created even though their corresponding
- * remote resources do not exist - in this case, the {@link #exists()} method will return
- * <code>false</code>.
- * <p>
- * @see IFileService
- */
-public interface IHostFile {
- /**
- * Gets the simple name of the file object on the remote system.
- * @return The name of the file object on the remote system devoid of any qualifying path
- * information.
- */
- public String getName();
-
- /**
- * Gets the absolute path name of the parent object of this object on the remote file system.
- * @return The fully qualified path of any parent object for this file. This would typically be the
- * string representation of the absolute path as interpreted by the remote file system. Returns
- * <code>null</code> if {@link #isRoot()} is true.
- */
- public String getParentPath();
-
- /**
- * Gets the fully qualified path to this object in the remote file system. The name is constructed
- * as it would be used on the remote file system.
- * @return a string representing the path name. This string can be interpreted and used by its file service
- * to locate this object on the remote file system beginning
- * at the file system root.
- */
- public String getAbsolutePath();
-
- /**
- * Determines if the file system object is hidden on the remote file system.
- * @return true if and only if the file on the remote system has a "hidden" attribute or a naming
- * convention that would normal indicate that it was hidden when listing the contents of its parent
- * on that file system. It is up to the file services to conform to the correct notion of "hidden" for
- * the remote systems they support.
- */
- public boolean isHidden();
-
- /**
- * Determines if the file system object is a directory on the remote file system.
- * @return true if and only if the object on the remote system is a directory. That is, it contains
- * entries that can be interpreted as other IHostFile objects. A return value of true does not
- * necessarily imply that isFile() returns false.
- */
- public boolean isDirectory();
-
- /**
- * Determines if the file system object is a "root" directory on the remote file system.
- * @return true if and only if the object on the remote system is a directory whose simple name and
- * absolute path name are the same.
- */
- public boolean isRoot();
-
- /**
- * Determines if the file system object is a file on the remote file system.
- * @return true if and only if the object on the remote system can be considered to have "contents" that
- * have the potential to be read and written as a byte or character stream. A return value of true
- * does not necessarily imply that {@link #isDirectory()} returns false.
- */
- public boolean isFile();
-
- /**
- * Determines if the file system object is "writeable" on the remote file system.
- * @return true if and only if the object on the remote system is a file that can be written. This could
- * mean that there is write permission granted to this user or perhaps a "writable" attribute is set for the
- * file. It is up to the file services to conform to the correct notion of "writable" for the remote
- * systems they support. For directory objects this should return true if the child objects may be added
- * to or removed from the directory.
- */
- public boolean canWrite();
-
- /**
- * Determines if the file system object is "readable" on the remote file system.
- * @return true if and only if the object on the remote system is a file that can be read. This could
- * mean that there is read permission granted to this user or perhaps a "readable" attribute is set for the
- * file. It is up to the file services to conform to the correct notion of "readable" for the remote
- * systems they support. For directory objects this should return true if the user can determine the children
- * of the directory.
- */
- public boolean canRead();
-
- /**
- * Determines if the file system object exists on the remote file system.
- * @return true if and only if the remote object represented by this object exists
- * in the remote file system. Symbolic links on a UNIX file system exist even if
- * the target they point to does not exist.
- */
- public boolean exists();
-
- /**
- * Determines if the file system object represents an archive on the remote file system.
- * @return true if and only if the remote object is a file that can be "extracted" to contain other files.
- * Examples would be tar and zip files. It is up to the file services to conform to the correct notion of
- * "archive" for the remote systems they support. If a file service creates an object with
- * this attribute as true then the file service must be able to extract the contents of the archive.
- */
- public boolean isArchive();
-
- /**
- * Gets the size of the file system object on the remote file system in bytes if isFile() is true.
- * If the storage unit on the remote system is not bytes then the file service creating this must
- * convert the remote value to bytes.
- * @return the size in bytes of the file if {@link #isFile()} is true, 0L otherwise.
- */
- public long getSize();
-
- /**
- * Gets a timestamp representing the date and time of last modification to the file.
- * @return the timestamp as obtained from the remote file system.
- * The timestamp represents the time the file was modified in milliseconds from January 1, 1970, 00:00:00 UTC.
- * Note that even so, comparison of timestamps between systems should be avoided since clock resolution and
- * accuracy vary widely from system to system.
- * It may be necessary to convert from the timestamp of a remote file system to this format.
- */
- public long getModifiedDate();
-
- /**
- * Renames this abstract file handle.
- *
- * This does not physically rename the corresponding file on the
- * remote system, it merely updates internal bookkeeping for a
- * rename operation that needs to be performed separately through
- * an instance of @see IFileService.
- *
- * Therefore, this method cannot fail and no return value is given.
- *
- * @param newAbsolutePath The new path on the remote file system that
- * this file will be renamed to.
- */
- public void renameTo(String newAbsolutePath);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileCancelledException.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileCancelledException.java
deleted file mode 100644
index c0a6b8d87..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileCancelledException.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.files;
-
-import org.eclipse.rse.services.clientserver.messages.IndicatorException;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-
-/**
- * Exception thrown when attempting an operation and it fails for IO reasons, such as
- * the file is read-only.
- * <p>
- * The original remote system's io message is always embedded and retrievable
- * via getRemoteException().
- */
-public class RemoteFileCancelledException extends RemoteFileIOException {
-
- /**
- * A serialVersionUID is recommended for all serializable classes.
- * This trait is inherited from Throwable.
- * This should be updated if there is a schema change for this class.
- */
- private static final long serialVersionUID = 1L;
- private static SystemMessage myMessage = null;
-
- /**
- * Constructor
- */
- public RemoteFileCancelledException() {
- super(new SystemMessageException(getMyMessage()));
- }
-
- /*
- * TODO dwd update this to retrieve the new messages when those are created
- * myMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_CANCELLED);
- * public static final String MSG_OPERATION_CANCELLED = "RSEG1067";
- * <Message ID="1067" Indicator="E">
- * <LevelOne>Operation cancelled.</LevelOne>
- * <LevelTwo></LevelTwo>
- * </Message>
- */
- private static SystemMessage getMyMessage() {
- String l1 = "Operation cancelled.";
- String l2 = "";
- try {
- myMessage = new SystemMessage("RSE", "G", "1067", SystemMessage.ERROR, l1, l2);
- } catch (IndicatorException e) {
- }
- return myMessage;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileException.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileException.java
deleted file mode 100644
index 19dca2a16..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileException.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.files;
-import java.util.ResourceBundle;
-
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-
-
-/**
- * Base class for remote file system exceptions.
- * <p>
- * All remote file exceptions are guaranteed to have a translated message retrievable
- * via getMessage(), to make it easy to display to the user.
- * <p>
- * All child exceptions potentially contain an imbedded exception that
- * is the original exception from the remote system.
- * <p>
- * Use {#link getRemoteException()} to retrieve that wrapped exception, if any.
- */
-public class RemoteFileException extends SystemMessageException
-{
- /**
- * A serialVersionUID is recommended for all serializable classes.
- * This trait is inherited from Throwable.
- * This should be updated if there is a schema change for this class.
- */
- private static final long serialVersionUID = 1L;
- private Exception wrappedException = null;
-
- /**
- * Constructor for RemoteFileException with an error message for getMessage() to return.
- * @param bundle The ResourceBundle containing the error message
- * @param key The key to retrieve the message
- */
- public RemoteFileException(ResourceBundle bundle, String key)
- {
- this(getString(bundle,key), null);
- }
- /**
- * Constructor for RemoteFileException with an error message for getMessage() to return.
- * @param msg The fully resolved message
- */
- public RemoteFileException(String msg)
- {
- this(msg, null);
- }
- /**
- * Constructor for RemoteFileException with an error message for getMessage() to return,
- * and a wrapped exception to contain. It is accessed via getRemoteException().
- * @param bundle The ResourceBundle containing the error message
- * @param key The key to retrieve the message
- * @param remoteException The exception to contain within this exception
- */
- public RemoteFileException(ResourceBundle bundle, String key, Exception remoteException)
- {
- this(getString(bundle,key), remoteException);
- }
- /**
- * Constructor for RemoteFileException with an error message for getMessage() to return.
- * and a wrapped exception to contain. It is accessed via getRemoteException().
- * @param msg The fully resolved message
- * @param remoteException The exception to contain within this exception
- */
- public RemoteFileException(String msg, Exception remoteException)
- {
- super(msg);
- wrappedException = remoteException;
- }
-
- /**
- * Constructor for RemoteFileException with an error message for getMessage() to return.
- * @param msg The fully resolved message
- */
- public RemoteFileException(SystemMessage msg)
- {
- this(msg, null);
- }
- /**
- * Constructor for RemoteFileException with an error message for getMessage() to return.
- * and a wrapped exception to contain. It is accessed via getRemoteException().
- * @param msg The fully resolved message
- * @param remoteException The exception to contain within this exception
- */
- public RemoteFileException(SystemMessage msg, Exception remoteException)
- {
- super(msg);
- wrappedException = remoteException;
- }
- /**
- * @return the original remote exception
- */
- public Exception getRemoteException()
- {
- return wrappedException;
- }
-
-
- private static String getString(ResourceBundle bundle, String key)
- {
- String msg = null;
- try { msg = bundle.getString(key); } catch (Exception exc) {}
- if (msg == null)
- msg = "Message with key " + key + " not found";
- return msg;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileIOException.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileIOException.java
deleted file mode 100644
index 870577c61..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileIOException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.files;
-
-import org.eclipse.rse.services.clientserver.messages.IndicatorException;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-
-/**
- * Exception thrown when attempting an operation and it fails for IO reasons, such as
- * the file is read-only.
- * <p>
- * The original remote system's io message is always embedded and retrievable
- * via getRemoteException().
- */
-public class RemoteFileIOException extends RemoteFileException {
-
- /**
- * A serialVersionUID is recommended for all serializable classes.
- * This trait is inherited from Throwable.
- * This should be updated if there is a schema change for this class.
- */
- private static final long serialVersionUID = 1L;
- private static SystemMessage myMessage = null;
-
- /**
- * Constructor for RemoteFileIOException
- * @param remoteException the initial cause of this exception
- */
- public RemoteFileIOException(Exception remoteException) {
- super(getMyMessage(), remoteException);
- String secondLevel = remoteException.getMessage();
- if (secondLevel == null) {
- secondLevel = remoteException.getClass().getName();
- }
- getSystemMessage().makeSubstitution(secondLevel);
- }
-
- /*
- * TODO dwd update this to retrieve the new messages when those are created
- * myMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_IO_ERROR);
- * public static final String FILEMSG_IO_ERROR = "RSEF1002";
- * <Message ID="1002" Indicator="E">
- * <LevelOne>Operation failed. File system input or output error</LevelOne>
- * <LevelTwo>Message reported from file system: %1</LevelTwo>
- * </Message>
- */
- private static SystemMessage getMyMessage() {
- String l1 = "Operation failed. File system input or output error";
- String l2 = "Message reported from file system: %1";
- try {
- myMessage = new SystemMessage("RSE", "F", "1002", SystemMessage.ERROR, l1, l2);
- } catch (IndicatorException e) {
- }
- return myMessage;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileSecurityException.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileSecurityException.java
deleted file mode 100644
index 5d34cdd88..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFileSecurityException.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.files;
-
-import org.eclipse.rse.services.clientserver.messages.IndicatorException;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-
-/**
- * Exception thrown when attempting an operation and it fails for security reasons.
- * The original remote system's security message is always embedded and retrievable
- * via getRemoteException().
- */
-public class RemoteFileSecurityException extends RemoteFileException {
-
- /**
- * A serialVersionUID is recommended for all serializable classes.
- * This trait is inherited from Throwable.
- * This should be updated if there is a schema change for this class.
- */
- private static final long serialVersionUID = 1L;
- private static SystemMessage myMessage = null;
-
- /**
- * Constructor
- * @param remoteException the original cause of this exception.
- */
- public RemoteFileSecurityException(Exception remoteException) {
- super(getMyMessage(), remoteException);
- String secondLevel = remoteException.getMessage();
- if (secondLevel == null) {
- secondLevel = remoteException.getClass().getName();
- }
- getSystemMessage().makeSubstitution(secondLevel);
- }
-
- /*
- * TODO dwd update this to retrieve the new messages when those are created
- * super(RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_SECURITY_ERROR), remoteException);
- * public static final String FILEMSG_SECURITY_ERROR = "RSEF1001";
- * <Message ID="1001" Indicator="E">
- * <LevelOne>Operation failed. Security violation</LevelOne>
- * <LevelTwo>Message reported from file system: %1</LevelTwo>
- * </Message>
- */
- private static SystemMessage getMyMessage() {
- if (myMessage == null) {
- String l1 = "Operation failed. Security violation";
- String l2 = "Message reported from file system: %1";
- try {
- myMessage = new SystemMessage("RSE", "F", "1001", SystemMessage.ERROR, l1, l2);
- } catch (IndicatorException e) {
- }
- }
- return myMessage;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFolderNotEmptyException.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFolderNotEmptyException.java
deleted file mode 100644
index dd976b132..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/RemoteFolderNotEmptyException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.files;
-
-import org.eclipse.rse.services.clientserver.messages.IndicatorException;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-
-/**
- * Exception thrown when attempting to delete a folder, and the folder is not empty.
- */
-public class RemoteFolderNotEmptyException extends RemoteFileException {
-
- /**
- * A serialVersionUID is recommended for all serializable classes.
- * This trait is inherited from Throwable.
- * This should be updated if there is a schema change for this class.
- */
- private static final long serialVersionUID = 1L;
- private static SystemMessage myMessage = null;
-
- /**
- * Constructor for RemoteFolderNotEmptyException when there is no remote exception to wrap
- */
- public RemoteFolderNotEmptyException() {
- this(null);
- }
-
- /**
- * Constructor for RemoteFolderNotEmptyException when there is a remote exception to wrap
- * @param remoteException the exception that caused this one to be constructed.
- */
- public RemoteFolderNotEmptyException(Exception remoteException) {
- super(getMyMessage(), remoteException);
- }
-
- /*
- * TODO dwd update this to retrieve the new messages when those are created
- * super(RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_FOLDER_NOTEMPTY), remoteException);
- * public static final String FILEMSG_FOLDER_NOTEMPTY = "RSEF1003";
- * <Message ID="1003" Indicator="E">
- * <LevelOne>Folder is not empty. Cannot delete</LevelOne>
- * <LevelTwo>The operation failed. One possible reason is that the folder is not empty</LevelTwo>
- * </Message>
- */
- private static SystemMessage getMyMessage() {
- if (myMessage == null) {
- String l1 = "Folder is not empty. Cannot delete";
- String l2 = "The operation failed. One possible reason is that the folder is not empty";
- try {
- myMessage = new SystemMessage("RSE", "F", "1003", SystemMessage.ERROR, l1, l2);
- } catch (IndicatorException e) {
- }
- }
- return myMessage;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/processes/AbstractHostProcess.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/processes/AbstractHostProcess.java
deleted file mode 100644
index a77438f53..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/processes/AbstractHostProcess.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.processes;
-
-import org.eclipse.rse.services.clientserver.IServiceConstants;
-import org.eclipse.rse.services.clientserver.processes.IHostProcess;
-import org.eclipse.rse.services.clientserver.processes.ISystemProcessRemoteConstants;
-
-public class AbstractHostProcess implements IHostProcess, IServiceConstants, ISystemProcessRemoteConstants
-{
- protected Object[] _properties = new Object[PROCESS_ATTRIBUTES_COUNT+1];
-
- /**
- * create a new AbstractHostProcess with the default property set
- */
- public AbstractHostProcess()
- {
- _properties[PROCESS_ATTRIBUTES_INDEX_EXENAME] = " "; //$NON-NLS-1$
- _properties[PROCESS_ATTRIBUTES_INDEX_GID] = new Long(-1);
- _properties[PROCESS_ATTRIBUTES_INDEX_PID] = new Long(-1);
- _properties[PROCESS_ATTRIBUTES_INDEX_PPID] = new Long(-1);
- _properties[PROCESS_ATTRIBUTES_INDEX_STATUS] = new String(" "); //$NON-NLS-1$
- _properties[PROCESS_ATTRIBUTES_INDEX_TGID] = new Long(-1);
- _properties[PROCESS_ATTRIBUTES_INDEX_TRACERPID] = new Long(-1);
- _properties[PROCESS_ATTRIBUTES_INDEX_UID] = new Long(-1);
- _properties[PROCESS_ATTRIBUTES_INDEX_USERNAME] = " "; //$NON-NLS-1$
- _properties[PROCESS_ATTRIBUTES_INDEX_VMSIZE] = new Long(-1);
- _properties[PROCESS_ATTRIBUTES_INDEX_VMRSS] = new Long(-1);
- _properties[PROCESS_ATTRIBUTES_COUNT] = " "; //set the label //$NON-NLS-1$
- }
-
- /**
- * create a new AbstractHostProcess with initial Attributes.
- * This is equivalent to constructing the object, then calling
- * setAllProperties(initialAttributes).
- * @param initialAttributes String of initial attributes
- * @see #setAllProperties(String)
- */
- public AbstractHostProcess(String initialAttributes)
- {
- setAllProperties(initialAttributes);
- }
-
- protected Long getLongAttribute(String value, long dflt)
- {
- long result;
- try
- {
- result = Long.parseLong(value);
- }
- catch (NumberFormatException e)
- {
- return new Long(dflt);
- }
- return new Long(result);
- }
-
- protected Integer getIntAttribute(String value, int dflt)
- {
- int result;
- try
- {
- result = Integer.parseInt(value);
- }
- catch (NumberFormatException e)
- {
- return new Integer(dflt);
- }
- return new Integer(result);
- }
-
- public void setPid(String pid)
- {
- _properties[PROCESS_ATTRIBUTES_INDEX_PID] = getLongAttribute(pid, -1);
- }
-
- public void setPPid(String ppid)
- {
- _properties[PROCESS_ATTRIBUTES_INDEX_PPID] = getLongAttribute(ppid, -1);
-
- }
-
- public void setName(String name)
- {
- _properties[PROCESS_ATTRIBUTES_INDEX_EXENAME] = name;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.clientserver.processes.IHostProcess#getLabel()
- */
- public String getLabel()
- {
- return (String) _properties[PROCESS_ATTRIBUTES_COUNT];
- }
-
- public void setLabel(String label)
- {
- _properties[PROCESS_ATTRIBUTES_COUNT] = label;
- }
-
- public void setState(String state)
- {
- _properties[PROCESS_ATTRIBUTES_INDEX_STATUS] = state;
- }
-
- public void setTgid(String tgid)
- {
- _properties[PROCESS_ATTRIBUTES_INDEX_TGID] = getLongAttribute(tgid, -1);
- }
-
- public void setTracerPid(String tracerpid)
- {
- _properties[PROCESS_ATTRIBUTES_INDEX_TRACERPID] = getLongAttribute(tracerpid, -1);
- }
-
- public void setUid(String uid)
- {
- _properties[PROCESS_ATTRIBUTES_INDEX_UID] = getLongAttribute(uid, -1);
- }
-
- public void setUsername(String username)
- {
- _properties[PROCESS_ATTRIBUTES_INDEX_USERNAME] = username;
- }
-
- public void setGid(String gid)
- {
- _properties[PROCESS_ATTRIBUTES_INDEX_GID] = getLongAttribute(gid, -1);
- }
-
- public void setVmSizeInKB(String size)
- {
- _properties[PROCESS_ATTRIBUTES_INDEX_VMSIZE] = getLongAttribute(size, 0);
- }
-
- public void setVmRSSInKB(String size)
- {
- _properties[PROCESS_ATTRIBUTES_INDEX_VMRSS] = getLongAttribute(size, 0);
- }
-
- /**
- * This method allows to set all attributes at once with your own string
- * passed as a parameter, as long as the string is in the same format as
- * outlined below (pass in null to use the DataElement's string).
- * <p> The string contains properties of the object in the following order,
- * separated by {@link IServiceConstants#TOKEN_SEPARATOR}:
- * <ul>
- * <li>Process Id (pid) - long
- * <li>Executable name - String
- * <li>Status - char
- * <li>Tgid - long
- * <li>Process Parent id (ppid) - long
- * <li>Tracer pid - long
- * <li>User id (uid) - long
- * <li>Username - String
- * <li>Group id (gid) - long
- * <li>VM Size - long
- * <li>VM RSS - long
- * </ul>
- * @param allProperties Property String as defined above
- */
- public void setAllProperties(String allProperties)
- {
- String s = allProperties;
-
- if (s != null && s.length() > 0)
- {
- String[] str = s.split("\\"+TOKEN_SEPARATOR); //$NON-NLS-1$
- int numOfExpectedTokens = PROCESS_ATTRIBUTES_COUNT;
- int tokens = str.length;
- if (tokens == numOfExpectedTokens)
- {
- try
- {
- setPid(str[PROCESS_ATTRIBUTES_INDEX_PID]);
-
- setName(str[PROCESS_ATTRIBUTES_INDEX_EXENAME]);
-
- setTgid(str[PROCESS_ATTRIBUTES_INDEX_TGID]);
-
- setPPid(str[PROCESS_ATTRIBUTES_INDEX_PPID]);
-
- setTracerPid(str[PROCESS_ATTRIBUTES_INDEX_TRACERPID]);
-
- setUid(str[PROCESS_ATTRIBUTES_INDEX_UID]);
-
- setUsername(str[PROCESS_ATTRIBUTES_INDEX_USERNAME]);
-
- setGid(str[PROCESS_ATTRIBUTES_INDEX_GID]);
-
- setVmSizeInKB(str[PROCESS_ATTRIBUTES_INDEX_VMSIZE]);
-
- setVmRSSInKB(str[PROCESS_ATTRIBUTES_INDEX_VMRSS]);
-
- setState(str[PROCESS_ATTRIBUTES_INDEX_STATUS]);
-
- setLabel(getName());
-
- }
- catch (ArrayIndexOutOfBoundsException e)
- {
- // SystemPlugin.logError("Error in AbstractHostProcess.getAttributes(). Attributes in unexpected format. Attributes = " + s);
- }
- }
- }
- }
-
- public long getPid()
- {
- return ((Long)_properties[PROCESS_ATTRIBUTES_INDEX_PID]).longValue();
- }
-
- public long getPPid()
- {
- return ((Long)_properties[PROCESS_ATTRIBUTES_INDEX_PPID]).longValue();
- }
-
- public String getName()
- {
- return (String) _properties[PROCESS_ATTRIBUTES_INDEX_EXENAME];
- }
-
- public String getState()
- {
- return (String) _properties[PROCESS_ATTRIBUTES_INDEX_STATUS];
- }
-
- public long getTgid()
- {
- return ((Long)_properties[PROCESS_ATTRIBUTES_INDEX_TGID]).longValue();
- }
-
- public long getTracerPid()
- {
- return ((Long)_properties[PROCESS_ATTRIBUTES_INDEX_TRACERPID]).longValue();
- }
-
- public long getUid()
- {
- return ((Long)_properties[PROCESS_ATTRIBUTES_INDEX_UID]).intValue();
- }
-
- public String getUsername()
- {
- return (String) _properties[PROCESS_ATTRIBUTES_INDEX_USERNAME];
- }
-
- public long getGid()
- {
- return ((Long)_properties[PROCESS_ATTRIBUTES_INDEX_GID]).intValue();
- }
-
- public boolean isRoot()
- {
- return (getPPid() == 0);
- }
-
- public long getVmSizeInKB()
- {
- return ((Long)_properties[PROCESS_ATTRIBUTES_INDEX_VMSIZE]).longValue();
- }
-
- public long getVmRSSInKB()
- {
- return ((Long)_properties[PROCESS_ATTRIBUTES_INDEX_VMRSS]).longValue();
- }
-
- /**
- * Return all the properties of this data structure in one string.
- * Properties are separated by {@link IServiceConstants#TOKEN_SEPARATOR}.
- * @see #setAllProperties(String)
- * @return String of Properties
- */
- public String getAllProperties()
- {
- String properties = ""; //$NON-NLS-1$
- for (int i = 0; i < PROCESS_ATTRIBUTES_COUNT; i++)
- {
- properties = properties + _properties[i].toString();
- if (i != PROCESS_ATTRIBUTES_COUNT - 1)
- properties = properties + TOKEN_SEPARATOR;
- }
- return properties;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/processes/AbstractProcessService.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/processes/AbstractProcessService.java
deleted file mode 100644
index 0095ca8ac..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/processes/AbstractProcessService.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.processes;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.services.clientserver.processes.HostProcessFilterImpl;
-import org.eclipse.rse.services.clientserver.processes.IHostProcess;
-import org.eclipse.rse.services.clientserver.processes.IHostProcessFilter;
-
-public abstract class AbstractProcessService implements IProcessService
-{
- public IHostProcess[] listAllProcesses(IProgressMonitor monitor, String exeNameFilter, String userNameFilter, String stateFilter) throws SystemMessageException
- {
- HostProcessFilterImpl rpfs = new HostProcessFilterImpl();
- rpfs.setName(exeNameFilter);
- rpfs.setUsername(userNameFilter);
- rpfs.setSpecificState(stateFilter);
- return listAllProcesses(monitor, rpfs);
- }
-
- public IHostProcess[] listAllProcesses(IProgressMonitor monitor) throws SystemMessageException
- {
- HostProcessFilterImpl rpfs = new HostProcessFilterImpl();
- return listAllProcesses(monitor, rpfs);
- }
-
- /**
- * Return a single IHostProcess object for the 'init' process with pid 1.
- * @param monitor Progress monitor
- * @return Array with 1 element, the IHostProcess object for the root process
- * @throws SystemMessageException
- * @see org.eclipse.rse.services.processes.IProcessService#listRootProcesses(org.eclipse.core.runtime.IProgressMonitor)
- */
- public IHostProcess[] listRootProcesses(IProgressMonitor monitor) throws SystemMessageException
- {
- IHostProcess[] roots = new IHostProcess[1];
- roots[0] = getProcess(monitor, 1);
- return roots;
- }
-
- public IHostProcess[] listChildProcesses(IProgressMonitor monitor, long parentPID) throws SystemMessageException
- {
- String pPidString = "" + parentPID; //$NON-NLS-1$
- HostProcessFilterImpl rpfs = new HostProcessFilterImpl();
- rpfs.setPpid(pPidString);
-
- return listAllProcesses(monitor, rpfs);
- }
-
- public IHostProcess[] listChildProcesses(IProgressMonitor monitor, long parentPID, IHostProcessFilter filter) throws SystemMessageException
- {
- String pPidString = "" + parentPID; //$NON-NLS-1$
- filter.setPpid(pPidString);
-
- return listAllProcesses(monitor, filter);
- }
-
- public IHostProcess getParentProcess(IProgressMonitor monitor, long PID) throws SystemMessageException
- {
- return getProcess(monitor, getProcess(monitor, PID).getPPid());
- }
-
- public IHostProcess getProcess(IProgressMonitor monitor, long PID) throws SystemMessageException
- {
- String pidString = "" + PID; //$NON-NLS-1$
- HostProcessFilterImpl rpfs = new HostProcessFilterImpl();
- rpfs.setPid(pidString);
-
- IHostProcess[] results = listAllProcesses(monitor, rpfs);
- if ((results == null) || (results.length == 0)) return null;
- else return results[0];
- }
-
- public SystemMessage getMessage(String messageID)
- {
- return null;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/processes/IProcessService.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/processes/IProcessService.java
deleted file mode 100644
index 04fe7f4a1..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/processes/IProcessService.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.processes;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.rse.services.IService;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.services.clientserver.processes.IHostProcess;
-import org.eclipse.rse.services.clientserver.processes.IHostProcessFilter;
-
-/**
- * An IProcessService is an abstraction of a process service that runs over some sort of connection.
- * It can be shared among multiple instances of a subsystem. Each
- * subsystem is currently responsible for layering an abstraction over whatever it
- * wants to construct as a service.
- * <p>
- * Implementers of this interface will have to either be instantiated, initialized, or
- * somehow derive a connection as part of its state.
- */
-public interface IProcessService extends IService
-{
- /**
- * Return a list of all processes on the remote system.
- * @param monitor A progress monitor to which progress will be reported
- * @return List of all processes
- * @throws SystemMessageException
- */
- public IHostProcess[] listAllProcesses(IProgressMonitor monitor) throws SystemMessageException;
-
- /**
- * Return a filtered list of all processes on the remote system.
- * @param monitor A progress monitor to which progress will be reported
- * @param filter An object to filter results by
- * @return Filtered list of processes
- * @throws SystemMessageException
- */
- public IHostProcess[] listAllProcesses(IProgressMonitor monitor, IHostProcessFilter filter) throws SystemMessageException;
-
- /**
- * Return a filtered list of all processes on the remote system.
- * @param monitor A progress monitor to which progress will be reported
- * @param exeNameFilter The executable name to filter results by, or null if no exeName filtering
- * @param userNameFilter The user name to filter results by, or null if no userName filtering
- * @param stateFilter The state code to filter results by, or null if no state filtering
- * @return Filtered list of processes
- * @throws SystemMessageException
- */
- public IHostProcess[] listAllProcesses(IProgressMonitor monitor, String exeNameFilter, String userNameFilter, String stateFilter) throws SystemMessageException;
-
- /**
- * Returns root processes on the remote system
- * @param monitor A progress monitor to which progress will be reported
- * @return List of root processes
- * @throws SystemMessageException
- */
- public IHostProcess[] listRootProcesses(IProgressMonitor monitor) throws SystemMessageException;
-
- /**
- * Return a list of all remote child processes of the given parent process on the remote system
- * @param monitor A progress monitor to which progress will be reported
- * @param parentPID The ID of the parent process whose children are to be listed
- * @return List of child processes
- * @throws SystemMessageException
- */
- public IHostProcess[] listChildProcesses(IProgressMonitor monitor, long parentPID) throws SystemMessageException;
-
- /**
- * Return a filtered list of remote child processes of the given parent process on the remote system
- * @param monitor A progress monitor to which progress will be reported
- * @param parentPID The ID of the parent process whose children are to be listed
- * @param filter A filter to narrow results by
- * @return Filtered list of child processes
- * @throws SystemMessageException
- */
- public IHostProcess[] listChildProcesses(IProgressMonitor monitor, long parentPID, IHostProcessFilter filter) throws SystemMessageException;
-
- /**
- * Given a process, return its parent process object.
- * @param monitor A progress monitor to which progress will be reported
- * @param PID the ID of the process to return parent of.
- * @return The parent process
- * @throws SystemMessageException
- */
- public IHostProcess getParentProcess(IProgressMonitor monitor, long PID) throws SystemMessageException;
-
- /**
- * Given a pid, return an IHostProcess object for it.
- * @param monitor A progress monitor to which progress will be reported
- * @param PID The process ID of the desired process
- * @return IHostProcess object for the given pid
- * @throws SystemMessageException
- */
- public IHostProcess getProcess(IProgressMonitor monitor, long PID) throws SystemMessageException;
-
- /**
- * Kills a process.
- * @param monitor A progress monitor to which progress will be reported
- * @param PID the ID of the process to be killed.
- * @param signal the signal to send to the process
- * @return <code>false</code> if the given process doesn't exist, else <code>true</code>.
- * Throws an exception if anything fails.
- * @throws SystemMessageException
- */
- public boolean kill(IProgressMonitor monitor, long PID, String signal) throws SystemMessageException;
-
- /**
- * Returns a list of the types of signals that can be sent to
- * a process on the remote system.
- * @return the signal types, or null if there are none, or they cannot be found.
- */
- public String[] getSignalTypes();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/AbstractSearchResult.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/AbstractSearchResult.java
deleted file mode 100644
index 862dd9c6f..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/AbstractSearchResult.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.search;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.rse.services.clientserver.SystemSearchString;
-import org.eclipse.rse.services.files.IHostFile;
-
-
-/**
- * The RemoteSearchResultImpl class is an implementation of IRemoteSearchResult.
- * It is used for storing information about a particular search result.
- */
-public class AbstractSearchResult implements IAdaptable, IHostSearchResult
-{
-
-
- private String _text;
- private int _line = 0;
- private int _index = -1;
-
- private Object _parent;
- private SystemSearchString _matchingSearchString;
- private IHostSearchResultConfiguration _configuration;
-
- private List _matches;
-
- protected class RemoteSearchResultMatch
- {
-
- private int _startOffset = -1;
- private int _endOffset = -1;
-
- private RemoteSearchResultMatch(int startOffset, int endOffset) {
- this._startOffset = startOffset;
- this._endOffset = endOffset;
- }
- }
-
- /**
- * Constructor to create a result.
- * @param parent container of the result.
- * @param searchString the search string for which the result was produced.
- */
- public AbstractSearchResult(IHostSearchResultConfiguration configuration, Object parent, SystemSearchString searchString)
- {
- _parent = parent;
- _matchingSearchString = searchString;
- _matches = new ArrayList();
- _configuration = configuration;
- }
-
-
-
- /**
- * Sets the displayable text for the search result.
- * @param text the displayable text.
- */
- public void setText(String text) {
- _text = text;
- }
-
- /**
- * Sets the associated line number for the result.
- * @param line the line number.
- */
- public void setLine(int line) {
- _line = line;
- }
-
- /**
- * Sets the index of the search result in the context of its parent.
- * @param index the index.
- */
- public void setIndex(int index) {
- _index = index;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResult#getText()
- */
- public String getText() {
- return _text;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResult#getLine()
- */
- public int getLine() {
- return _line;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResult#getIndex()
- */
- public int getIndex() {
- return _index;
- }
-
- /**
- * Gets the absolute path of the file for which the result was found.
- * @return the absolute path of the file.
- */
- public String getAbsolutePath() {
-
- if (_parent instanceof IHostFile) {
- return ((IHostFile)_parent).getAbsolutePath();
- }
- else {
- return null;
- }
- }
-
- /**
- * Gets the containing object for the search result.
- * @return the containing parent.
- */
- public Object getParent() {
- return _parent;
- }
-
- public void setParent(Object parent)
- {
- _parent = parent;
- }
-
- /**
- * Gets the associated adapter for this search result.
- * @param adapterType the adapter type.
- */
- public Object getAdapter(Class adapterType) {
- return Platform.getAdapterManager().getAdapter(this, adapterType);
- }
-
- /**
- * Returns children of the search result, if applicable.
- * @return <code>null</code> for this implementation.
- */
- public Object[] getChildren() {
- return null;
- }
-
- /**
- * Indicates whether this search result has children
- * @return <code>false</code> since there are no children.
- */
- public boolean hasChildren() {
- return false;
- }
-
- /**
- * Gets the displayable label for this output. Calls getText().
- * @return the label.
- */
- public String getLabel() {
- return getText();
- }
-
- /**
- * Gets the search string that this result matches.
- * @return the search string.
- */
- public SystemSearchString getMatchingSearchString() {
- return _matchingSearchString;
- }
-
- /**
- * Add a match to the result. A match comprises a char start offset and a char end offset, both
- * relative to the beginning of the file. The matches are added in order.
- * @param startOffset the char start offset, from the beginning of the file.
- * @param endOffset the char end offset, from the beginning of the file.
- */
- public void addMatch(int startOffset, int endOffset) {
- _matches.add(new RemoteSearchResultMatch(startOffset, endOffset));
- }
-
- /**
- * Gets the number of matches in this line.
- * @return the number of matches.
- */
- public int numOfMatches() {
- return _matches.size();
- }
-
- /**
- * Gets the char start offset for the given match index.
- * @param matchIndex the match index. For example, to get the start offset for the first match, specify 0.
- * @return the char start offset, or -1 if there is no match corresponding to the given index.
- */
- public int getCharStart(int matchIndex) {
- RemoteSearchResultMatch match = (RemoteSearchResultMatch)(_matches.get(matchIndex));
-
- if (match != null) {
- return match._startOffset;
- }
- else {
- return -1;
- }
- }
-
- /**
- * Gets the char end offset for the given match index.
- * @param matchIndex the match index. For example, to get the end offset for the first match, specify 0.
- * @return the char end offset, or -1 if there is no match corresponding to the given index.
- */
- public int getCharEnd(int matchIndex) {
- RemoteSearchResultMatch match = (RemoteSearchResultMatch)(_matches.get(matchIndex));
-
- if (match != null) {
- return match._endOffset;
- }
- else {
- return -1;
- }
- }
-
- /**
- * @return the char start offset of the first match.
- */
- public int getCharEnd() {
- return getCharEnd(0);
- }
-
- /**
- * @return the char end offset of the first match.
- */
- public int getCharStart() {
- return getCharStart(0);
- }
-
- public IHostSearchResultConfiguration getConfiguration()
- {
- return _configuration;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/AbstractSearchResultConfiguration.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/AbstractSearchResultConfiguration.java
deleted file mode 100644
index 55e3774f0..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/AbstractSearchResultConfiguration.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.search;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.rse.services.clientserver.SystemSearchString;
-
-
-/**
- * This class represents a search result configuration. A configuration
- * consists of a search target and a search string, and belongs to a search
- * result set. Once a search has been started via a subsystem, the results
- * are stored in the configuration itself. The status of the search can also be queried from
- * the configuration.
- */
-public abstract class AbstractSearchResultConfiguration implements IHostSearchResultConfiguration
-{
-
- protected IHostSearchResultSet parentResultSet;
- protected Object searchTarget;
- protected SystemSearchString searchString;
- protected Vector results;
- protected Map _containedResults;
- protected int status;
- protected ISearchService _searchService;
- protected ISearchHandler _searchHandler;
-
-
- /**
- * Constructor for a result set configuration. Sets status to <code>RUNNING</code>.
- * @param resultSet the parent result set.
- * @param searchObject the target of the search.
- * @param searchString the search string.
- */
- public AbstractSearchResultConfiguration(IHostSearchResultSet resultSet, Object searchObject, SystemSearchString string, ISearchService searchService)
- {
- results = new Vector();
- setParentResultSet(resultSet);
- setSearchTarget(searchObject);
- setSearchString(string);
- setStatus(RUNNING);
- _searchService = searchService;
- _containedResults = new HashMap();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultConfiguration#setParentResultSet(org.eclipse.rse.services.search.IHostSearchResultSet)
- */
- public void setParentResultSet(IHostSearchResultSet resultSet)
- {
- this.parentResultSet = resultSet;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultConfiguration#getParentResultSet()
- */
- public IHostSearchResultSet getParentResultSet() {
- return parentResultSet;
- }
-
- public ISearchService getSearchService()
- {
- return _searchService;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultConfiguration#setSearchTarget(java.lang.Object)
- */
- public void setSearchTarget(Object searchObject) {
- this.searchTarget = searchObject;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultConfiguration#getSearchTarget()
- */
- public Object getSearchTarget() {
- return searchTarget;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultConfiguration#setSearchString(org.eclipse.rse.services.clientserver.SystemSearchString)
- */
- public void setSearchString(SystemSearchString string) {
- this.searchString = string;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultConfiguration#getSearchString()
- */
- public SystemSearchString getSearchString()
- {
- return searchString;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultConfiguration#addResult(java.lang.Object)
- */
- public void addResult(Object result)
- {
- results.add(result);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultConfiguration#removeResult(java.lang.Object)
- */
- public void removeResult(Object result)
- {
- results.remove(result);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultConfiguration#removeAndAddResult(java.lang.Object, java.lang.Object)
- */
- public void removeAndAddResult(Object oldResult, Object newResult)
- {
- results.remove(oldResult);
- results.add(newResult);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultConfiguration#getResults()
- */
- public Object[] getResults()
- {
- return results.toArray();
- }
-
- public IHostSearchResult[] getContainedResults(Object resultContainer)
- {
- return (IHostSearchResult[])_containedResults.get(resultContainer);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultConfiguration#getResultsSize()
- */
- public int getResultsSize()
- {
- return results.size();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultConfiguration#removeResults()
- */
- public void removeResults()
- {
- results.removeAllElements();
- _containedResults.clear();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultConfiguration#setStatus(int)
- */
- public void setStatus(int status) {
- this.status = status;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultConfiguration#getStatus()
- */
- public int getStatus() {
- return status;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultConfiguration#cancel()
- */
- public void cancel() {
-
- // if not running, return
- if (getStatus() != RUNNING) {
- return;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultConfiguration#dispose()
- */
- public void dispose() {
-
- // cancel search first
- cancel();
-
- // remove results
- removeResults();
- }
-
- public void addResults(Object container, IHostSearchResult[] results)
- {
- _containedResults.put(container, results);
- }
-
- public void setSearchHandler(ISearchHandler searchHandler)
- {
- _searchHandler = searchHandler;
- }
-
-
- /**
- * Gets the search handler.
- * @return the search handler.
- */
- public ISearchHandler getSearchHandler()
- {
- return _searchHandler;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/AbstractSearchService.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/AbstractSearchService.java
deleted file mode 100644
index 32d81dd9b..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/AbstractSearchService.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.search;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.rse.services.files.IFileService;
-
-
-
-public abstract class AbstractSearchService implements ISearchService
-{
- protected Map _searches;
-
- public AbstractSearchService()
- {
- _searches = new HashMap();
- }
-
- public final void search(IProgressMonitor monitor, IHostSearchResultConfiguration searchConfig, IFileService fileService)
- {
- ISearchHandler handler = internalSearch(monitor, searchConfig, fileService);
- _searches.put(searchConfig, handler);
- }
-
-
- public final void cancelSearch(IProgressMonitor monitor, IHostSearchResultConfiguration searchConfig)
- {
- ISearchHandler handler = (ISearchHandler)_searches.get(searchConfig);
- handler.cancel(monitor);
- }
-
-
- protected abstract ISearchHandler internalSearch(IProgressMonitor monitor, IHostSearchResultConfiguration searchConfig, IFileService fileService);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/HostSearchResultSet.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/HostSearchResultSet.java
deleted file mode 100644
index b647081bb..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/HostSearchResultSet.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.search;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-
-
-/**
- * A remote search result set represents a page in the Remote Search view.
- * A search result set contains multiple search configurations and their results.
- * This allows it to contain results from multiple connections, filters, and folders
- * (from different systems).
- */
-public class HostSearchResultSet implements IHostSearchResultSet, IAdaptable
-{
-
- protected Vector configurations;
- protected String name;
-
- /**
- * Constructor to create a result set.
- */
- public HostSearchResultSet() {
- configurations = new Vector();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#setName(java.lang.String)
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#getName()
- */
- public String getName() {
- return name;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#addSearchConfiguration(org.eclipse.rse.services.search.IHostSearchResultConfiguration)
- */
- public void addSearchConfiguration(IHostSearchResultConfiguration config) {
- configurations.add(config);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#removeSearchConfiguration(org.eclipse.rse.services.search.IHostSearchResultConfiguration)
- */
- public void removeSearchConfiguration(IHostSearchResultConfiguration config) {
- configurations.remove(config);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#getSearchConfigurations()
- */
- public Iterator getSearchConfigurations() {
- return configurations.iterator();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#addResult(org.eclipse.rse.services.search.IHostSearchResultConfiguration, java.lang.Object)
- */
- public void addResult(IHostSearchResultConfiguration config, Object result) {
- config.addResult(result);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#removeResult(org.eclipse.rse.services.search.IHostSearchResultConfiguration, java.lang.Object)
- */
- public void removeResult(IHostSearchResultConfiguration config, Object result) {
- config.removeResult(result);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#getResultsForConfiguration(org.eclipse.rse.services.search.IHostSearchResultConfiguration)
- */
- public Object[] getResultsForConfiguration(IHostSearchResultConfiguration config) {
- return config.getResults();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#getAllResults()
- */
- public Object[] getAllResults() {
-
- List list = new ArrayList();
-
- Iterator iter = getSearchConfigurations();
-
- while (iter.hasNext())
- {
- IHostSearchResultConfiguration config = (IHostSearchResultConfiguration)iter.next();
-
- list.addAll(Arrays.asList(config.getResults()));
- }
-
- return list.toArray();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#removeAllResults()
- */
- public void removeAllResults() {
-
- Iterator iter = getSearchConfigurations();
-
- while (iter.hasNext()) {
- IHostSearchResultConfiguration config = (IHostSearchResultConfiguration)iter.next();
- config.removeResults();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#getNumOfResults()
- */
- public int getNumOfResults() {
-
- int resultSize = 0;
-
- Iterator iter = getSearchConfigurations();
-
- while (iter.hasNext()) {
- IHostSearchResultConfiguration config = (IHostSearchResultConfiguration)iter.next();
- resultSize += config.getResultsSize();
- }
-
- return resultSize;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#cancel()
- */
- public void cancel() {
-
- // cancel each config that is running
- Iterator iter = getSearchConfigurations();
-
- while (iter.hasNext()) {
- IHostSearchResultConfiguration config = (IHostSearchResultConfiguration)iter.next();
-
- if (config.getStatus() == IHostSearchConstants.RUNNING) {
- config.cancel();
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#removeResult(java.lang.Object)
- */
- public void removeResult(Object result) {
- Iterator iter = getSearchConfigurations();
-
- while (iter.hasNext()) {
- IHostSearchResultConfiguration config = (IHostSearchResultConfiguration)iter.next();
- config.removeResult(result);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#removeAndAddResult(java.lang.Object, java.lang.Object)
- */
- public void removeAndAddResult(Object oldResult, Object newResult) {
- Iterator iter = getSearchConfigurations();
-
- while (iter.hasNext()) {
- IHostSearchResultConfiguration config = (IHostSearchResultConfiguration)iter.next();
- config.removeAndAddResult(oldResult, newResult);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#dispose()
- */
- public void dispose() {
-
- // first cancel all configs that are still running
- cancel();
-
- // now dispose each configuration
- Iterator iter = getSearchConfigurations();
-
- while (iter.hasNext()) {
- IHostSearchResultConfiguration config = (IHostSearchResultConfiguration)iter.next();
- config.dispose();
- }
-
- // remove all the configurations
- configurations.removeAllElements();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#isCancelled()
- */
- public boolean isCancelled() {
- Iterator iter = getSearchConfigurations();
-
- while (iter.hasNext()) {
- IHostSearchResultConfiguration config = (IHostSearchResultConfiguration)iter.next();
-
- // if a config is not cancelled, the search is not cancelled
- if (config.getStatus() != IHostSearchConstants.CANCELLED) {
- return false;
- }
- }
-
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#isFinished()
- */
- public boolean isFinished() {
- Iterator iter = getSearchConfigurations();
-
- while (iter.hasNext()) {
- IHostSearchResultConfiguration config = (IHostSearchResultConfiguration)iter.next();
-
- // if a config is not finished, the search is not finished
- if (config.getStatus() != IHostSearchConstants.FINISHED) {
- return false;
- }
- }
-
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#isRunning()
- */
- public boolean isRunning() {
- Iterator iter = getSearchConfigurations();
-
- while (iter.hasNext()) {
- IHostSearchResultConfiguration config = (IHostSearchResultConfiguration)iter.next();
-
- // if a config is running, the search is running
- if (config.getStatus() == IHostSearchConstants.RUNNING) {
- return true;
- }
- }
-
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.search.IHostSearchResultSet#isDisconnected()
- */
- public boolean isDisconnected() {
- Iterator iter = getSearchConfigurations();
-
- while (iter.hasNext()) {
- IHostSearchResultConfiguration config = (IHostSearchResultConfiguration)iter.next();
-
- // if a config is not disconnected, the search is not disconnected
- if (config.getStatus() != IHostSearchConstants.DISCONNECTED) {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchConstants.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchConstants.java
deleted file mode 100644
index 99e752495..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchConstants.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.search;
-
-public interface IHostSearchConstants {
-
- /**
- * Status indicating configuration is still running, 0.
- */
- public static final int RUNNING = 0;
-
- /**
- * Status indicating configuration has finished, 1.
- */
- public static final int FINISHED = 1;
-
- /**
- * Status indicating configuration has been cancelled, 2.
- */
- public static final int CANCELLED = 2;
-
- /**
- * Status indicating configuration has been disconnected, 3.
- */
- public static final int DISCONNECTED = 3;
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchResult.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchResult.java
deleted file mode 100644
index f75a48c11..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchResult.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.search;
-
-import org.eclipse.rse.services.clientserver.SystemSearchString;
-
-
-public interface IHostSearchResult
-{
- public static final String SEARCH_RESULT_DELIMITER = ":SEARCH";
- public static final String SEARCH_RESULT_OPEN_DELIMITER = "<";
- public static final String SEARCH_RESULT_CLOSE_DELIMITER = ">";
- public static final String SEARCH_RESULT_INDEX_DELIMITER = ":";
-
- public void setParent(Object parent);
-
- public Object getParent();
-
-
- public int getLine();
-
- /**
- * Gets the search string that this result matches.
- * @return the search string.
- */
- public SystemSearchString getMatchingSearchString();
-
- /**
- * Gets the path to the file that this output references if it references any. It may return null if
- * no such association exists. This may be used to jump to an editor from a view which displays
- * this
- *
- * @return the path of the referenced file if there is one
- */
- public String getAbsolutePath();
-
- /**
- * Gets the text to display for a search result.
- * @return the text.
- */
- public String getText();
-
- /**
- * Gets the index of this search result in the context of its parent.
- * @return the index.
- */
- public int getIndex();
-
-
- /**
- * Add a match to the result. A match comprises a char start offset and a char end offset, both
- * relative to the beginning of the file. The matches are added in order.
- * @param startOffset the char start offset, from the beginning of the file.
- * @param endOffset the char end offset, from the beginning of the file.
- */
- public void addMatch(int startOffset, int endOffset);
-
- /**
- * Gets the number of matches in this line.
- * @return the number of matches.
- */
- public int numOfMatches();
-
- /**
- * Gets the char start offset for the given match index.
- * @param matchIndex the match index. For example, to get the start offset for the first match, specify 0.
- * @return the char start offset.
- */
- public int getCharStart(int matchIndex);
-
- /**
- * Gets the char end offset for the given match index.
- * @param matchIndex the match index. For example, to get the end offset for the first match, specify 0.
- * @return the char end offset.
- */
- public int getCharEnd(int matchIndex);
-
-
- public IHostSearchResultConfiguration getConfiguration();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchResultConfiguration.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchResultConfiguration.java
deleted file mode 100644
index 5bf8e016a..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchResultConfiguration.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.search;
-
-import org.eclipse.rse.services.clientserver.SystemSearchString;
-
-/**
- * An interface representing a search result configuration.
- */
-public interface IHostSearchResultConfiguration extends IHostSearchConstants {
-
- /**
- * Sets the parent result set.
- * @param resultSet the parent result set.
- */
- public void setParentResultSet(IHostSearchResultSet resultSet);
-
- /**
- * Gets the parent result set.
- * @return the parent result set.
- */
- public IHostSearchResultSet getParentResultSet();
-
- /**
- * Gets the results contained within the resultContainer
- * @param resultContainer
- * @return
- */
- public IHostSearchResult[] getContainedResults(Object resultContainer);
-
- /**
- * Sets the object to be searched.
- * @param searchObject the object to be searched.
- */
- public void setSearchTarget(Object searchObject);
-
- /**
- * Gets the object to be searched.
- * @return the object to be searched.
- */
- public Object getSearchTarget();
-
- /**
- * Sets the search string.
- * @param string the search string.
- */
- public void setSearchString(SystemSearchString string);
-
- /**
- * Gets the search string.
- * @return string the search string.
- */
- public SystemSearchString getSearchString();
-
- /**
- * Adds a search result.
- * @param result a search result.
- */
- public void addResult(Object result);
-
- /**
- * Adds a set of search results along their associated container
- * @param container
- * @param results
- */
- public void addResults(Object container, IHostSearchResult[] results);
-
- /**
- * Removes a search result.
- * @param result a search result.
- */
- public void removeResult(Object result);
-
- /**
- * Removes the old result and adds a new result.
- * @param oldResult the old result.
- * @param newResult the new result.
- */
- public void removeAndAddResult(Object oldResult, Object newResult);
-
- /**
- * Gets search results.
- * @return search results.
- */
- public Object[] getResults();
-
- /**
- * Gets the size of the results.
- * @return the size of the results.
- */
- public int getResultsSize();
-
- /**
- * Removes all search results.
- */
- public void removeResults();
-
- /**
- * Sets the status of the search. One of <code>RUNNING</code>, <code>FINISHED</code>,
- * <code>CANCELLED</code>, or <code>DISCONNECTED</code>.
- * @param the status.
- */
- public void setStatus(int status);
-
- /**
- * Gets the status of the search. One of <code>RUNNING</code>, <code>FINISHED</code>,
- * <code>CANCELLED</code>, or <code>DISCONNECTED</code>.
- * @return the status of the search.
- */
- public int getStatus();
-
- /**
- * Cancels the search if it is running.
- */
- public void cancel();
-
- /**
- * Cancels the search and then removes the search results. Implementors should call <code>super</code> first.
- */
- public void dispose();
-
- /**
- * Sets the search handler
- * @param handler
- */
- public void setSearchHandler(ISearchHandler handler);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchResultConfigurationFactory.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchResultConfigurationFactory.java
deleted file mode 100644
index baf0d9d82..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchResultConfigurationFactory.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.search;
-
-import org.eclipse.rse.services.clientserver.SystemSearchString;
-
-public interface IHostSearchResultConfigurationFactory
-{
- public IHostSearchResultConfiguration createSearchConfiguration(IHostSearchResultSet resultSet, Object searchTarget, SystemSearchString searchString);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchResultSet.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchResultSet.java
deleted file mode 100644
index dad13692f..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/IHostSearchResultSet.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.search;
-
-import java.util.Iterator;
-
-/**
- * A remote search result set represents a page in the Remote Search view.
- * A search result set contains multiple search configurations and their results.
- * This allows it to contain results from multiple connections, filters, and folders
- * (from different systems).
- */
-public interface IHostSearchResultSet {
-
- /**
- * Sets the name of the search.
- * @param name the name of the search.
- */
- public void setName(String name);
-
- /**
- * Gets the name of the search that is being run.
- * @return the name of the search.
- */
- public String getName();
-
- /**
- * Add a search configuration.
- * @param config a search configuration.
- */
- public void addSearchConfiguration(IHostSearchResultConfiguration config);
-
- /**
- * Removes a search configuration.
- * @param config a search configuration.
- */
- public void removeSearchConfiguration(IHostSearchResultConfiguration config);
-
- /**
- * Returns an iterator over search configurations.
- * @return an iterator over search configurations.
- */
- public Iterator getSearchConfigurations();
-
- /**
- * Add a result for a search configuration.
- * @param config a search configuration that was previously added.
- * @param result a search result.
- */
- public void addResult(IHostSearchResultConfiguration config, Object result);
-
- /**
- * Removes a result from a search configuration.
- * @param config a search configuration that was previously added.
- * @param result a search result.
- */
- public void removeResult(IHostSearchResultConfiguration config, Object result);
-
- /**
- * Removes a result from all search configurations where it exists.
- * @param result a search result.
- */
- public void removeResult(Object result);
-
- /**
- * Removes the old result from configurations where it is found, and
- * add the new result to those configurations.
- * @param oldResult the old result.
- * @param newResult the new result.
- */
- public void removeAndAddResult(Object oldResult, Object newResult);
-
- /**
- * Returns the results of a particular search configuration.
- * @param config a search configuration.
- * @return the results for the given search configuration.
- */
- public Object[] getResultsForConfiguration(IHostSearchResultConfiguration config);
-
- /**
- * Returns all results of the search.
- * @return all results of the search.
- */
- public Object[] getAllResults();
-
- /**
- * Removes all results of the search.
- */
- public void removeAllResults();
-
- /**
- * Gets the number of results.
- * @return the number of results.
- */
- public int getNumOfResults();
-
- /**
- * Cancels the search. Cancel those configurations that are still running.
- */
- public void cancel();
-
- /**
- * Removes all configurations. First cancels the search, then calls the <code>dispose</code> method of
- * the configurations before removing them.
- */
- public void dispose();
-
- /**
- * Returns whether search is running. A search is running if any of the configurations is running.
- * @return <code>true</code> if the search is running, <code>false</code> otherwise.
- */
- public boolean isRunning();
-
- /**
- * Returns whether the search is cancelled. A search is cancelled if all of the configurations are
- * cancelled.
- * @return <code>true</code> if the search is cancelled, <code>false</code> otherwise.
- */
- public boolean isCancelled();
-
- /**
- * Returns whether the search is finished. A search is finished if all the configurations are finished.
- * @return <code>true</code> if the search is finished, <code>false</code> otherwise.
- */
- public boolean isFinished();
-
- /**
- * Returns whether the search is disconnected. A search is disconnected if all the configurations are
- * disconnected.
- * @return <code>true</code> if the search is disconnected, <code>false</code> otherwise.
- */
- public boolean isDisconnected();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/ISearchHandler.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/ISearchHandler.java
deleted file mode 100644
index 1fc97b5ae..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/ISearchHandler.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.search;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-public interface ISearchHandler
-{
- public void search(IProgressMonitor monitor);
- public void cancel(IProgressMonitor monitor);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/ISearchService.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/ISearchService.java
deleted file mode 100644
index 401fcef26..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/search/ISearchService.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.search;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.rse.services.files.IFileService;
-
-public interface ISearchService
-{
- public void search(IProgressMonitor monitor, IHostSearchResultConfiguration searchConfig, IFileService fileService);
- public void cancelSearch(IProgressMonitor monitor, IHostSearchResultConfiguration searchConfig);
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/AbstractHostShell.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/AbstractHostShell.java
deleted file mode 100644
index 0ac8e3f75..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/AbstractHostShell.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.shells;
-
-
-public abstract class AbstractHostShell implements IHostShell
-{
-
- public void addOutputListener(IHostShellOutputListener listener)
- {
- IHostShellOutputReader outReader = getStandardOutputReader();
- if (outReader != null)
- {
- outReader.addOutputListener(listener);
- }
- IHostShellOutputReader errReader = getStandardErrorReader();
- if (errReader != null)
- {
- errReader.addOutputListener(listener);
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/AbstractHostShellOutputReader.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/AbstractHostShellOutputReader.java
deleted file mode 100644
index 97fb596ec..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/AbstractHostShellOutputReader.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.shells;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public abstract class AbstractHostShellOutputReader extends Thread implements IHostShellOutputReader
-{
- protected List _listeners;
- protected int _waitIncrement = 2;
- protected boolean _keepRunning = true;
-
- protected List _linesOfOutput;
- protected int _consumerOffset;
- protected IHostShell _hostShell;
- protected boolean _isErrorReader = false;
-
-
- protected long _timeOfLastEvent = 0;
- protected int _sizeAtLastEvent = 0;
-
- public AbstractHostShellOutputReader(IHostShell hostShell, boolean isErrorReader)
- {
- _hostShell = hostShell;
- _listeners = new ArrayList();
- _linesOfOutput = new ArrayList();
- _consumerOffset = 0;
- _isErrorReader = isErrorReader;
- _timeOfLastEvent = System.currentTimeMillis();
- }
-
- public boolean isErrorReader()
- {
- return _isErrorReader;
- }
-
- public IHostShell getHostShell()
- {
- return _hostShell;
- }
-
- public void setWaitTime(int value)
- {
- _waitIncrement = value;
- }
-
- public int getWaitTime()
- {
- return _waitIncrement;
- }
-
-
- public void handle()
- {
- IHostOutput line = internalReadLine();
-
- if (line != null)
- {
- addLine(line);
- }
-
- else
- {
- finish();
- }
-
- }
-
- protected void addLine(IHostOutput line)
- {
- _linesOfOutput.add(line);
- int sizenow = _linesOfOutput.size();
- int deltaSize = sizenow - _sizeAtLastEvent;
-
- long timenow = System.currentTimeMillis();
- //if ((timenow - _timeOfLastEvent) > 10 || deltaSize > 2)
- {
-
-
- // notify listeners
- HostShellChangeEvent event = new HostShellChangeEvent(_hostShell, this, _sizeAtLastEvent, deltaSize);
- fireOutputChanged(event);
- _timeOfLastEvent = timenow;
- _sizeAtLastEvent = sizenow;
- }
- }
-
- public IHostOutput readLine()
- {
- if (!isAlive())
- {
- internalReadLine();
- start();
- }
- return (IHostOutput)_linesOfOutput.get(_consumerOffset++);
- }
-
- public IHostOutput readLine(int lineNumber)
- {
- return (IHostOutput)_linesOfOutput.get(lineNumber);
- }
-
-
-
- public void setLineOffset(int lineNumber)
- {
- _consumerOffset = lineNumber;
- }
- public void addOutputListener(IHostShellOutputListener listener)
- {
- _listeners.add(listener);
- if (!isAlive())
- {
- start();
- }
- }
-
-
- public void fireOutputChanged(IHostShellChangeEvent event)
- {
- for (int i = 0; i < _listeners.size(); i++)
- {
- IHostShellOutputListener listener = (IHostShellOutputListener)_listeners.get(i);
- listener.shellOutputChanged(event);
- }
- if (!_keepRunning)
- dispose();
- }
-
- public void dispose()
- {
- _listeners.clear();
- }
-
- public boolean isFinished()
- {
- return !_keepRunning;
- }
-
- public void finish()
- {
- if (_keepRunning)
- {
-
- _waitIncrement = 0;
- _keepRunning = false;
- //dispose();
- }
- }
-
- public void run()
- {
- while (_keepRunning)
- {
- try
- {
- Thread.sleep(_waitIncrement);
- Thread.yield();
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- finish();
- return;
- }
-
- handle();
- }
- }
-
- protected abstract IHostOutput internalReadLine();
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/CommandPattern.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/CommandPattern.java
deleted file mode 100644
index b0fe42fd4..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/CommandPattern.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and International Business Machines Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.shells;
-
-import java.util.ArrayList;
-import java.util.regex.Pattern;
-
-public class CommandPattern
-{
-
-
- private Pattern _pattern;
- private ArrayList _outputPatterns;
-
- public CommandPattern(Pattern theCommandPattern)
- {
- _pattern = theCommandPattern;
- _outputPatterns = new ArrayList();
- }
-
- public void addOutputPattern(OutputPattern op)
- {
- _outputPatterns.add(op);
- }
-
- public boolean matchCommand(String theLine)
- {
- return _pattern.matcher(theLine).matches();
- }
-
- public ParsedOutput matchLine(String theLine)
- {
- int patterns = _outputPatterns.size();
- ParsedOutput matchedOutput;
- OutputPattern curPattern;
- for (int i = 0; i < patterns; i++)
- {
- curPattern = (OutputPattern) _outputPatterns.get(i);
- matchedOutput = curPattern.matchLine(theLine);
- if (matchedOutput != null)
- return matchedOutput;
- }
- return null;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/HostShellChangeEvent.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/HostShellChangeEvent.java
deleted file mode 100644
index 18775d953..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/HostShellChangeEvent.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.shells;
-
-public class HostShellChangeEvent implements IHostShellChangeEvent
-{
- protected IHostShell _hostShell;
- protected IHostShellOutputReader _reader;
- protected int _offset;
- protected int _range;
-
- public HostShellChangeEvent(IHostShell shell, IHostShellOutputReader reader, int offset, int range)
- {
- _hostShell = shell;
- _reader = reader;
- _offset = offset;
- _range = range;
- }
-
- public IHostShell getHostShell()
- {
- return _hostShell;
- }
-
- public IHostShellOutputReader getReader()
- {
- return _reader;
- }
-
- public IHostOutput[] getLines()
- {
- IHostOutput[] lines = new IHostOutput[_range];
- int r = 0;
- int size = _offset + _range ;
- for (int i= _offset; i < size; i++)
- {
- lines[r] = _reader.readLine(i);
- r++;
- }
- return lines;
- }
-
- public IHostOutput[] getLineObjects()
- {
- return getLines();
- }
-
- public boolean isError()
- {
- return _reader.isErrorReader();
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/HostShellOutputStream.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/HostShellOutputStream.java
deleted file mode 100644
index f0bc76658..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/HostShellOutputStream.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 PalmSource, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Ewa Matejska (PalmSource)
- * Martin Oberhuber (Wind River) - moved from org.eclipse.rse.remotecdt (bug 161777)
- * Martin Oberhuber (Wind River) - improved Javadoc
- *******************************************************************************/
-
-package org.eclipse.rse.services.shells;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-
-/**
- * An adapter between the OutputStream and the IHostShell objects.
- * @author Ewa Matejska
- * @see IHostShell
- * @see java.io.OutputStream
- */
-public class HostShellOutputStream extends OutputStream {
-
- private IHostShell hostShell;
-
- /**
- * Constructor.
- * @param hostShell An instance of the IHostShell class.
- * The output will be sent to this instance.
- */
- public HostShellOutputStream(IHostShell hostShell) {
- this.hostShell = hostShell;
- }
-
- /**
- * Writes one byte to the shell.
- * @see java.io.OutputStream#write(byte[])
- */
- public void write(byte[] b) {
- if(hostShell != null && b != null)
- hostShell.writeToShell(new String(b));
- }
-
- /**
- * Writes multiple bytes to the shell.
- * @see java.io.OutputStream#write(byte[], int, int)
- */
- public void write(byte[] b, int off, int len) {
- if(hostShell != null && b != null)
- hostShell.writeToShell(new String(b, off, len));
- }
-
- /**
- * Writes one character to the shell.
- * @see java.io.OutputStream#write(int)
- */
- public void write(int b) throws IOException {
- char[] array = { (char) b };
- if(hostShell != null)
- hostShell.writeToShell(new String(array));
- }
-
-}
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/HostShellProcessAdapter.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/HostShellProcessAdapter.java
deleted file mode 100644
index e728e464f..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/HostShellProcessAdapter.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 PalmSource, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Ewa Matejska (PalmSource) - initial version
- * Martin Oberhuber (Wind River) - adapt to IHostOutput API (bug 161773, 158312)
- * Martin Oberhuber (Wind River) - moved from org.eclipse.rse.remotecdt (bug 161777)
- * Martin Oberhuber (Wind River) - renamed from HostShellAdapter (bug 161777)
- * Martin Oberhuber (Wind River) - improved Javadoc
- *******************************************************************************/
-
-package org.eclipse.rse.services.shells;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PipedInputStream;
-import java.io.PipedOutputStream;
-
-
-/**
- * This class represents a host shell process. It does not
- * represent one process running in the shell. This means
- * that the output of multiple shell commands will be returned
- * until the shell exits.
- *
- * @author Ewa Matejska
- */
-public class HostShellProcessAdapter extends Process implements
-IHostShellOutputListener {
-
- private IHostShell hostShell;
- private PipedInputStream inputStream = null;
- private PipedInputStream errorStream = null;
- private HostShellOutputStream outputStream = null;
-
- private PipedOutputStream hostShellInput = null;
- private PipedOutputStream hostShellError = null;
-
- /**
- * Constructor.
- * @param hostShell An instance of the IHostShell class.
- * @throws java.io.IOException
- */
- public HostShellProcessAdapter(IHostShell hostShell) throws java.io.IOException {
- this.hostShell = hostShell;
- hostShellInput = new PipedOutputStream();
- hostShellError = new PipedOutputStream();
- inputStream = new PipedInputStream(hostShellInput);
- errorStream = new PipedInputStream(hostShellError);
- outputStream = new HostShellOutputStream(hostShell);
- this.hostShell.getStandardOutputReader().addOutputListener(this);
- this.hostShell.getStandardErrorReader().addOutputListener(this);
- }
-
- /**
- * Exits the shell.
- * @see java.lang.Process#destroy()
- */
- public synchronized void destroy() {
- hostShell.exit();
- notifyAll();
- try {
- hostShellInput.close();
- hostShellError.close();
- inputStream.close();
- errorStream.close();
- outputStream.close();
- } catch (IOException e) {
- //FIXME IOException when closing one of the streams will leave others open
- // Ignore
- }
- }
-
- /**
- * There is no relevant exit value to return when the shell exits.
- * This always returns 0.
- */
- public synchronized int exitValue() {
- if(hostShell.isActive())
- throw new IllegalThreadStateException();
- // No way to tell what the exit value was.
- // TODO it would be possible to get the exit value
- // when the remote process is started like this:
- // sh -c 'remotecmd ; echo "-->RSETAG<-- $?\"'
- // Then the output steram could be examined for -->RSETAG<-- to get the exit value.
- return 0;
- }
-
- /**
- * Returns the error stream of the shell.
- * @see java.lang.Process#getErrorStream()
- */
- public InputStream getErrorStream() {
- return errorStream;
- }
-
- /**
- * Returns the input stream for the shell.
- * @see java.lang.Process#getInputStream()
- */
- public InputStream getInputStream() {
- return inputStream;
- }
-
- /**
- * Returns the output stream for the shell.
- * @see java.lang.Process#getOutputStream()
- */
- public OutputStream getOutputStream() {
- return outputStream;
- }
-
- /**
- * Waits for the shell to exit.
- * @see java.lang.Process#waitFor()
- */
- public synchronized int waitFor() throws InterruptedException {
-
- while(hostShell.isActive()) {
- try {
- wait(1000);
- } catch (InterruptedException e) {
- // ignore because we're polling to see if shell is still active.
- }
- }
-
- try {
- // Wait a second to try to get some more output from the target shell before closing.
- wait(1000);
- // Allow for the data from the stream to be read if it's available
- if (inputStream.available() != 0 || errorStream.available() != 0)
- throw new InterruptedException();
-
- hostShellInput.close();
- hostShellError.close();
- inputStream.close();
- errorStream.close();
- outputStream.close();
- } catch (IOException e) {
- // Ignore
- }
- return 0;
- }
-
- /**
- * Process an RSE Shell event, by writing the lines of text contained
- * in the event into the adapter's streams.
- * @see org.eclipse.rse.services.shells.IHostShellOutputListener#shellOutputChanged(org.eclipse.rse.services.shells.IHostShellChangeEvent)
- */
- public void shellOutputChanged(IHostShellChangeEvent event) {
- IHostOutput[] input = event.getLines();
- OutputStream outputStream = event.isError() ? hostShellError : hostShellInput;
- try {
- for(int i = 0; i < input.length; i++) {
- outputStream.write(input[i].getString().getBytes());
- outputStream.write('\n');
- outputStream.flush();
- }
- } catch(IOException e) {
- // Ignore
- }
- }
-
-}
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostOutput.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostOutput.java
deleted file mode 100644
index 2cc4126d3..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostOutput.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed the initial implementation:
- * David McKnight.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.shells;
-
-public interface IHostOutput
-{
- public String getString();
-}
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShell.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShell.java
deleted file mode 100644
index 8139cfcb5..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShell.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.shells;
-
-
-public interface IHostShell
-{
- public boolean isActive();
- public void writeToShell(String command);
-
- public void addOutputListener(IHostShellOutputListener listener);
-
- public IHostShellOutputReader getStandardOutputReader();
- public IHostShellOutputReader getStandardErrorReader();
-
- public void exit();
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellChangeEvent.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellChangeEvent.java
deleted file mode 100644
index 68be8f284..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellChangeEvent.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.shells;
-
-public interface IHostShellChangeEvent
-{
- public IHostShell getHostShell();
- public IHostShellOutputReader getReader();
- public IHostOutput[] getLines();
- public boolean isError();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellOutputListener.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellOutputListener.java
deleted file mode 100644
index 2eba910ab..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellOutputListener.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.shells;
-
-public interface IHostShellOutputListener
-{
- public void shellOutputChanged(IHostShellChangeEvent event);
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellOutputNotifier.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellOutputNotifier.java
deleted file mode 100644
index da7273e44..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellOutputNotifier.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.shells;
-
-public interface IHostShellOutputNotifier
-{
- public void fireOutputChanged(IHostShellChangeEvent event);
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellOutputReader.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellOutputReader.java
deleted file mode 100644
index 103c31ff2..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellOutputReader.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.shells;
-
-public interface IHostShellOutputReader extends IHostShellOutputNotifier
-{
- public IHostOutput readLine();
- public IHostOutput readLine(int index);
- public void addOutputListener(IHostShellOutputListener listener);
- public boolean isErrorReader();
- public void finish();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IShellService.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IShellService.java
deleted file mode 100644
index f57ebefda..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IShellService.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.shells;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.rse.services.IService;
-
-/**
- * IShellService is an abstraction for running shells and
- * shell commands
- *
- */
-public interface IShellService extends IService
-{
- /**
- * Launch a new shell in the specified directory
- * @param monitor
- * @param initialWorkingDirectory
- * @param environment Array of environment variable Strings of the form "var=text"
- * @return the shell object
- */
- public IHostShell launchShell(IProgressMonitor monitor, String initialWorkingDirectory, String[] environment);
-
- /**
- * Launch a new shell in the specified directory
- * @param monitor
- * @param initialWorkingDirectory
- * @param encoding
- * @param environment Array of environment variable Strings of the form "var=text"
- * @return the shell object
- */
- public IHostShell launchShell(IProgressMonitor monitor, String initialWorkingDirectory, String encoding, String[] environment);
-
- /**
- * Run a command in it's own shell
- * @param monitor
- * @param initialWorkingDirectory
- * @param command
- * @param environment Array of environment variable Strings of the form "var=text"
- * @return the shell object for getting output and error streams
- */
- public IHostShell runCommand(IProgressMonitor monitor, String initialWorkingDirectory, String command, String[] environment);
-
- /**
- * Run a command in it's own shell
- * @param monitor
- * @param initialWorkingDirectory
- * @param command
- * @param encoding
- * @param environment Array of environment variable Strings of the form "var=text"
- * @return the shell object for getting output and error streams
- */
- public IHostShell runCommand(IProgressMonitor monitor, String initialWorkingDirectory, String command, String encoding, String[] environment);
-
- /**
- * Return an array of environment variables that describe the environment on the host.
- * Each String returned is of the format "var=text": Everything up to the
- * first equals sign is the name of the given environment variable, everything
- * after the equals sign is its contents.
- * @return Array of environment variable Strings of the form "var=text"
- */
- public String[] getHostEnvironment();
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/OutputPattern.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/OutputPattern.java
deleted file mode 100644
index 1974f2216..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/OutputPattern.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and International Business Machines Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.shells;
-
-import java.util.ArrayList;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class OutputPattern
-{
-
-
- private Pattern _pattern;
- private String _objType;
- private ArrayList _matchOrder;
-
- public OutputPattern(String objType, String matchOrder, Pattern thePattern)
- {
- _objType = objType;
- _pattern = thePattern;
-
- _matchOrder = new ArrayList();
- //Here we add a dummy first element to the ArrayList, to mimick how the PatternMatcher stores it's
- //matches (starting with group 1).
- _matchOrder.add(null);
-
- int index = 0;
- int nextSpace = 0;
- //Walk the matchOrder string parsing out words and adding them to _matchOrder...Could use StringTokenizer
- //but this seem much simpler.
- while ((nextSpace = matchOrder.indexOf(" ", index)) > 0) //$NON-NLS-1$
- {
- _matchOrder.add(matchOrder.substring(index, nextSpace).toLowerCase());
- index = nextSpace;
- while ((index < matchOrder.length()) && (matchOrder.charAt(index) == ' '))
- index++;
- }
- _matchOrder.add(matchOrder.substring(index, matchOrder.length()).toLowerCase());
-
- }
-
- public ParsedOutput matchLine(String theLine)
- {
- Matcher matcher = null;
- try
- {
- matcher = _pattern.matcher(theLine);
- if (!matcher.matches())
- return null;
- }
- catch (StringIndexOutOfBoundsException e)
- {
- //Getting an exception here, when theLine is an empty line for some patterns..should probably investigate,
- //but for now we'll just handle it...
- return null;
- }
-
- String fileString = ""; //$NON-NLS-1$
- String lineString = ""; //$NON-NLS-1$
- //Groups start at 1 (group 0 is the entire match).
- for (int i = 1; i < _matchOrder.size(); i++)
- {
- String mStr = (String)_matchOrder.get(i);
- if (mStr.equals("file")) //$NON-NLS-1$
- fileString = matcher.group(i);
- else if (mStr.equals("line")) //$NON-NLS-1$
- lineString = matcher.group(i);
- }
- int line = 1;
- if (lineString.length() > 0)
- {
- try
- {
- line = Integer.parseInt(lineString);
- }
- catch (NumberFormatException e)
- {
- }
- }
-
- return new ParsedOutput(_objType, theLine, fileString, line, 1);
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/ParsedOutput.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/ParsedOutput.java
deleted file mode 100644
index 82e37851b..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/ParsedOutput.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.shells;
-
-//This is just a convenience object for storing information parsed out of a line of output.
-public class ParsedOutput
-{
-
-
- public String type;
- public String text;
- public String file;
- public int line;
- public int col;
-
- public ParsedOutput (String theType, String theText, String theFile, int theLine, int theColumn)
- {
- type = theType;
- text = theText;
- file = theFile;
- line = theLine;
- col = theColumn;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/Patterns.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/Patterns.java
deleted file mode 100644
index ab53981ed..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/Patterns.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-package org.eclipse.rse.services.shells;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.regex.Pattern;
-
-import org.eclipse.rse.services.Activator;
-import org.osgi.framework.Bundle;
-
-public class Patterns {
- private ArrayList _theCommands;
- private String _currentCommand;
-
- public Patterns() {
- _theCommands = new ArrayList();
- parsePatterns();
- }
-
- private void parsePatterns() {
- Bundle bundle = Activator.getDefault().getBundle();
- URL patterns = bundle.getEntry("/patterns.dat"); //$NON-NLS-1$
- if (patterns != null) {
- try {
- InputStream in = patterns.openStream();
- BufferedReader reader = new BufferedReader(new InputStreamReader(in));
- _theCommands.clear();
- String curLine;
- CommandPattern curCommand = null;
- while ((curLine = reader.readLine()) != null) {
- curLine = curLine.trim();
- // Skip the current line if it is empty or starts with a #
- if ((curLine.length() == 0) || (curLine.charAt(0) == '#')) {
- continue;
- }
- // Check if this line is the start of a new command section
- if (curLine.startsWith("command")) { //$NON-NLS-1$
- int colon = curLine.indexOf(":"); //$NON-NLS-1$
- // Check that there is something after the colon
- if (colon == (curLine.length() - 1)) {
- continue;
- }
- Pattern thePattern = Pattern.compile(curLine.substring(colon + 1, curLine.length()).trim());
- curCommand = new CommandPattern(thePattern);
- _theCommands.add(curCommand);
- }
- // If we get here, the line must be an output pattern
- else {
- int firstSpace = curLine.indexOf(" "); //$NON-NLS-1$
- int patternWord = curLine.indexOf("pattern"); //$NON-NLS-1$
- int firstEquals = curLine.indexOf("="); //$NON-NLS-1$
- if ((firstEquals == -1) || (firstEquals == (curLine.length() - 1))) {
- continue;
- }
- String objType = curLine.substring(0, firstSpace);
- String matchOrder = curLine.substring(firstSpace + 1, patternWord).trim();
- String patternString = curLine.substring(firstEquals + 1, curLine.length());
- Pattern thePattern = Pattern.compile(patternString.trim());
- if (curCommand != null) {
- curCommand.addOutputPattern(new OutputPattern(objType, matchOrder, thePattern));
- }
- }
- }
- in.close();
- } catch (IOException e) {
- Activator.getDefault().logException(e);
- }
- }
- }
-
- public void refresh(String theCommand) {
- _currentCommand = theCommand;
- parsePatterns();
- }
-
- public void update(String theCommand) {
- _currentCommand = theCommand;
- }
-
- public ParsedOutput matchLine(String theLine) {
- CommandPattern curCommand;
- ParsedOutput matchedOutput = null;
- int commands = _theCommands.size();
- if (_currentCommand != null)
- {
-
- for (int i = 0; i < commands; i++)
- {
- curCommand = (CommandPattern) _theCommands.get(i);
- if (curCommand.matchCommand(_currentCommand))
- {
- matchedOutput = curCommand.matchLine(theLine);
- }
- if (matchedOutput != null)
- {
- return matchedOutput;
- }
- }
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/SimpleHostOutput.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/SimpleHostOutput.java
deleted file mode 100644
index c95791008..000000000
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/SimpleHostOutput.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed the initial implementation:
- * David McKnight.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-package org.eclipse.rse.services.shells;
-
-public class SimpleHostOutput implements IHostOutput
-{
- private String _line;
- public SimpleHostOutput(String line)
- {
- _line = line;
- }
-
- public String getString()
- {
- return _line;
- }
-
- public String toString()
- {
- return _line;
- }
-}

Back to the top