diff --git a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/IClientServerConstants.java b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/IClientServerConstants.java index 033c01a6eed..221f4767b88 100644 --- a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/IClientServerConstants.java +++ b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/IClientServerConstants.java @@ -1,15 +1,15 @@ /******************************************************************************** * 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 + * 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, + * 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. ********************************************************************************/ @@ -19,20 +19,25 @@ package org.eclipse.rse.services.clientserver; /** * Constants used by the Client and Server */ - + public interface IClientServerConstants { + /** + * PLUGIN_ID to use in SimpleSystemMessage for clientserver. + * + * @since 3.0 + */ + public static final String PLUGIN_ID = "org.eclipse.rse.services"; //$NON-NLS-1$ -// public static final String PLUGIN_ID ="org.eclipse.rse"; // public static final String PREFIX = PLUGIN_ID+"."; // // Resource Bundle ids -// public static final String RESID_PREFIX = PREFIX+"ui."; +// public static final String RESID_PREFIX = PREFIX+"ui."; // // Messages -// public static final String MSG_PREFIX = RESID_PREFIX+"msg."; - +// public static final String MSG_PREFIX = RESID_PREFIX+"msg."; + public static final String MSG_EXCEPTION_OCCURRED = "RSEG1003"; //$NON-NLS-1$ - public static final String MSG_EXCEPTION_DELETING = "RSEG1063"; //""RSEG1004"; //$NON-NLS-1$ - public static final String MSG_EXCEPTION_RENAMING = "RSEG1064"; //"RSEG1005"; //MSG_EXCEPTION_PREFIX + "Renaming"; //$NON-NLS-1$ + public static final String MSG_EXCEPTION_DELETING = "RSEG1063"; //""RSEG1004"; //$NON-NLS-1$ + public static final String MSG_EXCEPTION_RENAMING = "RSEG1064"; //"RSEG1005"; //MSG_EXCEPTION_PREFIX + "Renaming"; //$NON-NLS-1$ public static final String MSG_EXCEPTION_MOVING = "RSEG1065"; //MSG_EXCEPTION_PREFIX + "Moving"; //$NON-NLS-1$ public static final String FILEMSG_DELETE_FILE_FAILED = "RSEF1300"; //$NON-NLS-1$ @@ -58,11 +63,11 @@ public interface IClientServerConstants { /** * Flag to indicate "include files only, not folders" */ - public static final int INCLUDE_FOLDERS_ONLY = 4; + public static final int INCLUDE_FOLDERS_ONLY = 4; /** * Flag to indicate "include files only, not folders" */ public static final int INCLUDE_ALL = 8; - + } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/ArchiveHandlerManager.java b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/ArchiveHandlerManager.java index f12d596c611..3f2c27cf929 100644 --- a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/ArchiveHandlerManager.java +++ b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/ArchiveHandlerManager.java @@ -28,6 +28,7 @@ import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.Iterator; +import org.eclipse.rse.services.clientserver.IClientServerConstants; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.clientserver.messages.SystemOperationFailedException; import org.eclipse.rse.services.clientserver.messages.SystemUnsupportedOperationException; @@ -42,8 +43,6 @@ import org.eclipse.rse.services.clientserver.messages.SystemUnsupportedOperation */ public class ArchiveHandlerManager { - private static final String PLUGIN_ID = "clientserver"; //$NON-NLS-1$ - /** * The string that separates the virtual part of an absolute path from the * real part. @@ -111,7 +110,7 @@ public class ArchiveHandlerManager if (virtualpath == null) virtualpath = ""; //$NON-NLS-1$ ISystemArchiveHandler handler = getRegisteredHandler(file); if (handler == null || !handler.exists()) { - throw new SystemUnsupportedOperationException(PLUGIN_ID, "No archive handler for " + file); //$NON-NLS-1$ + throw new SystemUnsupportedOperationException(IClientServerConstants.PLUGIN_ID, "No archive handler for " + file); //$NON-NLS-1$ } return handler.getVirtualChildren(virtualpath, null); } @@ -309,11 +308,11 @@ public class ArchiveHandlerManager catch (InvocationTargetException e) { //Throwable target = e.getCause(); - throw new SystemOperationFailedException(PLUGIN_ID, "instantiate handler for " + file.getName(), e); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "instantiate handler for " + file.getName(), e); //$NON-NLS-1$ } catch (Exception e) { - throw new SystemOperationFailedException(PLUGIN_ID, "instantiate handler for " + file.getName(), e); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "instantiate handler for " + file.getName(), e); //$NON-NLS-1$ } _handlers.put(file, handler); return handler; @@ -508,7 +507,7 @@ public class ArchiveHandlerManager { if (!isRegisteredArchive(newFile.getName())) { - throw new SystemOperationFailedException(PLUGIN_ID, "Could not create new archive, because " //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not create new archive, because " //$NON-NLS-1$ + newFile + " is not a registered type of archive."); //$NON-NLS-1$ } @@ -516,12 +515,12 @@ public class ArchiveHandlerManager { if (!newFile.isFile()) { - throw new SystemOperationFailedException(PLUGIN_ID, "Could not create new archive." //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not create new archive." //$NON-NLS-1$ + newFile + " is not a file."); //$NON-NLS-1$ } if (!newFile.delete()) { - throw new SystemOperationFailedException(PLUGIN_ID, "Could not create new archive." //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not create new archive." //$NON-NLS-1$ + newFile + " could not be deleted."); //$NON-NLS-1$ } } @@ -530,13 +529,13 @@ public class ArchiveHandlerManager { if (!newFile.createNewFile()) { - throw new SystemOperationFailedException(PLUGIN_ID, "Could not create new archive." //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not create new archive." //$NON-NLS-1$ + newFile + " could not be created."); //$NON-NLS-1$ } } catch (IOException e) { - throw new SystemOperationFailedException(PLUGIN_ID, "Could not create new archive: " + newFile, e); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not create new archive: " + newFile, e); //$NON-NLS-1$ } ISystemArchiveHandler handler = getRegisteredHandler(newFile); diff --git a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/SystemTarHandler.java b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/SystemTarHandler.java index d73fadeb748..0d60e810687 100644 --- a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/SystemTarHandler.java +++ b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/SystemTarHandler.java @@ -47,9 +47,9 @@ import java.util.Iterator; import java.util.List; import java.util.Vector; -import org.eclipse.rse.internal.services.Activator; import org.eclipse.rse.internal.services.clientserver.archiveutils.ITarConstants; import org.eclipse.rse.internal.services.clientserver.archiveutils.SystemArchiveUtil; +import org.eclipse.rse.services.clientserver.IClientServerConstants; import org.eclipse.rse.services.clientserver.ISystemFileTypes; import org.eclipse.rse.services.clientserver.ISystemOperationMonitor; import org.eclipse.rse.services.clientserver.SystemReentrantMutex; @@ -937,7 +937,7 @@ public class SystemTarHandler implements ISystemArchiveHandler { if (inStream == null) { destination.setLastModified(entry.getModificationTime()); - throw new SystemUnexpectedErrorException(Activator.PLUGIN_ID); + throw new SystemUnexpectedErrorException(IClientServerConstants.PLUGIN_ID); } //Need to make sure destination file exists. if (!destination.exists()) @@ -960,7 +960,7 @@ public class SystemTarHandler implements ISystemArchiveHandler { } } catch (IOException e) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } finally { @@ -1009,12 +1009,12 @@ public class SystemTarHandler implements ISystemArchiveHandler { if (!destinationParent.exists()) { if (!destinationParent.mkdirs()) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Create folder " + destinationParent); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Create folder " + destinationParent); //$NON-NLS-1$ } } // otherwise if the destination directory does exist, but is not a directory, then quit else if (!destinationParent.isDirectory()) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "No folder: " + destinationParent); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "No folder: " + destinationParent); //$NON-NLS-1$ } fullVirtualName = ArchiveHandlerManager.cleanUpVirtualPath(fullVirtualName); @@ -1031,7 +1031,7 @@ public class SystemTarHandler implements ISystemArchiveHandler { VirtualChild dir = vfs.getEntry(fullVirtualName); if (dir == null || !dir.isDirectory) { - throw new SystemUnexpectedErrorException(Activator.PLUGIN_ID); + throw new SystemUnexpectedErrorException(IClientServerConstants.PLUGIN_ID); } if (destination == null) { @@ -1059,7 +1059,7 @@ public class SystemTarHandler implements ISystemArchiveHandler { // if the directory does not exist, try to create it if (!topDir.exists() && !topDir.mkdirs()) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Create folder " + topDir); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Create folder " + topDir); //$NON-NLS-1$ } else { extractVirtualFile(fullVirtualName, topDir, archiveOperationMonitor); @@ -1092,7 +1092,7 @@ public class SystemTarHandler implements ISystemArchiveHandler { } catch (IOException e) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } finally { @@ -1165,14 +1165,14 @@ public class SystemTarHandler implements ISystemArchiveHandler { } catch (Exception e) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } finally { releaseMutex(mutexLockStatus); } setArchiveOperationMonitorStatusDone(archiveOperationMonitor); - throw new SystemUnexpectedErrorException(Activator.PLUGIN_ID); + throw new SystemUnexpectedErrorException(IClientServerConstants.PLUGIN_ID); } /** @@ -1220,7 +1220,7 @@ public class SystemTarHandler implements ISystemArchiveHandler { if (!files[i].exists() || !files[i].canRead()) { setArchiveOperationMonitorStatusDone(archiveOperationMonitor); - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Cannot read: " + files[i]); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Cannot read: " + files[i]); //$NON-NLS-1$ } // if the entry already exists, then we should do a replace @@ -1315,7 +1315,7 @@ public class SystemTarHandler implements ISystemArchiveHandler { outputTempFile.delete(); } setArchiveOperationMonitorStatusDone(archiveOperationMonitor); - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } finally { @@ -1662,11 +1662,11 @@ public class SystemTarHandler implements ISystemArchiveHandler { updateCache(); } catch (IOException e) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } if (!file.exists() && !file.canRead()) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Cannot read " + file); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Cannot read " + file); //$NON-NLS-1$ } fullVirtualName = ArchiveHandlerManager.cleanUpVirtualPath(fullVirtualName); @@ -1746,7 +1746,7 @@ public class SystemTarHandler implements ISystemArchiveHandler { replaceFile(outputTempFile, false); } catch (IOException e) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } } @@ -1837,12 +1837,12 @@ public class SystemTarHandler implements ISystemArchiveHandler { // we just did replaceFile(outputTempFile, false); } else { - throw new SystemLockTimeoutException(Activator.PLUGIN_ID); + throw new SystemLockTimeoutException(IClientServerConstants.PLUGIN_ID); } } catch (IOException e) { if (!(outputTempFile == null)) outputTempFile.delete(); - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Could not delete " + fullVirtualName, e); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not delete " + fullVirtualName, e); //$NON-NLS-1$ } finally { @@ -1915,7 +1915,7 @@ public class SystemTarHandler implements ISystemArchiveHandler { // if the virtual file to be renamed does not exist, then quit if (!child.exists()) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Not exists: " + child); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Not exists: " + child); //$NON-NLS-1$ } // open a new temp file which will be our destination for the new tar file @@ -2000,12 +2000,12 @@ public class SystemTarHandler implements ISystemArchiveHandler { } else { - throw new SystemLockTimeoutException(Activator.PLUGIN_ID); + throw new SystemLockTimeoutException(IClientServerConstants.PLUGIN_ID); } } catch (IOException e) { if (!(outputTempFile == null)) outputTempFile.delete(); - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Could not rename " + fullVirtualName, e); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not rename " + fullVirtualName, e); //$NON-NLS-1$ } finally { @@ -2152,7 +2152,7 @@ public class SystemTarHandler implements ISystemArchiveHandler { extractVirtualFile(fullNames[i], files[i], archiveOperationMonitor); } catch (IOException e) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } } @@ -2250,7 +2250,7 @@ public class SystemTarHandler implements ISystemArchiveHandler { // since we have already updated to the cache replaceFile(outputTempFile, false); } else { - throw new SystemLockTimeoutException(Activator.PLUGIN_ID); + throw new SystemLockTimeoutException(IClientServerConstants.PLUGIN_ID); } } catch (IOException e) { @@ -2270,7 +2270,7 @@ public class SystemTarHandler implements ISystemArchiveHandler { { outputTempFile.delete(); } - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } finally { @@ -2380,7 +2380,7 @@ public class SystemTarHandler implements ISystemArchiveHandler { modTimeDuringCache = file.lastModified(); } catch (IOException e) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } } @@ -2425,7 +2425,7 @@ public class SystemTarHandler implements ISystemArchiveHandler { } } catch (IOException e) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } } @@ -2598,7 +2598,7 @@ public class SystemTarHandler implements ISystemArchiveHandler { public void add(InputStream stream, String virtualPath, String name, String sourceEncoding, String targetEncoding, boolean isText, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException { - throw new SystemUnsupportedOperationException(Activator.PLUGIN_ID, "add"); //$NON-NLS-1$ + throw new SystemUnsupportedOperationException(IClientServerConstants.PLUGIN_ID, "add"); //$NON-NLS-1$ } public void add(File file, String virtualPath, String name, String sourceEncoding, String targetEncoding, ISystemFileTypes typeRegistery, @@ -2608,7 +2608,7 @@ public class SystemTarHandler implements ISystemArchiveHandler { public void replace(String fullVirtualName, InputStream stream, String name, String sourceEncoding, String targetEncoding, boolean isText, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException { - throw new SystemUnsupportedOperationException(Activator.PLUGIN_ID, "replace"); //$NON-NLS-1$ + throw new SystemUnsupportedOperationException(IClientServerConstants.PLUGIN_ID, "replace"); //$NON-NLS-1$ } /** diff --git a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/SystemZipHandler.java b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/SystemZipHandler.java index d51de5e420a..4c21b65e9b1 100644 --- a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/SystemZipHandler.java +++ b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/SystemZipHandler.java @@ -45,9 +45,9 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import java.util.zip.ZipOutputStream; -import org.eclipse.rse.internal.services.Activator; import org.eclipse.rse.internal.services.clientserver.archiveutils.SystemArchiveUtil; import org.eclipse.rse.internal.services.clientserver.archiveutils.SystemUniversalZipEntry; +import org.eclipse.rse.services.clientserver.IClientServerConstants; import org.eclipse.rse.services.clientserver.ISystemFileTypes; import org.eclipse.rse.services.clientserver.ISystemOperationMonitor; import org.eclipse.rse.services.clientserver.SystemEncodingUtil; @@ -555,13 +555,13 @@ public class SystemZipHandler implements ISystemArchiveHandler return retVal; } } else { - throw new SystemLockTimeoutException(Activator.PLUGIN_ID); + throw new SystemLockTimeoutException(IClientServerConstants.PLUGIN_ID); } } catch (Exception e) { if (closeZipFile) closeZipFile(); - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } finally { @@ -632,7 +632,7 @@ public class SystemZipHandler implements ISystemArchiveHandler catch (Exception e) { if (closeZipFile) closeZipFile(); - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } finally { @@ -759,7 +759,7 @@ public class SystemZipHandler implements ISystemArchiveHandler try { openZipFile(); } catch (IOException ioe) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Could not open the ZipFile " + _file.toString(), ioe); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not open the ZipFile " + _file.toString(), ioe); //$NON-NLS-1$ } try { safeGetEntry(fullVirtualName); @@ -855,7 +855,7 @@ public class SystemZipHandler implements ISystemArchiveHandler catch (IOException e) { if (closeZipFile) closeZipFile(); - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } } @@ -885,7 +885,7 @@ public class SystemZipHandler implements ISystemArchiveHandler ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException { if (!_exists) - throw new SystemUnexpectedErrorException(Activator.PLUGIN_ID); + throw new SystemUnexpectedErrorException(IClientServerConstants.PLUGIN_ID); int mutexLockStatus = _mutex.waitForLock(archiveOperationMonitor, Long.MAX_VALUE); if (SystemReentrantMutex.LOCK_STATUS_NOLOCK != mutexLockStatus) { @@ -960,7 +960,7 @@ public class SystemZipHandler implements ISystemArchiveHandler return; } if (closeZipFile) closeZipFile(); - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } finally { @@ -970,7 +970,7 @@ public class SystemZipHandler implements ISystemArchiveHandler } else { - throw new SystemLockTimeoutException(Activator.PLUGIN_ID); + throw new SystemLockTimeoutException(IClientServerConstants.PLUGIN_ID); } } @@ -1008,13 +1008,13 @@ public class SystemZipHandler implements ISystemArchiveHandler ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException { if (!_exists) - throw new SystemUnexpectedErrorException(Activator.PLUGIN_ID); + throw new SystemUnexpectedErrorException(IClientServerConstants.PLUGIN_ID); if (!destinationParent.isDirectory()) - throw new SystemUnexpectedErrorException(Activator.PLUGIN_ID); + throw new SystemUnexpectedErrorException(IClientServerConstants.PLUGIN_ID); dir = ArchiveHandlerManager.cleanUpVirtualPath(dir); if (!_virtualFS.containsKey(dir)) - throw new SystemUnexpectedErrorException(Activator.PLUGIN_ID); + throw new SystemUnexpectedErrorException(IClientServerConstants.PLUGIN_ID); String name; int charsToTrim; @@ -1048,7 +1048,7 @@ public class SystemZipHandler implements ISystemArchiveHandler { if (!SystemArchiveUtil.delete(destination)) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Could not overwrite directory " + destination); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not overwrite directory " + destination); //$NON-NLS-1$ } } @@ -1056,7 +1056,7 @@ public class SystemZipHandler implements ISystemArchiveHandler { if (!destination.mkdirs()) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Could not overwrite directory " + destination); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not overwrite directory " + destination); //$NON-NLS-1$ } } } @@ -1084,7 +1084,7 @@ public class SystemZipHandler implements ISystemArchiveHandler if (newChildren.length == 0) { //it is a error situation, or the operation has been cancelled. - throw new SystemUnexpectedErrorException(Activator.PLUGIN_ID); + throw new SystemUnexpectedErrorException(IClientServerConstants.PLUGIN_ID); } extractVirtualFile(dir + '/', topFile, sourceEncoding, isText, archiveOperationMonitor); @@ -1110,7 +1110,7 @@ public class SystemZipHandler implements ISystemArchiveHandler { if (!nextFile.mkdirs()) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Could not create folder " + nextFile.toString()); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not create folder " + nextFile.toString()); //$NON-NLS-1$ } } else @@ -1141,7 +1141,7 @@ public class SystemZipHandler implements ISystemArchiveHandler { if (!file.createNewFile()) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "File already exists: " + file.toString()); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "File already exists: " + file.toString()); //$NON-NLS-1$ } else { @@ -1156,7 +1156,7 @@ public class SystemZipHandler implements ISystemArchiveHandler } else { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Could not create " + file.toString()); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not create " + file.toString()); //$NON-NLS-1$ } } } @@ -1177,7 +1177,7 @@ public class SystemZipHandler implements ISystemArchiveHandler ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException { if (!_exists) - throw new SystemUnexpectedErrorException(Activator.PLUGIN_ID); + throw new SystemUnexpectedErrorException(IClientServerConstants.PLUGIN_ID); virtualPath = ArchiveHandlerManager.cleanUpVirtualPath(virtualPath); if (exists(virtualPath + "/" + name, archiveOperationMonitor)) //$NON-NLS-1$ @@ -1234,18 +1234,18 @@ public class SystemZipHandler implements ISystemArchiveHandler catch (IOException e) { closeZipFile(); - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Could not add a file.", e); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not add a file.", e); //$NON-NLS-1$ } closeZipFile(); } } else { - throw new SystemLockTimeoutException(Activator.PLUGIN_ID); + throw new SystemLockTimeoutException(IClientServerConstants.PLUGIN_ID); } } catch(Exception e) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } finally { @@ -1288,7 +1288,7 @@ public class SystemZipHandler implements ISystemArchiveHandler boolean closeZipFile, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException { if (!_exists) - throw new SystemUnexpectedErrorException(Activator.PLUGIN_ID); + throw new SystemUnexpectedErrorException(IClientServerConstants.PLUGIN_ID); int mutexLockStatus = SystemReentrantMutex.LOCK_STATUS_NOLOCK; try @@ -1309,7 +1309,7 @@ public class SystemZipHandler implements ISystemArchiveHandler throw new SystemOperationCancelledException(); } if (!files[i].exists() || !files[i].canRead()) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Cannot read: " + files[i]); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Cannot read: " + files[i]); //$NON-NLS-1$ } String fullVirtualName = getFullVirtualName(virtualPath, names[i]); if (exists(fullVirtualName, archiveOperationMonitor)) @@ -1381,11 +1381,11 @@ public class SystemZipHandler implements ISystemArchiveHandler if (closeZipFile) closeZipFile(); } } else { - throw new SystemLockTimeoutException(Activator.PLUGIN_ID); + throw new SystemLockTimeoutException(IClientServerConstants.PLUGIN_ID); } } catch (IOException ioe) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, ioe); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, ioe); } finally { @@ -1799,14 +1799,14 @@ public class SystemZipHandler implements ISystemArchiveHandler return true; } } else { - throw new SystemLockTimeoutException(Activator.PLUGIN_ID); + throw new SystemLockTimeoutException(IClientServerConstants.PLUGIN_ID); } } catch (IOException e) { if (!(outputTempFile == null)) outputTempFile.delete(); if (closeZipFile) closeZipFile(); - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Could not delete " + fullVirtualName, e); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not delete " + fullVirtualName, e); //$NON-NLS-1$ } finally { @@ -1852,10 +1852,10 @@ public class SystemZipHandler implements ISystemArchiveHandler throws SystemMessageException { if (!_exists) - throw new SystemUnexpectedErrorException(Activator.PLUGIN_ID); + throw new SystemUnexpectedErrorException(IClientServerConstants.PLUGIN_ID); if (!file.exists() || !file.canRead()) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Cannot read: " + file); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Cannot read: " + file); //$NON-NLS-1$ } fullVirtualName = ArchiveHandlerManager.cleanUpVirtualPath(fullVirtualName); if (!exists(fullVirtualName, archiveOperationMonitor)) @@ -1913,7 +1913,7 @@ public class SystemZipHandler implements ISystemArchiveHandler if (!(outputTempFile == null)) outputTempFile.delete(); if (closeZipFile) closeZipFile(); - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Could not replace " + file.getName(), e); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not replace " + file.getName(), e); //$NON-NLS-1$ } if (closeZipFile) closeZipFile(); @@ -1928,7 +1928,7 @@ public class SystemZipHandler implements ISystemArchiveHandler ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException { if (!_exists) - throw new SystemUnexpectedErrorException(Activator.PLUGIN_ID); + throw new SystemUnexpectedErrorException(IClientServerConstants.PLUGIN_ID); fullVirtualName = ArchiveHandlerManager.cleanUpVirtualPath(fullVirtualName); if (!exists(fullVirtualName, archiveOperationMonitor)) @@ -1979,7 +1979,7 @@ public class SystemZipHandler implements ISystemArchiveHandler if (!(outputTempFile == null)) outputTempFile.delete(); closeZipFile(); - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Could not replace " + fullVirtualName, e); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not replace " + fullVirtualName, e); //$NON-NLS-1$ } closeZipFile(); } @@ -2005,14 +2005,14 @@ public class SystemZipHandler implements ISystemArchiveHandler throws SystemMessageException { if (!_exists) - throw new SystemUnexpectedErrorException(Activator.PLUGIN_ID); + throw new SystemUnexpectedErrorException(IClientServerConstants.PLUGIN_ID); fullVirtualName = ArchiveHandlerManager.cleanUpVirtualPath(fullVirtualName); newFullVirtualName = ArchiveHandlerManager.cleanUpVirtualPath(newFullVirtualName); VirtualChild vc = getVirtualFile(fullVirtualName, archiveOperationMonitor); if (!vc.exists()) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "The virtual file " + fullVirtualName + " does not exist."); //$NON-NLS-1$ //$NON-NLS-2$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "The virtual file " + fullVirtualName + " does not exist."); //$NON-NLS-1$ //$NON-NLS-2$ } File outputTempFile = null; int mutexLockStatus = SystemReentrantMutex.LOCK_STATUS_NOLOCK; @@ -2089,14 +2089,14 @@ public class SystemZipHandler implements ISystemArchiveHandler } else { - throw new SystemLockTimeoutException(Activator.PLUGIN_ID); + throw new SystemLockTimeoutException(IClientServerConstants.PLUGIN_ID); } } catch (IOException e) { if (!(outputTempFile == null)) outputTempFile.delete(); if (closeZipFile) closeZipFile(); - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Could not rename " + fullVirtualName, e); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not rename " + fullVirtualName, e); //$NON-NLS-1$ } finally { @@ -2168,7 +2168,7 @@ public class SystemZipHandler implements ISystemArchiveHandler } catch (IOException e) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Could not extract virtual file: " + fullNames[i], e); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not extract virtual file: " + fullNames[i], e); //$NON-NLS-1$ } } return files; @@ -2210,7 +2210,7 @@ public class SystemZipHandler implements ISystemArchiveHandler { if (!_exists) { - throw new SystemUnexpectedErrorException(Activator.PLUGIN_ID); + throw new SystemUnexpectedErrorException(IClientServerConstants.PLUGIN_ID); } if (exists(name, archiveOperationMonitor)) { @@ -2263,7 +2263,7 @@ public class SystemZipHandler implements ISystemArchiveHandler return true; } } else { - throw new SystemLockTimeoutException(Activator.PLUGIN_ID); + throw new SystemLockTimeoutException(IClientServerConstants.PLUGIN_ID); } } catch (IOException e) @@ -2271,7 +2271,7 @@ public class SystemZipHandler implements ISystemArchiveHandler System.out.println(); System.out.println(e.getMessage()); if (closeZipFile) closeZipFile(); - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "Could not add a file.", e); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "Could not add a file.", e); //$NON-NLS-1$ } finally { @@ -2435,7 +2435,7 @@ public class SystemZipHandler implements ISystemArchiveHandler } catch (IOException e) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } _exists = true; } @@ -2481,7 +2481,7 @@ public class SystemZipHandler implements ISystemArchiveHandler SystemSearchStringMatchLocator locator = new SystemSearchStringMatchLocator(bufReader, matcher); matches = locator.locateMatches(); } catch (IOException e) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } closeZipFile(); @@ -2527,7 +2527,7 @@ public class SystemZipHandler implements ISystemArchiveHandler entry = safeGetEntry(fullVirtualName); } catch (IOException e) { if (closeZipFile) closeZipFile(); - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } if (closeZipFile) closeZipFile(); @@ -2564,7 +2564,7 @@ public class SystemZipHandler implements ISystemArchiveHandler catch (IOException e) { if (closeZipFile) closeZipFile(); - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } if (closeZipFile) closeZipFile(); return entry.getCompressedSize(); @@ -2594,7 +2594,7 @@ public class SystemZipHandler implements ISystemArchiveHandler entry = safeGetEntry(fullVirtualName); } catch (IOException e) { if (closeZipFile) closeZipFile(); - throw new SystemOperationFailedException(Activator.PLUGIN_ID, e); + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, e); } if (closeZipFile) closeZipFile(); @@ -2696,7 +2696,7 @@ public class SystemZipHandler implements ISystemArchiveHandler if (!_exists) { setArchiveOperationMonitorStatusDone(archiveOperationMonitor); - throw new SystemUnexpectedErrorException(Activator.PLUGIN_ID); + throw new SystemUnexpectedErrorException(IClientServerConstants.PLUGIN_ID); } virtualPath = ArchiveHandlerManager.cleanUpVirtualPath(virtualPath); @@ -2777,7 +2777,7 @@ public class SystemZipHandler implements ISystemArchiveHandler if (!_exists) { setArchiveOperationMonitorStatusDone(archiveOperationMonitor); - throw new SystemUnexpectedErrorException(Activator.PLUGIN_ID); + throw new SystemUnexpectedErrorException(IClientServerConstants.PLUGIN_ID); } virtualPath = ArchiveHandlerManager.cleanUpVirtualPath(virtualPath); @@ -2850,7 +2850,7 @@ public class SystemZipHandler implements ISystemArchiveHandler setArchiveOperationMonitorStatusDone(archiveOperationMonitor); } } else { - throw new SystemLockTimeoutException(Activator.PLUGIN_ID); + throw new SystemLockTimeoutException(IClientServerConstants.PLUGIN_ID); } } catch (Exception e) diff --git a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/VirtualChild.java b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/VirtualChild.java index 3b331492087..9955833a9da 100644 --- a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/VirtualChild.java +++ b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/VirtualChild.java @@ -23,7 +23,7 @@ package org.eclipse.rse.services.clientserver.archiveutils; import java.io.File; import java.io.IOException; -import org.eclipse.rse.internal.services.Activator; +import org.eclipse.rse.services.clientserver.IClientServerConstants; import org.eclipse.rse.services.clientserver.ISystemOperationMonitor; import org.eclipse.rse.services.clientserver.SystemEncodingUtil; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; @@ -313,7 +313,7 @@ public final class VirtualChild { } catch (IOException e) { - throw new SystemOperationFailedException(Activator.PLUGIN_ID, "VirtualChild.getExtractedFile()", e); //$NON-NLS-1$ + throw new SystemOperationFailedException(IClientServerConstants.PLUGIN_ID, "VirtualChild.getExtractedFile()", e); //$NON-NLS-1$ } } @@ -367,7 +367,7 @@ public final class VirtualChild { throws SystemMessageException { if (_handler == null) - throw new SystemUnexpectedErrorException(Activator.PLUGIN_ID); + throw new SystemUnexpectedErrorException(IClientServerConstants.PLUGIN_ID); if (_extractedFile == null || _extractedFile.lastModified() != getTimeStamp() || !destination.getAbsolutePath().equals(_extractedFile.getAbsolutePath()) diff --git a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemNetworkIOException.java b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemNetworkIOException.java index 29842306d50..005d89253cb 100644 --- a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemNetworkIOException.java +++ b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemNetworkIOException.java @@ -14,7 +14,7 @@ package org.eclipse.rse.services.clientserver.messages; import org.eclipse.core.runtime.IStatus; import org.eclipse.osgi.util.NLS; -import org.eclipse.rse.internal.services.Activator; +import org.eclipse.rse.services.clientserver.IClientServerConstants; /** * Exception thrown in case of errors due to network I/O Problems. @@ -31,13 +31,13 @@ public class SystemNetworkIOException extends SystemRemoteMessageException { /** * Default Constructor. - * Clients are encouraged to use the more specific constructor with pluginId instead of this one. + * Clients are encouraged to use the more specific constructor with pluginId instead of this one. * * * @param remoteException exception from communication layer. */ public SystemNetworkIOException(Exception remoteException) { - super(getMyMessage(Activator.PLUGIN_ID, remoteException), remoteException); + super(getMyMessage(IClientServerConstants.PLUGIN_ID, remoteException), remoteException); } /** diff --git a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemOperationCancelledException.java b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemOperationCancelledException.java index 7f2fb6b7dee..33d03cba2f0 100644 --- a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemOperationCancelledException.java +++ b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemOperationCancelledException.java @@ -20,7 +20,7 @@ package org.eclipse.rse.services.clientserver.messages; import org.eclipse.core.runtime.IStatus; -import org.eclipse.rse.internal.services.Activator; +import org.eclipse.rse.services.clientserver.IClientServerConstants; /** * Exception thrown when attempting an operation and the user cancelled it @@ -47,7 +47,7 @@ public class SystemOperationCancelledException extends SystemMessageException { private static SystemMessage getMyMessage() { if (myMessage == null) { - myMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, ICommonMessageIds.MSG_OPERATION_CANCELLED, IStatus.ERROR, + myMessage = new SimpleSystemMessage(IClientServerConstants.PLUGIN_ID, ICommonMessageIds.MSG_OPERATION_CANCELLED, IStatus.ERROR, CommonMessages.MSG_OPERATION_CANCELLED); } return myMessage; diff --git a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemOperationFailedException.java b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemOperationFailedException.java index b351a90ad03..de769288f7f 100644 --- a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemOperationFailedException.java +++ b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/messages/SystemOperationFailedException.java @@ -14,7 +14,7 @@ package org.eclipse.rse.services.clientserver.messages; import org.eclipse.core.runtime.IStatus; import org.eclipse.osgi.util.NLS; -import org.eclipse.rse.internal.services.Activator; +import org.eclipse.rse.services.clientserver.IClientServerConstants; /** * Generic exception thrown when anything fails and a child exception is @@ -40,7 +40,7 @@ public class SystemOperationFailedException extends SystemRemoteMessageException * @param remoteException the initial cause of this exception */ public SystemOperationFailedException(Exception remoteException) { - super(getMyMessage(Activator.PLUGIN_ID, null, remoteException), remoteException); + super(getMyMessage(IClientServerConstants.PLUGIN_ID, null, remoteException), remoteException); } /**