Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 95455 Details for
Bug 170910
[api][nls] Prepare RSE Service API For Terminal Integrations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch adding Terminal API to existing RSE plugins
TerminalAPIs_v4.diff.txt (text/plain), 103.52 KB, created by
Martin Oberhuber
on 2008-04-09 21:16:25 EDT
(
hide
)
Description:
Patch adding Terminal API to existing RSE plugins
Filename:
MIME Type:
Creator:
Martin Oberhuber
Created:
2008-04-09 21:16:25 EDT
Size:
103.52 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.services.ssh >Index: src/org/eclipse/rse/internal/services/ssh/SshServiceResources.properties >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/SshServiceResources.properties,v >retrieving revision 1.1 >diff -u -r1.1 SshServiceResources.properties >--- src/org/eclipse/rse/internal/services/ssh/SshServiceResources.properties 15 Feb 2007 09:35:31 -0000 1.1 >+++ src/org/eclipse/rse/internal/services/ssh/SshServiceResources.properties 10 Apr 2008 01:09:07 -0000 >@@ -7,6 +7,7 @@ > # > # Contributors: > # Martin Oberhuber (Wind River) - initial API and implementation >+# Yu-Fen Kuo (MontaVista) - [170910] Integrate the TM Terminal View with RSE > ################################################################################ > > # NLS_MESSAGEFORMAT_VAR >@@ -23,3 +24,6 @@ > > SshShellService_Name=SSH Shell Service > SshShellService_Description=SSH Shell Service Description >+ >+SshTerminalService_Name=SSH Terminal Service >+SshTerminalService_Description=SSH Terminal Service Description >Index: src/org/eclipse/rse/internal/services/ssh/SshServiceResources.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/SshServiceResources.java,v >retrieving revision 1.2 >diff -u -r1.2 SshServiceResources.java >--- src/org/eclipse/rse/internal/services/ssh/SshServiceResources.java 15 Feb 2007 10:28:26 -0000 1.2 >+++ src/org/eclipse/rse/internal/services/ssh/SshServiceResources.java 10 Apr 2008 01:09:07 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * Martin Oberhuber (Wind River) - initial API and implementation >+ * Yu-Fen Kuo (MontaVista) - [170910] Integrate the TM Terminal View with RSE > *******************************************************************************/ > > package org.eclipse.rse.internal.services.ssh; >@@ -33,6 +34,11 @@ > public static String SshShellService_Description; > > public static String SshShellService_Name; >+ >+ public static String SshTerminalService_Name; >+ >+ public static String SshTerminalService_Description; >+ > static { > // initialize resource bundle > NLS.initializeMessages(BUNDLE_NAME, SshServiceResources.class); >Index: src/org/eclipse/rse/internal/services/ssh/shell/SshShellService.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/shell/SshShellService.java,v >retrieving revision 1.5 >diff -u -r1.5 SshShellService.java >--- src/org/eclipse/rse/internal/services/ssh/shell/SshShellService.java 9 Apr 2008 21:40:46 -0000 1.5 >+++ src/org/eclipse/rse/internal/services/ssh/shell/SshShellService.java 10 Apr 2008 01:09:07 -0000 >@@ -63,4 +63,8 @@ > return SshServiceResources.SshShellService_Description; > } > >+ protected ISshSessionProvider getSessionProvider() { >+ return fSessionProvider; >+ } >+ > } >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.ssh/META-INF/MANIFEST.MF,v >retrieving revision 1.15 >diff -u -r1.15 MANIFEST.MF >--- META-INF/MANIFEST.MF 26 Feb 2008 01:31:50 -0000 1.15 >+++ META-INF/MANIFEST.MF 10 Apr 2008 01:09:07 -0000 >@@ -13,5 +13,6 @@ > Eclipse-LazyStart: true > Export-Package: org.eclipse.rse.internal.services.ssh;x-friends:="org.eclipse.rse.connectorservice.ssh,org.eclipse.rse.subsystems.files.ssh,org.eclipse.rse.subsystems.shells.ssh", > org.eclipse.rse.internal.services.ssh.files;x-friends:="org.eclipse.rse.connectorservice.ssh,org.eclipse.rse.subsystems.files.ssh,org.eclipse.rse.subsystems.shells.ssh", >- org.eclipse.rse.internal.services.ssh.shell;x-friends:="org.eclipse.rse.connectorservice.ssh,org.eclipse.rse.subsystems.files.ssh,org.eclipse.rse.subsystems.shells.ssh" >+ org.eclipse.rse.internal.services.ssh.shell;x-friends:="org.eclipse.rse.connectorservice.ssh,org.eclipse.rse.subsystems.files.ssh,org.eclipse.rse.subsystems.shells.ssh", >+ org.eclipse.rse.internal.services.ssh.terminal;x-internal:=true > Bundle-RequiredExecutionEnvironment: J2SE-1.4 >Index: src/org/eclipse/rse/internal/services/ssh/terminal/SshTerminalService.java >=================================================================== >RCS file: src/org/eclipse/rse/internal/services/ssh/terminal/SshTerminalService.java >diff -N src/org/eclipse/rse/internal/services/ssh/terminal/SshTerminalService.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/rse/internal/services/ssh/terminal/SshTerminalService.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,46 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 MontaVista Software, 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: >+ * Yu-Fen Kuo (MontaVista) - Initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.rse.internal.services.ssh.terminal; >+ >+import org.eclipse.core.runtime.IProgressMonitor; >+ >+import org.eclipse.rse.internal.services.ssh.ISshSessionProvider; >+import org.eclipse.rse.internal.services.ssh.SshServiceResources; >+import org.eclipse.rse.internal.services.ssh.shell.SshShellService; >+import org.eclipse.rse.services.clientserver.messages.SystemMessageException; >+import org.eclipse.rse.services.terminals.ITerminalHostShell; >+import org.eclipse.rse.services.terminals.ITerminalService; >+ >+/** >+ * A Terminal Services for ssh. >+ */ >+public class SshTerminalService extends SshShellService implements ITerminalService { >+ >+ public SshTerminalService(ISshSessionProvider sessionProvider) { >+ super(sessionProvider); >+ } >+ >+ public ITerminalHostShell launchTerminal(String ptyType, String encoding, String[] environment, String initialWorkingDirectory, String commandToRun, >+ IProgressMonitor monitor) throws SystemMessageException { >+ SshTerminalHostShell hostShell = new SshTerminalHostShell(getSessionProvider(), ptyType, encoding, environment, initialWorkingDirectory, commandToRun); >+ return hostShell; >+ } >+ >+ public String getName() { >+ return SshServiceResources.SshTerminalService_Name; >+ } >+ >+ public String getDescription() { >+ return SshServiceResources.SshTerminalService_Description; >+ } >+ >+} >Index: src/org/eclipse/rse/internal/services/ssh/terminal/SshTerminalHostShell.java >=================================================================== >RCS file: src/org/eclipse/rse/internal/services/ssh/terminal/SshTerminalHostShell.java >diff -N src/org/eclipse/rse/internal/services/ssh/terminal/SshTerminalHostShell.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/rse/internal/services/ssh/terminal/SshTerminalHostShell.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,234 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 Wind River Systems, Inc. and others. >+ * 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 >+ * Anna Dushistova (MontaVista) - [170910] Integrate the TM Terminal View with RSE >+ *******************************************************************************/ >+ >+package org.eclipse.rse.internal.services.ssh.terminal; >+ >+import java.io.BufferedWriter; >+import java.io.IOException; >+import java.io.InputStream; >+import java.io.OutputStream; >+import java.io.OutputStreamWriter; >+import java.io.UnsupportedEncodingException; >+import java.io.Writer; >+import java.util.Hashtable; >+ >+import com.jcraft.jsch.Channel; >+import com.jcraft.jsch.ChannelShell; >+import com.jcraft.jsch.Session; >+ >+import org.eclipse.rse.internal.services.ssh.ISshSessionProvider; >+import org.eclipse.rse.services.clientserver.PathUtility; >+import org.eclipse.rse.services.clientserver.messages.SystemMessageException; >+import org.eclipse.rse.services.files.RemoteFileException; >+import org.eclipse.rse.services.terminals.ITerminalHostShell; >+import org.eclipse.rse.services.terminals.ITerminalService; >+ >+/** >+ * A remote shell connection supporting Streams for I/O. >+s */ >+public class SshTerminalHostShell implements ITerminalHostShell { >+ >+ private ISshSessionProvider fSessionProvider; >+ private Channel fChannel; >+ private String fEncoding; >+ private InputStream fInputStream; >+ private OutputStream fOutputStream; >+ private Writer fOutputStreamWriter; >+ private int fWidth = 0; >+ private int fHeight = 0; >+ private static String defaultEncoding = new java.io.InputStreamReader(new java.io.ByteArrayInputStream(new byte[0])).getEncoding(); >+ >+ /** >+ * Construct a new Terminal connection. >+ * >+ * The SSH channel is immediately connected in the Constructor. >+ * >+ * @param sessionProvider SSH session provider >+ * @param ptyType Terminal type to set, or <code>null</code> if not >+ * relevant >+ * @param encoding The default encoding to use for initial command. >+ * @param environment Environment array to set, or <code>null</code> if >+ * not relevant. >+ * @param initialWorkingDirectory initial directory to open the Terminal in. >+ * Use <code>null</code> or empty String ("") to start in a >+ * default directory. Empty String will typically start in the >+ * home directory. >+ * @param commandToRun initial command to send. >+ * @throws SystemMessageException in case anything goes wrong. Channels and >+ * Streams are all cleaned up again in this case. >+ * @see ITerminalService >+ */ >+ public SshTerminalHostShell(ISshSessionProvider sessionProvider, String ptyType, String encoding, String[] environment, String initialWorkingDirectory, >+ String commandToRun) throws SystemMessageException { >+ try { >+ fSessionProvider = sessionProvider; >+ fEncoding = encoding; >+ fChannel = fSessionProvider.getSession().openChannel("shell"); //$NON-NLS-1$ >+ if (ptyType != null && (fChannel instanceof ChannelShell)) { >+ //By default, jsch always creates a vt100 connection sized >+ //80x24 / 640x480 (dimensions can be changed). >+ ((ChannelShell) fChannel).setPtyType(ptyType); >+ } >+ >+ //Try to set the user environment. On most sshd configurations, this will >+ //not work since in sshd_config, PermitUserEnvironment and AcceptEnv >+ //settings are disabled. Still, it's worth a try. >+ if (environment!=null && environment.length>0 && fChannel instanceof ChannelShell) { >+ Hashtable envTable=new Hashtable(); >+ for(int i=0; i<environment.length; i++) { >+ String curStr=environment[i]; >+ int curLen=environment[i].length(); >+ int idx = curStr.indexOf('='); >+ if (idx>0 && idx<curLen-1) { >+ String key=environment[i].substring(0, idx); >+ String value=environment[i].substring(idx+1, curLen); >+ if (fEncoding != null) { >+ key = recode(key, fEncoding); >+ value = recode(value, fEncoding); >+ } >+ envTable.put(key, value); >+ } >+ } >+ ((ChannelShell) fChannel).setEnv(envTable); >+ } >+ >+ fOutputStream = fChannel.getOutputStream(); >+ fInputStream = fChannel.getInputStream(); >+ fChannel.connect(); >+ >+ if (fEncoding != null) { >+ fOutputStreamWriter = new BufferedWriter(new OutputStreamWriter(fOutputStream, encoding)); >+ } else { >+ // default encoding == System.getProperty("file.encoding") >+ // TODO should try to determine remote encoding if possible >+ fOutputStreamWriter = new BufferedWriter(new OutputStreamWriter(fOutputStream)); >+ } >+ >+ if (initialWorkingDirectory!=null && initialWorkingDirectory.length()>0 >+ && !initialWorkingDirectory.equals(".") //$NON-NLS-1$ >+ && !initialWorkingDirectory.equals("Command Shell") //$NON-NLS-1$ //FIXME workaround for bug 153047 >+ ) { >+ writeToShell("cd " + PathUtility.enQuoteUnix(initialWorkingDirectory)); //$NON-NLS-1$ >+ } >+ if (commandToRun != null && commandToRun.length() > 0) { >+ writeToShell(commandToRun); >+ } >+ } catch(Exception e) { >+ throw new RemoteFileException("Error creating Terminal", e); >+ } finally { >+ isActive(); >+ } >+ } >+ >+ public String getDefaultEncoding() { >+ return fEncoding; >+ } >+ >+ /** >+ * Encode String with requested user encoding, in case it differs from >+ * Platform default encoding. >+ * >+ * @param s String to encode >+ * @param encoding Encoding to use >+ * @return encoded String >+ * @throws UnsupportedEncodingException in case the requested encoding is >+ * not supported >+ */ >+ protected String recode(String s, String encoding) throws UnsupportedEncodingException { >+ if (encoding == null) { >+ return s; >+ } else if (encoding.equals(defaultEncoding)) { >+ return s; >+ } >+ // what we want on the wire: >+ byte[] bytes = s.getBytes(encoding); >+ // what we need to tell Jsch to get this on the wire: >+ return new String(bytes, defaultEncoding); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.rse.services.shells.ITerminalHostShell#getInputStream(java.lang.Object) >+ */ >+ public InputStream getInputStream() throws SystemMessageException { >+ return fInputStream; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.rse.services.shells.ITerminalHostShell#getOutputStream(java.lang.Object) >+ */ >+ public OutputStream getOutputStream() throws SystemMessageException { >+ return fOutputStream; >+ } >+ >+ /** >+ * Write a command to the shell, honoring specified Encoding. Can only be >+ * done before an outputStream is obtained, since these commands would >+ * interfere with the outputStream. >+ * >+ * @param command Command String to send, or "#break" to send a Ctrl+C >+ * command. >+ */ >+ public void writeToShell(String command) throws IOException { >+ if (isActive()) { >+ if ("#break".equals(command)) { //$NON-NLS-1$ >+ command = "\u0003"; // Unicode 3 == Ctrl+C //$NON-NLS-1$ >+ } else { >+ command += "\r\n"; //$NON-NLS-1$ >+ } >+ fOutputStreamWriter.write(command); >+ fOutputStreamWriter.flush(); >+ } >+ } >+ >+ public void exit() { >+ if (fChannel != null) { >+ fChannel.disconnect(); >+ isActive(); >+ } >+ } >+ >+ public boolean isActive() { >+ if (fChannel != null && !fChannel.isEOF()) { >+ return true; >+ } >+ // shell is not active: check for session lost >+ exit(); >+ Session session = fSessionProvider.getSession(); >+ if (session != null && !session.isConnected()) { >+ fSessionProvider.handleSessionLost(); >+ } >+ return false; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.rse.services.shells.ITerminalHostShell#isLocalEcho() >+ */ >+ public boolean isLocalEcho() { >+ // TODO Auto-generated method stub >+ return false; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.rse.services.shells.ITerminalHostShell#setTerminalSize(int, int) >+ */ >+ public void setTerminalSize(int newWidth, int newHeight) { >+ if (fChannel != null && fChannel instanceof ChannelShell && (newWidth != fWidth || newHeight != fHeight)) { >+ // avoid excessive communications due to change size requests by >+ // caching previous size >+ ChannelShell channelShell = (ChannelShell) fChannel; >+ channelShell.setPtySize(newWidth, newHeight, 8 * newWidth, 8 * newHeight); >+ fWidth = newWidth; >+ fHeight = newHeight; >+ } >+ } >+ >+} >#P org.eclipse.rse.services >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services/META-INF/MANIFEST.MF,v >retrieving revision 1.14 >diff -u -r1.14 MANIFEST.MF >--- META-INF/MANIFEST.MF 26 Feb 2008 01:32:49 -0000 1.14 >+++ META-INF/MANIFEST.MF 10 Apr 2008 01:09:08 -0000 >@@ -24,5 +24,6 @@ > org.eclipse.rse.services.files, > org.eclipse.rse.services.processes, > org.eclipse.rse.services.search, >- org.eclipse.rse.services.shells >+ org.eclipse.rse.services.shells, >+ org.eclipse.rse.services.terminals > Bundle-RequiredExecutionEnvironment: J2SE-1.4 >Index: src/org/eclipse/rse/services/terminals/ITerminalHostShell.java >=================================================================== >RCS file: src/org/eclipse/rse/services/terminals/ITerminalHostShell.java >diff -N src/org/eclipse/rse/services/terminals/ITerminalHostShell.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/rse/services/terminals/ITerminalHostShell.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,88 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 Wind River Systems, Inc. and others. >+ * 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.terminals; >+ >+import java.io.InputStream; >+import java.io.OutputStream; >+ >+import org.eclipse.rse.services.clientserver.messages.SystemMessageException; >+import org.eclipse.rse.services.shells.IHostShell; >+ >+/** >+ * Interface representing a remote shell connection through Streams. >+ * >+ * A single remote shell instance can only either support the streamed >+ * ITerminalHostShell interface or the listener-based IHostShell interface, but >+ * not both. >+ * >+ * @see IHostShell >+ * @see ITerminalService >+ * @since org.eclipse.rse.services 3.0 >+ */ >+public interface ITerminalHostShell { >+ /** >+ * Get a Remote-to-local Stream for the current shell. >+ * >+ * Only one client may get that Stream in one session. The client is >+ * responsible for closing the input and output streams when done. >+ * >+ * @return the Stream to read. >+ * @throws SystemMessageException in case the Stream can not be acquired, or >+ * an input stream has already been requested from this >+ * connection. >+ */ >+ public InputStream getInputStream() throws SystemMessageException; >+ >+ /** >+ * Get a Local-to-Remote OutputStream for writing to the current shell. >+ * >+ * Only one client may get that Stream in one session. The client is >+ * responsible for closing the input and output streams when done. >+ * >+ * @return the Stream to read. >+ * @throws SystemMessageException in case the Stream can not be acquired, or >+ * an input stream has already been requested from this >+ * connection. >+ */ >+ public OutputStream getOutputStream() throws SystemMessageException; >+ >+ /** >+ * Return the default encoding that the terminal service had specified when >+ * creating this terminal connection. This is not necessarily accurate, and >+ * may be <code>null</code>. >+ * >+ * @return the specified default encoding. >+ */ >+ public String getDefaultEncoding(); >+ >+ /** >+ * Notify the remote site that the size of the terminal has changed. There >+ * is no guarantee that the remote side is actually capable of changing the >+ * Terminal size. >+ * >+ * @param newWidth >+ * @param newHeight >+ */ >+ void setTerminalSize(int newWidth, int newHeight); >+ >+ /** >+ * Test if local echo is needed on this terminal connection. >+ * @return true if a local echo is needed. >+ */ >+ boolean isLocalEcho(); >+ >+ /** >+ * Quit this terminal connection. >+ */ >+ public void exit(); >+ >+} >Index: src/org/eclipse/rse/services/terminals/ITerminalService.java >=================================================================== >RCS file: src/org/eclipse/rse/services/terminals/ITerminalService.java >diff -N src/org/eclipse/rse/services/terminals/ITerminalService.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/rse/services/terminals/ITerminalService.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,68 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 Wind River Systems, Inc. and others. >+ * 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.terminals; >+ >+import org.eclipse.core.runtime.IProgressMonitor; >+ >+import org.eclipse.rse.services.clientserver.messages.SystemMessageException; >+import org.eclipse.rse.services.shells.IShellService; >+ >+/** >+ * Interfaces for getting Terminal Connections from a remote side, also known as >+ * shell sessions with Streams. >+ * >+ * @author mober >+ * >+ */ >+public interface ITerminalService extends IShellService { >+ >+ /** >+ * Launch a new terminal connection, also known as shell session with >+ * Streams. >+ * >+ * @param ptyType requested terminal type for the new Terminal. Since not >+ * all Terminal implementations support specifying the Terminal >+ * Type, there is no guarantee that a particular setting has any >+ * effect. Use <code>null</code> to fall back to a default >+ * terminal type. >+ * @param encoding Stream encoding to use for sending initial working >+ * directory and initial commandToRun, and to return on >+ * {@link ITerminalHostShell#getDefaultEncoding()} request. Use >+ * <code>null</code> to fall back to a default encoding. The >+ * Terminal Service will make efforts to determine a proper >+ * default encoding on the remote side but this is not guaranteed >+ * to be correct. >+ * @param environment Array of environment variable Strings of the form >+ * "var=text". Since not all terminal implementations support the >+ * passing of environment variables, there is no guarantee that >+ * the created shell will actually have the specified environment >+ * set. Passing <code>null</code> is allowed in order to >+ * specify that no specific environment needs to be passed. >+ * @param initialWorkingDirectory initial working directory or empty String >+ * ("") if not relevant. The remote shell will launch in a >+ * directory of its own choice in that case (typically a user's >+ * home directory). >+ * @param commandToRun initial command to send to the remote side. >+ * @param monitor Progress Monitor for monitoring and cancellation during >+ * connection creation. >+ * @return the terminal connection object. Note that the connection may not >+ * actually be usable in case the remote side allows opening a >+ * channel but immediately closes it again. In this case, >+ * {@link ITerminalHostShell#getInputStream()} will throw an >+ * exception or be closed from the very beginning. >+ * @throws SystemMessageException in case an error occurred or the user >+ * chose to cancel the operation via the progress monitor. >+ */ >+ public ITerminalHostShell launchTerminal(String ptyType, String encoding, String[] environment, String initialWorkingDirectory, String commandToRun, >+ IProgressMonitor monitor) throws SystemMessageException; >+ >+} >#P org.eclipse.rse.services.telnet >Index: src/org/eclipse/rse/internal/services/telnet/shell/TelnetHostShell.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.telnet/src/org/eclipse/rse/internal/services/telnet/shell/TelnetHostShell.java,v >retrieving revision 1.6 >diff -u -r1.6 TelnetHostShell.java >--- src/org/eclipse/rse/internal/services/telnet/shell/TelnetHostShell.java 7 Nov 2007 15:43:55 -0000 1.6 >+++ src/org/eclipse/rse/internal/services/telnet/shell/TelnetHostShell.java 10 Apr 2008 01:09:09 -0000 >@@ -17,11 +17,14 @@ > * Sheldon D'souza (Celunite) - [187301] support multiple telnet shells > * David McKnight (IBM) - [191599] Use the remote encoding specified in the host property page > * Martin Oberhuber (Wind River) - [194466] Fix shell terminated state when stream is closed >+ * Anna Dushistova (MontaVista) - [170910] Integrate the TM Terminal View with RSE >+ * Eugeniy Melekhov (MontaVista) - [170910] Integrate the TM Terminal View with RSE > *******************************************************************************/ > package org.eclipse.rse.internal.services.telnet.shell; > > import java.io.BufferedReader; > import java.io.IOException; >+import java.io.InputStream; > import java.io.InputStreamReader; > import java.io.OutputStream; > import java.io.PrintWriter; >@@ -162,4 +165,18 @@ > > } > >+ public InputStream getInputStream() throws IOException { >+ if(fTelnetClient != null){ >+ return fTelnetClient.getInputStream(); >+ } >+ return null; >+ } >+ >+ public OutputStream getOutputStream() throws IOException { >+ if(fTelnetClient != null){ >+ return fTelnetClient.getOutputStream(); >+ } >+ return null; >+ } >+ > } >#P org.eclipse.rse.files.ui >Index: src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java,v >retrieving revision 1.74 >diff -u -r1.74 SystemViewRemoteFileAdapter.java >--- src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java 28 Mar 2008 17:26:22 -0000 1.74 >+++ src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java 10 Apr 2008 01:09:10 -0000 >@@ -7,19 +7,19 @@ > * > * 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: >- * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType >+ * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType > * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core > * Martin Oberhuber (Wind River) - [182454] improve getAbsoluteName() documentation > * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods > * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API > * Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem >- * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() >- * Martin Oberhuber (Wind River) - [186128][refactoring] Move IProgressMonitor last in public base classes >+ * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() >+ * Martin Oberhuber (Wind River) - [186128][refactoring] Move IProgressMonitor last in public base classes > * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry > * Martin Oberhuber (Wind River) - [186997] No deferred queries in Local Files > * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core >@@ -38,7 +38,7 @@ > * David McKnight (IBM) - [208803] add exists() method > * David McKnight (IBM) - [209375] download using copyRemoteResourcesToWorkspaceMultiple > * Rupen Mardirossian (IBM) - [208435] added constructor to nested RenameRunnable class to take in names that are previously used as a parameter for multiple renaming instances >- * David McKnight (IBM) - [209660] need to check if remote encoding has changed before using cached file >+ * David McKnight (IBM) - [209660] need to check if remote encoding has changed before using cached file > * Xuan Chen (IBM) - [160775] [api] [breaking] [nl] rename (at least within a zip) blocks UI thread > * Xuan Chen (IBM) - [209827] Update DStore command implementation to enable cancelation of archive operations > * Xuan Chen (IBM) - [191370] [dstore] Supertransfer zip not deleted when cancelling copy >@@ -48,8 +48,9 @@ > * David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind > * David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared > * Xuan Chen (IBM) - [223126] [api][breaking] Remove API related to User Actions in RSE Core/UI >- * Rupen Mardirossian (IBM) - [210682] Copy collisions will use SystemCopyDialog now instead of renameDialog when there is a copy collision within the same connection >+ * Rupen Mardirossian (IBM) - [210682] Copy collisions will use SystemCopyDialog now instead of renameDialog when there is a copy collision within the same connection > * David McKnight (IBM) - [224377] "open with" menu does not have "other" option >+ * Anna Dushistova (MontaVista) - [170910] Integrate the TM Terminal View with RSE > *******************************************************************************/ > > package org.eclipse.rse.internal.files.ui.view; >@@ -196,7 +197,7 @@ > private String xlatedSize = null; > private String xlatedCompressedSize = null; > private String xlatedExpandedSize = null; >- >+ > private static final Object[] EMPTY_LIST = new Object[0]; > private boolean filesOnly, foldersOnly; > private SystemNewFileAction addNewFile; >@@ -213,7 +214,7 @@ > private SystemReplaceWithEditionAction replaceEditionAction; > // FIXME shells now separate plugin > //private SystemCommandAction commandAction, shellAction; >- >+ > private SystemSearchAction searchAction; > > private IEditorRegistry registry; >@@ -231,14 +232,14 @@ > private static PropertyDescriptor[] uniquePropertyDescriptorArray = null; > private static PropertyDescriptor[] uniqueArchiveDescriptorArray = null; > private static PropertyDescriptor[] uniqueVirtualDescriptorArray = null; >- >+ > // MJB > private static PropertyDescriptor[] archiveDescriptorArray = null; > private static PropertyDescriptor[] virtualDescriptorArray = null; > > static final String _uploadMessage = FileResources.MSG_UPLOADING_PROGRESS; > static final String _downloadMessage = FileResources.MSG_DOWNLOADING_PROGRESS; >- >+ > /** > * Constructor > */ >@@ -248,9 +249,9 @@ > xlatedSize = FileResources.RESID_PROPERTY_FILE_SIZE_VALUE; > xlatedCompressedSize = FileResources.RESID_PROPERTY_VIRTUALFILE_COMPRESSEDSIZE_VALUE; > xlatedExpandedSize = FileResources.RESID_PROPERTY_ARCHIVE_EXPANDEDSIZE_VALUE; >- >+ > } >- >+ > private IEditorRegistry getEditorRegistry() > { > if (registry == null) >@@ -282,7 +283,7 @@ > filterString = filterString + " /nf"; //$NON-NLS-1$ > this.filterString = filterString; > } >- >+ > /** > * Get the current filter string being used to subset the list by. > * Will be null unless setFilterString has previously been called. >@@ -294,7 +295,7 @@ > > /** > * Returns any actions that should be contributed to the popup menu >- * for the given filter string object. >+ * for the given filter string object. > * @param menu The menu to contribute actions to > * @param selection The window's current selection. > * @param shell Shell of viewer >@@ -309,7 +310,7 @@ > boolean supportsSearch = true; > boolean supportsArchiveManagement = false; > >- // perf improvement... phil >+ // perf improvement... phil > Object firstSelection = selection.getFirstElement(); > IRemoteFile firstFile = null; > if ((firstSelection != null) && (firstSelection instanceof IRemoteFile)) >@@ -318,7 +319,7 @@ > elementType = firstFile.isDirectory() || firstFile.isRoot() ? 1 : 0; > isArchive = firstFile.isArchive(); > canRead = firstFile.canRead(); >- >+ > supportsSearch = firstFile.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().supportsSearch(); > supportsArchiveManagement = firstFile.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement(); > } >@@ -327,7 +328,7 @@ > > > if (isArchive) >- { >+ { > Iterator elements = selection.iterator(); > Object element = null; > >@@ -376,15 +377,15 @@ > else > { > if (canRead) >- { >- // open >+ { >+ // open > String label = SystemResources.ACTION_CASCADING_OPEN_LABEL; > String tooltip = SystemResources.ACTION_CASCADING_OPEN_TOOLTIP; > SystemEditFilesAction action = new SystemEditFilesAction(label, tooltip, shell); > menu.add(ISystemContextMenuConstants.GROUP_OPEN, action); >- >+ > // open with -> >- >+ > MenuManager submenu = > new MenuManager(FileResources.ResourceNavigator_openWith, > ISystemContextMenuConstants.GROUP_OPENWITH); >@@ -396,9 +397,9 @@ > openWithMenu.updateSelection(selection); > submenu.add(openWithMenu); > menu.getMenuManager().appendToGroup(ISystemContextMenuConstants.GROUP_OPENWITH, submenu); >- >- >- >+ >+ >+ > } > } > >@@ -475,7 +476,7 @@ > { > IRemoteFile file = (IRemoteFile) element; > if (file.isFile() || file.isArchive()) // hack to show zips without folder icons >- { >+ { > return getEditorRegistry().getImageDescriptor(file.getName()); > } > else >@@ -491,7 +492,7 @@ > // so we have an empty open folder > Object[] contents = file.getContents(RemoteChildrenContentsType.getInstance()); > if (contents != null && contents.length == 0) >- isOpen = true; >+ isOpen = true; > } > } > if (file.isRoot()) >@@ -510,7 +511,7 @@ > { > return getName(element); > } >- >+ > /** > * Return the label for this object. Uses getName() on the remote file object. > */ >@@ -518,7 +519,7 @@ > { > return ((IRemoteFile) element).getLabel(); > } >- >+ > /** > * Return the name of this object, which may be different than the display text ({#link #getText(Object)}. > * <p> >@@ -558,7 +559,7 @@ > * it's possible that the represented element will been seen to exist when on > * a remote host it may not - that is because this call does not query the host. > * Returns whether the remote file representation exists. >- * >+ * > * @param element the element to check > * @return true if the element exists > * >@@ -572,7 +573,7 @@ > } > return false; > } >- >+ > /** > * Return the parent of this object > */ >@@ -597,7 +598,7 @@ > { > return internalGetChildren(element, null, monitor); > } >- >+ > /** > * Return the children of this object. > * If this is a folder or root, we list all child folders and files. >@@ -622,11 +623,11 @@ > return ((RemoteFileRoot) file).getRootFiles(); > } > IRemoteFileSubSystem ss = file.getParentRemoteFileSubSystem(); >- >- >+ >+ > /* > RemoteFileFilterString orgRffs = file.getFilterString(); >- >+ > > if (orgRffs != null) > { >@@ -657,7 +658,7 @@ > { > String filterString = filterObject.getFilterStrings()[0]; > String separator = PathUtility.getSeparator(filterString); >- >+ > int sepIndex = filterString.lastIndexOf(separator); > if (sepIndex >= 0) > { >@@ -672,7 +673,7 @@ > } > else > { >- >+ > if (foldersOnly) > { > if (filterString == null) >@@ -692,16 +693,16 @@ > if (filterString == null) > filter = "*"; //$NON-NLS-1$ > else >- filter = filterString; >+ filter = filterString; > } > } >- >+ > Object[] children = null; >- >+ > Viewer v = getViewer(); >- >+ > if ((v != null) && (v instanceof SystemSearchTableView)) { >- >+ > SystemSearchTableView view = (SystemSearchTableView)v; > Iterator iter = view.getResultSet().getSearchConfigurations(); > boolean hasSearchResults = false; >@@ -709,19 +710,19 @@ > { > IHostSearchResultConfiguration config = (IHostSearchResultConfiguration)(iter.next()); > String searchString = config.getSearchString().getTextString(); >- >+ > hasSearchResults = file.hasContents(RemoteSearchResultsContentsType.getInstance(), searchString); >- >- if (hasSearchResults) >+ >+ if (hasSearchResults) > { > children = file.getContents(RemoteSearchResultsContentsType.getInstance(), searchString); > return children; >- } >+ } > } > } >- >+ > boolean hasChildren = file.hasContents(RemoteChildrenContentsType.getInstance(), filter); >- >+ > if (hasChildren && !file.isStale()) > { > children = file.getContents(RemoteChildrenContentsType.getInstance(), filter); >@@ -733,19 +734,19 @@ > { > if (monitor != null) > { >- >+ > children = ss.resolveFilterString(file, filter, monitor); > } > else > { > children = ss.resolveFilterString(file, filter, new NullProgressMonitor()); > } >- >+ > if ((children == null) || (children.length == 0)) > { > children = EMPTY_LIST; > } >- else >+ else > { > if (children.length == 1 && children[0] instanceof SystemMessageObject) > { >@@ -753,7 +754,7 @@ > } > else > { >- children = filterChildren(children); >+ children = filterChildren(children); > } > } > >@@ -761,7 +762,7 @@ > catch (InterruptedException exc) > { > children = new SystemMessageObject[1]; >- SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, >+ SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, > ICommonMessageIds.MSG_EXPAND_CANCELED, > IStatus.CANCEL, CommonMessages.MSG_EXPAND_CANCELED); > children[0] = new SystemMessageObject(msg, ISystemMessageObject.MSGTYPE_CANCEL, element); >@@ -769,45 +770,45 @@ > catch (Exception exc) > { > children = new SystemMessageObject[1]; >- >- SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, >+ >+ SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, > ICommonMessageIds.MSG_EXPAND_FAILED, >- IStatus.ERROR, >+ IStatus.ERROR, > CommonMessages.MSG_EXPAND_FAILED); > children[0] = new SystemMessageObject(msg, ISystemMessageObject.MSGTYPE_ERROR, element); > SystemBasePlugin.logError("Exception resolving file filter strings", exc); //$NON-NLS-1$ >- } // message already issued >+ } // message already issued > } > file.markStale(false); > return children; > } >- >+ > private Object[] filterChildren(Object[] children) { >- >+ > boolean showHidden = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.SHOWHIDDEN); >- >+ > if (showHidden) { > return children; > } > else { >- >+ > ArrayList results = new ArrayList(children.length); >- >+ > for (int i = 0; i < children.length; i++) { >- >+ > if (children[i] instanceof IRemoteFile) { > IRemoteFile remoteFile = (IRemoteFile)(children[i]); >- >+ > if (!remoteFile.isHidden()) { > results.add(remoteFile); > } > } > } >- >+ > return results.toArray(); > } > } >- >+ > /** > * Return true if this object has children. > * Since we can't predict the outcome of resolving the filter string, we return true. >@@ -816,7 +817,7 @@ > { > return internalHasChildren(element.getModelObject(), element.getFilterReference()); > } >- >+ > /** > * Return true if this object has children. > * Since we can't predict the outcome of resolving the filter string, we return true. >@@ -825,17 +826,17 @@ > { > return internalHasChildren(element, null); > } >- >+ > public boolean internalHasChildren(IAdaptable element, ISystemFilterReference filterReference) > { > IRemoteFile file = (IRemoteFile) element; >- >+ > if (!file.exists()) > return false; >- >+ > boolean supportsArchiveManagement = file.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement(); > boolean hasChildren = false; >- >+ > String filter = "*"; //$NON-NLS-1$ > if (filterReference != null) > { >@@ -844,7 +845,7 @@ > { > String filterString = filterObject.getFilterStrings()[0]; > String separator = PathUtility.getSeparator(filterString); >- >+ > int sepIndex = filterString.lastIndexOf(separator); > if (sepIndex > 0) > { >@@ -852,7 +853,7 @@ > } > } > } >- >+ > if (file instanceof IVirtualRemoteFile) > { > hasChildren = ((IVirtualRemoteFile)file).isVirtualFolder(); >@@ -861,11 +862,11 @@ > { > hasChildren = !file.isFile() || (file.isArchive() && supportsArchiveManagement); > } >- >+ > if (!hasChildren) { >- >+ > Viewer v = getViewer(); >- >+ > if ((v != null) && (v instanceof SystemSearchTableView)) { > > SystemSearchTableView view = (SystemSearchTableView)v; >@@ -874,7 +875,7 @@ > { > IHostSearchResultConfiguration config = (IHostSearchResultConfiguration)(iter.next()); > String searchString = config.getSearchString().getTextString(); >- >+ > hasChildren = file.hasContents(RemoteSearchResultsContentsType.getInstance(), searchString); > } > } >@@ -884,7 +885,7 @@ > } > else > { >- // check that the children are actually there >+ // check that the children are actually there > //Object[] contents = file.getContents(RemoteChildrenContentsType.getInstance()); > hasChildren = file.hasContents(RemoteChildrenContentsType.getInstance(), filter); > //if (!hasChildren && !file.isStale()) >@@ -895,68 +896,68 @@ > return hasChildren; > } > >- >+ > > public IPropertyDescriptor[] getUniquePropertyDescriptors() > { >- >+ > IRemoteFile file = null; >- if (propertySourceInput instanceof IRemoteFile) >+ if (propertySourceInput instanceof IRemoteFile) > { > file = (IRemoteFile) propertySourceInput; >- >+ > boolean supportsArchiveManagement = file.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement(); >- >+ > boolean isArchive = file.isArchive() && supportsArchiveManagement; > boolean isVirtual = file instanceof IVirtualRemoteFile && supportsArchiveManagement; > boolean isRegular = !isArchive && !isVirtual; >- >+ > if (isRegular && uniquePropertyDescriptorArray == null || > isArchive && uniqueArchiveDescriptorArray == null || > isVirtual && uniqueVirtualDescriptorArray == null) > { >- >+ > int nbrOfArchiveProperties = 2; > int nbrOfVirtualProperties = 4; > int nbrOfProperties = 8; > if (isVirtual) nbrOfProperties += nbrOfVirtualProperties; >- else if (isArchive) nbrOfProperties += nbrOfArchiveProperties; >- >+ else if (isArchive) nbrOfProperties += nbrOfArchiveProperties; >+ > if (isRegular) uniquePropertyDescriptorArray = new PropertyDescriptor[nbrOfProperties]; > else if (isVirtual) uniqueVirtualDescriptorArray = new PropertyDescriptor[nbrOfProperties]; > else if (isArchive) uniqueArchiveDescriptorArray = new PropertyDescriptor[nbrOfProperties]; > //PropertyDescriptor[] defaultProperties = (PropertyDescriptor[]) getDefaultDescriptors(); >- >+ > int i = -1; >- >+ > // add our unique property descriptors... > //RSEUIPlugin plugin = RSEUIPlugin.getDefault(); >- >+ > // classification > if (isRegular) uniquePropertyDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_CLASSIFICATION, FileResources.RESID_PROPERTY_FILE_CLASSIFICATION_LABEL, FileResources.RESID_PROPERTY_FILE_CLASSIFICATION_TOOLTIP); > else if (isVirtual) uniqueVirtualDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_CLASSIFICATION, FileResources.RESID_PROPERTY_FILE_CLASSIFICATION_LABEL, FileResources.RESID_PROPERTY_FILE_CLASSIFICATION_TOOLTIP); > else if (isArchive) uniqueArchiveDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_CLASSIFICATION, FileResources.RESID_PROPERTY_FILE_CLASSIFICATION_LABEL, FileResources.RESID_PROPERTY_FILE_CLASSIFICATION_TOOLTIP); >- >+ > // last modified > if (isRegular) uniquePropertyDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_LASTMODIFIED, FileResources.RESID_PROPERTY_FILE_LASTMODIFIED_LABEL, FileResources.RESID_PROPERTY_FILE_LASTMODIFIED_TOOLTIP); > else if (isVirtual) uniqueVirtualDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_LASTMODIFIED, FileResources.RESID_PROPERTY_FILE_LASTMODIFIED_LABEL, FileResources.RESID_PROPERTY_FILE_LASTMODIFIED_TOOLTIP); > else if (isArchive) uniqueArchiveDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_LASTMODIFIED, FileResources.RESID_PROPERTY_FILE_LASTMODIFIED_LABEL, FileResources.RESID_PROPERTY_FILE_LASTMODIFIED_TOOLTIP); >- >+ > // size > if (isRegular) uniquePropertyDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_SIZE, FileResources.RESID_PROPERTY_FILE_SIZE_LABEL, FileResources.RESID_PROPERTY_FILE_SIZE_TOOLTIP); > else if (isVirtual) uniqueVirtualDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_SIZE, FileResources.RESID_PROPERTY_FILE_SIZE_LABEL, FileResources.RESID_PROPERTY_FILE_SIZE_TOOLTIP); > else if (isArchive) uniqueArchiveDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_SIZE, FileResources.RESID_PROPERTY_FILE_SIZE_LABEL, FileResources.RESID_PROPERTY_FILE_SIZE_TOOLTIP); >- >+ > // canonical path > if (isRegular) uniquePropertyDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_CANONICAL_PATH, FileResources.RESID_PROPERTY_FILE_CANONICAL_PATH_LABEL, FileResources.RESID_PROPERTY_FILE_CANONICAL_PATH_TOOLTIP); > else if (isVirtual) uniqueVirtualDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_CANONICAL_PATH, FileResources.RESID_PROPERTY_FILE_CANONICAL_PATH_LABEL, FileResources.RESID_PROPERTY_FILE_CANONICAL_PATH_TOOLTIP); > else if (isArchive) uniqueArchiveDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_CANONICAL_PATH, FileResources.RESID_PROPERTY_FILE_CANONICAL_PATH_LABEL, FileResources.RESID_PROPERTY_FILE_CANONICAL_PATH_TOOLTIP); >- >+ > // file extension > if (isRegular) uniquePropertyDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_EXTENSION, FileResources.RESID_PROPERTY_FILE_EXTENSION_LABEL, FileResources.RESID_PROPERTY_FILE_EXTENSION_TOOLTIP); > else if (isVirtual) uniqueVirtualDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_EXTENSION, FileResources.RESID_PROPERTY_FILE_EXTENSION_LABEL, FileResources.RESID_PROPERTY_FILE_EXTENSION_TOOLTIP); > else if (isArchive) uniqueArchiveDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_EXTENSION, FileResources.RESID_PROPERTY_FILE_EXTENSION_LABEL, FileResources.RESID_PROPERTY_FILE_EXTENSION_TOOLTIP); >- >+ > // file permissions > if (isRegular) uniquePropertyDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_PERMISSIONS, FileResources.RESID_PROPERTY_FILE_PERMISSIONS_LABEL, FileResources.RESID_PROPERTY_FILE_PERMISSIONS_TOOLTIP); > else if (isVirtual) uniqueVirtualDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_PERMISSIONS, FileResources.RESID_PROPERTY_FILE_PERMISSIONS_LABEL, FileResources.RESID_PROPERTY_FILE_PERMISSIONS_TOOLTIP); >@@ -966,36 +967,36 @@ > if (isRegular) uniquePropertyDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_OWNER, FileResources.RESID_PROPERTY_FILE_OWNER_LABEL, FileResources.RESID_PROPERTY_FILE_OWNER_TOOLTIP); > else if (isVirtual) uniqueVirtualDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_OWNER, FileResources.RESID_PROPERTY_FILE_OWNER_LABEL, FileResources.RESID_PROPERTY_FILE_OWNER_TOOLTIP); > else if (isArchive) uniqueArchiveDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_OWNER, FileResources.RESID_PROPERTY_FILE_OWNER_LABEL, FileResources.RESID_PROPERTY_FILE_OWNER_TOOLTIP); >- >+ > // file group > if (isRegular) uniquePropertyDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_GROUP, FileResources.RESID_PROPERTY_FILE_GROUP_LABEL, FileResources.RESID_PROPERTY_FILE_GROUP_TOOLTIP); > else if (isVirtual) uniqueVirtualDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_GROUP, FileResources.RESID_PROPERTY_FILE_GROUP_LABEL, FileResources.RESID_PROPERTY_FILE_GROUP_TOOLTIP); > else if (isArchive) uniqueArchiveDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_GROUP, FileResources.RESID_PROPERTY_FILE_GROUP_LABEL, FileResources.RESID_PROPERTY_FILE_GROUP_TOOLTIP); > >- >+ > if (isVirtual) > { > // add virtual property descriptors... >- >+ > // compressed size > uniqueVirtualDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_VIRTUAL_COMPRESSEDSIZE, FileResources.RESID_PROPERTY_VIRTUALFILE_COMPRESSEDSIZE_LABEL, FileResources.RESID_PROPERTY_VIRTUALFILE_COMPRESSEDSIZE_DESCRIPTION); >- >+ > // compression ratio > uniqueVirtualDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_VIRTUAL_COMPRESSIONRATIO, FileResources.RESID_PROPERTY_VIRTUALFILE_COMPRESSIONRATIO_LABEL, FileResources.RESID_PROPERTY_VIRTUALFILE_COMPRESSIONRATIO_DESCRIPTION); >- >+ > // compression method > uniqueVirtualDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_VIRTUAL_COMPRESSIONMETHOD, FileResources.RESID_PROPERTY_VIRTUALFILE_COMPRESSIONMETHOD_LABEL, FileResources.RESID_PROPERTY_VIRTUALFILE_COMPRESSIONMETHOD_DESCRIPTION); >- >+ > // comment > uniqueVirtualDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_VIRTUAL_COMMENT, FileResources.RESID_PROPERTY_VIRTUALFILE_COMMENT_LABEL, FileResources.RESID_PROPERTY_VIRTUALFILE_COMMENT_DESCRIPTION); > } > else if (isArchive) > { > // add archive property descriptors... >- >+ > // expanded size > uniqueArchiveDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_ARCHIVE_EXPANDEDSIZE, FileResources.RESID_PROPERTY_ARCHIVE_EXPANDEDSIZE_LABEL, FileResources.RESID_PROPERTY_ARCHIVE_EXPANDEDSIZE_DESCRIPTION); >- >+ > // comment > uniqueArchiveDescriptorArray[++i] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_ARCHIVE_COMMENT, FileResources.RESID_PROPERTY_ARCHIVE_COMMENT_LABEL, FileResources.RESID_PROPERTY_ARCHIVE_COMMENT_DESCRIPTION); > } >@@ -1022,32 +1023,32 @@ > // TO 5 SECONDS, CONSIDERABLY SLOWING DOWN RESPONSE TIME TO THE POINT OF PAIN. TO FIX THIS, > // WE HAVE MADE IT POSSIBLE FOR REMOTE FILE OBJECTS TO DECIDE TO SHOW ONLY A SUBSET OF THE > // PROPERTIES, WHICH IFS FILES EXPLOIT. PHIL. >- >+ > IRemoteFile file = null; > if (propertySourceInput instanceof IRemoteFile) file = (IRemoteFile) propertySourceInput; > boolean isArchive = false;//file != null && file.isArchive(); >- >+ > boolean isVirtual = file != null && file instanceof IVirtualRemoteFile; > boolean isRegular = !isArchive && !isVirtual; >- >+ > if (isRegular && propertyDescriptorArray == null ||//uniquePropertyDescriptorArray == null || > isArchive && archiveDescriptorArray == null || > isVirtual && virtualDescriptorArray == null) >- { >+ { > int nbrOfArchiveProperties = 2; > int nbrOfVirtualProperties = 4; > int nbrOfProperties = 12; > int nbrOfBriefProperties = 2; > if (debug) > nbrOfProperties += 7; >- >+ > if (isVirtual) nbrOfProperties += nbrOfVirtualProperties; >- else if (isArchive) nbrOfProperties += nbrOfArchiveProperties; >+ else if (isArchive) nbrOfProperties += nbrOfArchiveProperties; > > if (isRegular) propertyDescriptorArray = new PropertyDescriptor[nbrOfProperties]; > else if (isVirtual) virtualDescriptorArray = new PropertyDescriptor[nbrOfProperties]; >- else if (isArchive) archiveDescriptorArray = new PropertyDescriptor[nbrOfProperties]; >- >+ else if (isArchive) archiveDescriptorArray = new PropertyDescriptor[nbrOfProperties]; >+ > briefPropertyDescriptorArray = new PropertyDescriptor[nbrOfBriefProperties]; > int idx = -1; > int briefIdx = idx; >@@ -1068,7 +1069,7 @@ > if (isRegular) propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_CANONICAL_PATH, FileResources.RESID_PROPERTY_FILE_CANONICAL_PATH_LABEL,FileResources.RESID_PROPERTY_FILE_CANONICAL_PATH_TOOLTIP); > else if (isVirtual) virtualDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_CANONICAL_PATH, FileResources.RESID_PROPERTY_FILE_CANONICAL_PATH_LABEL,FileResources.RESID_PROPERTY_FILE_CANONICAL_PATH_TOOLTIP); > else if (isArchive) archiveDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_CANONICAL_PATH, FileResources.RESID_PROPERTY_FILE_CANONICAL_PATH_LABEL,FileResources.RESID_PROPERTY_FILE_CANONICAL_PATH_TOOLTIP); >- >+ > // last modified > if (isRegular) propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_LASTMODIFIED, FileResources.RESID_PROPERTY_FILE_LASTMODIFIED_LABEL, FileResources.RESID_PROPERTY_FILE_LASTMODIFIED_TOOLTIP); > else if (isVirtual) virtualDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_LASTMODIFIED, FileResources.RESID_PROPERTY_FILE_LASTMODIFIED_LABEL,FileResources.RESID_PROPERTY_FILE_LASTMODIFIED_TOOLTIP); >@@ -1083,7 +1084,7 @@ > if (isRegular) propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_CLASSIFICATION, FileResources.RESID_PROPERTY_FILE_CLASSIFICATION_LABEL, FileResources.RESID_PROPERTY_FILE_CLASSIFICATION_TOOLTIP); > else if (isVirtual) virtualDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_CLASSIFICATION, FileResources.RESID_PROPERTY_FILE_CLASSIFICATION_LABEL, FileResources.RESID_PROPERTY_FILE_CLASSIFICATION_TOOLTIP); > else if (isArchive) archiveDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_CLASSIFICATION, FileResources.RESID_PROPERTY_FILE_CLASSIFICATION_LABEL, FileResources.RESID_PROPERTY_FILE_CLASSIFICATION_TOOLTIP); >- >+ > // readonly > if (isRegular) propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_READONLY, FileResources.RESID_PROPERTY_FILE_READONLY_LABEL, FileResources.RESID_PROPERTY_FILE_READONLY_TOOLTIP); > else if (isVirtual) virtualDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_READONLY, FileResources.RESID_PROPERTY_FILE_READONLY_LABEL, FileResources.RESID_PROPERTY_FILE_READONLY_TOOLTIP); >@@ -1108,13 +1109,13 @@ > if (isRegular) propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_OWNER, FileResources.RESID_PROPERTY_FILE_OWNER_LABEL, FileResources.RESID_PROPERTY_FILE_OWNER_TOOLTIP); > else if (isVirtual) virtualDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_OWNER, FileResources.RESID_PROPERTY_FILE_OWNER_LABEL, FileResources.RESID_PROPERTY_FILE_OWNER_TOOLTIP); > else if (isArchive) archiveDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_OWNER, FileResources.RESID_PROPERTY_FILE_OWNER_LABEL, FileResources.RESID_PROPERTY_FILE_OWNER_TOOLTIP); >- >+ > // file group > if (isRegular) propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_GROUP, FileResources.RESID_PROPERTY_FILE_GROUP_LABEL, FileResources.RESID_PROPERTY_FILE_GROUP_TOOLTIP); > else if (isVirtual) virtualDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_GROUP, FileResources.RESID_PROPERTY_FILE_GROUP_LABEL, FileResources.RESID_PROPERTY_FILE_GROUP_TOOLTIP); > else if (isArchive) archiveDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_FILE_GROUP, FileResources.RESID_PROPERTY_FILE_GROUP_LABEL, FileResources.RESID_PROPERTY_FILE_GROUP_TOOLTIP); > >- >+ > if (debug) > { > propertyDescriptorArray[++idx] = createSimplePropertyDescriptor("DEBUG_PARENTREMOTEFILE"); //$NON-NLS-1$ >@@ -1132,17 +1133,17 @@ > propertyDescriptorArray[++idx] = createSimplePropertyDescriptor("DEBUG_EXISTS"); //$NON-NLS-1$ > briefPropertyDescriptorArray[++briefIdx] = createSimplePropertyDescriptor("DEBUG_EXISTS"); //$NON-NLS-1$ > } >- >+ > if (isVirtual) > { > // add virtual property descriptors... >- >+ > // compressed size > virtualDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_VIRTUAL_COMPRESSEDSIZE, FileResources.RESID_PROPERTY_VIRTUALFILE_COMPRESSEDSIZE_LABEL, FileResources.RESID_PROPERTY_VIRTUALFILE_COMPRESSEDSIZE_DESCRIPTION); >- >+ > // compression ratio > virtualDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_VIRTUAL_COMPRESSIONRATIO, FileResources.RESID_PROPERTY_VIRTUALFILE_COMPRESSIONRATIO_LABEL, FileResources.RESID_PROPERTY_VIRTUALFILE_COMPRESSIONRATIO_DESCRIPTION); >- >+ > // compression method > virtualDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_VIRTUAL_COMPRESSIONMETHOD, FileResources.RESID_PROPERTY_VIRTUALFILE_COMPRESSIONMETHOD_LABEL, FileResources.RESID_PROPERTY_VIRTUALFILE_COMPRESSIONMETHOD_DESCRIPTION); > >@@ -1153,25 +1154,25 @@ > else if (isArchive) > { > // add archive property descriptors... >- >+ > // expanded size > archiveDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_ARCHIVE_EXPANDEDSIZE, FileResources.RESID_PROPERTY_ARCHIVE_EXPANDEDSIZE_LABEL, FileResources.RESID_PROPERTY_ARCHIVE_EXPANDEDSIZE_DESCRIPTION); >- >+ > // comment > archiveDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_ARCHIVE_COMMENT, FileResources.RESID_PROPERTY_ARCHIVE_COMMENT_LABEL, FileResources.RESID_PROPERTY_ARCHIVE_COMMENT_DESCRIPTION); > } >- >+ > } >- >+ > // return propertyDescriptorArray; > // DKM - I've commented this out because it's too expensive to query archive properties during a folder query > // we need to come back to this and change this do work in a more performance-sensitive way >- >+ > //System.out.println("Inside end getPropertyDescriptors: "+propertyDescriptorArray.length); > if ((propertySourceInput instanceof IRemoteFile) && ((IRemoteFile) propertySourceInput).showBriefPropertySet()) > return propertyDescriptorArray; > //return briefPropertyDescriptorArray; >- >+ > else > { > if (isRegular) return propertyDescriptorArray; >@@ -1179,7 +1180,7 @@ > else if (isArchive) return archiveDescriptorArray; > else return propertyDescriptorArray; > } >- >+ > } > > /** >@@ -1199,16 +1200,16 @@ > { > return getPropertyValue(key, true); > } >- >- >- public Object getPropertyValue(Object key) >+ >+ >+ public Object getPropertyValue(Object key) > { > String name = (String)key; > if (name.equals(ISystemPropertyConstants.P_NBRCHILDREN)) > { > IRemoteFile file = (IRemoteFile) propertySourceInput; > { >- ISystemContainer container = file; >+ ISystemContainer container = file; > Object[] contents = container.getContents(RemoteChildrenContentsType.getInstance()); > if (contents == null) > return "0"; //$NON-NLS-1$ >@@ -1216,12 +1217,12 @@ > return Integer.toString(contents.length); > } > } >- return super.getPropertyValue(key); >+ return super.getPropertyValue(key); > } > > /** > * Returns the current value for the named property. >- * >+ * > * @param property the name or key of the property as named by its property descriptor > * @param formatted indication of whether to return the value in formatted or raw form > * @return the current value of the given property >@@ -1260,7 +1261,7 @@ > return file.exists() ? "true" : "false"; //$NON-NLS-1$ //$NON-NLS-2$ > > } >- // >+ // > if (name.equals(ISystemPropertyConstants.P_FILE_LASTMODIFIED)) > { > Date date = file.getLastModifiedDate(); >@@ -1295,7 +1296,7 @@ > else if (name.equals(ISystemPropertyConstants.P_ARCHIVE_EXPANDEDSIZE)) > { > if (!isVirtual || virtualFile == null) return new Long(0); >- >+ > if (formatted) > { > return sub(xlatedExpandedSize, MSG_SUB1, Long.toString(virtualFile.getExpandedSize())); >@@ -1338,7 +1339,7 @@ > { > IHostFilePermissions permissions = file.getPermissions(); > if (permissions == null){ >- >+ > if (getFilePermissions(file)){ > return FileResources.MESSAGE_PENDING; > } >@@ -1353,7 +1354,7 @@ > { > IHostFilePermissions permissions = file.getPermissions(); > if (permissions == null){ >- >+ > if (getFilePermissions(file)){ > return FileResources.MESSAGE_PENDING; > } >@@ -1368,7 +1369,7 @@ > { > IHostFilePermissions permissions = file.getPermissions(); > if (permissions == null){ >- >+ > if (getFilePermissions(file)){ > return FileResources.MESSAGE_PENDING; > } >@@ -1432,18 +1433,18 @@ > else > return null; //super.getPropertyValue(name); > } >- >+ > private boolean getFilePermissions(IRemoteFile file){ > if (file instanceof IAdaptable){ > final IFilePermissionsService service = (IFilePermissionsService)((IAdaptable)file).getAdapter(IFilePermissionsService.class); >- >+ > if (service != null && (service.getCapabilities(file.getHostFile()) & IFilePermissionsService.FS_CAN_GET_PERMISSIONS) != 0){ >- >+ > final IRemoteFile rFile = file; > if (rFile.getHostFile() instanceof IHostFilePermissionsContainer){ > ((IHostFilePermissionsContainer)rFile.getHostFile()).setPermissions(new PendingHostFilePermissions()); > } >- >+ > Job deferredFetch = new Job(NLS.bind(FileResources.MESSAGE_GETTING_PERMISSIONS, file.getAbsolutePath())) > { > public IStatus run(IProgressMonitor monitor){ >@@ -1453,22 +1454,22 @@ > service.getFilePermissions(rFile.getHostFile(), monitor); > ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); > registry.fireEvent(new SystemResourceChangeEvent(rFile, ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE, rFile)); >- } >+ } > catch (Exception e) >- { >+ { > } > return Status.OK_STATUS; > } > }; > deferredFetch.schedule(); >- >- >+ >+ > return true; // query kicked off > } >- } >+ } > return false; // no query kicked off > } >- >+ > > // Drag and Drop Implementation > >@@ -1533,7 +1534,7 @@ > else if (first instanceof ISystemFilterReference) > { > return true; >- } >+ } > else // akh11: proposed modification -- 01/28/2005 > { // ask source adapter if it supports drop of its type on this target: > ISystemViewDropDestination adapter = (ISystemViewDropDestination)Platform.getAdapterManager().getAdapter(first,ISystemViewDropDestination.class); >@@ -1543,7 +1544,7 @@ > } > return false; > } >- >+ > /** > * Return true if it is valid for the src object to be dropped in the target > * @param src the object to drop >@@ -1589,7 +1590,7 @@ > { > return true; > } >- >+ > else // akh11: proposed modification -- 01/28/2005 > { // ask source adapter if it supports drop of its type on this target: > ISystemViewDropDestination adapter = (ISystemViewDropDestination)Platform.getAdapterManager().getAdapter(src,ISystemViewDropDestination.class); >@@ -1601,15 +1602,15 @@ > > return false; > } >- > >- >+ >+ > /** > * Performs a drag copy operation. The source object is uploaded to a temporary location so that it can >- * later be dropped on another remote system. >+ * later be dropped on another remote system. > * @param element the object which is being copied > * @param sameSystem an indication whether a transfer is being made between the same types of systems. >- * @param monitor a progress monitor >+ * @param monitor a progress monitor > * @return the temporary object that was created after the upload > */ > public Object doDrag(Object element, boolean sameSystem, IProgressMonitor monitor) >@@ -1629,7 +1630,7 @@ > // if the src is an IResource, then this is our temp object > return element; > } >- >+ > return null; > } > >@@ -1637,15 +1638,15 @@ > * <i><b>Overridable</b> by subclasses, and is iff drag and drop supported.</i><br> > * Perform the drag on the given objects. This default implementation simply iterates through the > * set. For optimal performance, this should be overridden. >- * >+ * > * @param set the set of objects to copy > * @param monitor the progress monitor > * @return a temporary workspace copies of the object that was copied >- * >+ * > */ > public ISystemResourceSet doDrag(SystemRemoteResourceSet set, IProgressMonitor monitor) > { >- >+ > boolean supportsSearch = ((IRemoteFileSubSystemConfiguration)set.getSubSystem().getSubSystemConfiguration()).supportsSearch(); > boolean doSuperTransferProperty = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.DOSUPERTRANSFER); > if (!doSuperTransferProperty && supportsSearch) >@@ -1653,18 +1654,18 @@ > SystemRemoteResourceSet flatSet = new SystemRemoteResourceSet(set.getSubSystem(), set.getAdapter()); > long totalByteSize = getFlatRemoteResourceSet(set.getResourceSet(), flatSet, monitor); > flatSet.setByteSize(totalByteSize); >- >+ > if (monitor != null) >- { >+ { > monitor.beginTask(_downloadMessage, (int)totalByteSize); > //monitor.done(); > } >- >+ > try > { >- //SystemWorkspaceResourceSet flatResult = UniversalFileTransferUtility.copyRemoteResourcesToWorkspace(flatSet, monitor); >+ //SystemWorkspaceResourceSet flatResult = UniversalFileTransferUtility.copyRemoteResourcesToWorkspace(flatSet, monitor); > // for bug 209375, using multiple instead of single >- SystemWorkspaceResourceSet flatResult = UniversalFileTransferUtility.downloadResourcesToWorkspaceMultiple(flatSet, monitor); >+ SystemWorkspaceResourceSet flatResult = UniversalFileTransferUtility.downloadResourcesToWorkspaceMultiple(flatSet, monitor); > if (flatResult.hasMessage()) > { > return flatResult; >@@ -1696,7 +1697,7 @@ > return UniversalFileTransferUtility.downloadResourcesToWorkspace(set, monitor); > } > } >- >+ > /** > * Helper method to get the local file subsystem. > * @return the local file subsystem >@@ -1717,27 +1718,27 @@ > > return null; > } >- >+ > protected long getFlatRemoteResourceSet(List initialResources, SystemRemoteResourceSet flatSet, IProgressMonitor monitor) > { > long totalByteSize = 0; > List configList = new ArrayList(); >- >+ > // create a search result set to contain all the results > IHostSearchResultSet searchSet = new HostSearchResultSet(); >- >+ > IRemoteFileSubSystem subsys = (IRemoteFileSubSystem)flatSet.getSubSystem(); > if (subsys instanceof FileServiceSubSystem) > { > FileServiceSubSystem ss = (FileServiceSubSystem)subsys; >- >+ > for (int i = 0; i < initialResources.size(); i++) > { > IRemoteFile remoteFile = (IRemoteFile)initialResources.get(i); >- >+ > // get all files within directory > if (remoteFile.isDirectory()) >- { >+ { > SystemSearchString searchString = null; > if (ArchiveHandlerManager.isVirtual(remoteFile.getAbsolutePath())) > { >@@ -1749,30 +1750,30 @@ > { > searchString = new SystemSearchString("*", false, false, "*", false, false, true); //$NON-NLS-1$ //$NON-NLS-2$ > } >- >+ > // create the configuration for this folder > IHostSearchResultConfiguration config = ss.createSearchConfiguration(searchSet, remoteFile, searchString); >- >+ > // kick off search for all files in the folder > subsys.search(config); > configList.add(config); >- } >+ } > else > { > flatSet.addResource(remoteFile); > } >- } >+ } > } >- >- >- >+ >+ >+ > SubProgressMonitor submonitor = null; > if (monitor != null) > { > submonitor = new SubProgressMonitor(monitor, configList.size()); > submonitor.setTaskName(FileResources.RESID_SEARCH_MESSAGE_SEARCHING); >- >- } >+ >+ } > // accumulate results > for (int n = 0; n < configList.size(); n++) > { >@@ -1804,19 +1805,19 @@ > } > } > } >- >+ > if (config.getStatus() == IHostSearchConstants.FINISHED) >- { >+ { > if (submonitor != null) > submonitor.worked(1); > Object[] results = config.getResults(); > if (results == null || results.length == 0){ > // make sure search is really done > System.out.println("waiting for results"); //$NON-NLS-1$ >- >+ > } >- >- >+ >+ > for (int m = 0; m < results.length; m++) > { > Object result = results[m]; >@@ -1825,14 +1826,14 @@ > IRemoteFile file = (IRemoteFile)result; > flatSet.addResource(file); > totalByteSize += file.getLength(); >- } >+ } > } > } >- } >+ } > //submonitor.done(); > return totalByteSize; > } >- >+ > protected long getFlatWorkspaceResourceSet(List resources, SystemWorkspaceResourceSet flatSet, IProgressMonitor monitor) > { > long totalBytes = 0; >@@ -1852,16 +1853,16 @@ > try > { > IResource[] members = container.members(); >- totalBytes += getFlatWorkspaceResourceSet(members, flatSet, monitor); >+ totalBytes += getFlatWorkspaceResourceSet(members, flatSet, monitor); > } > catch (Exception e) >- { >+ { > } > } > } > return totalBytes; > } >- >+ > protected long getFlatWorkspaceResourceSet(IResource[] resources, SystemWorkspaceResourceSet flatSet, IProgressMonitor monitor) > { > long totalBytes = 0; >@@ -1881,18 +1882,18 @@ > try > { > IResource[] members = container.members(); >- totalBytes += getFlatWorkspaceResourceSet(members, flatSet, monitor); >+ totalBytes += getFlatWorkspaceResourceSet(members, flatSet, monitor); > } > catch (Exception e) >- { >+ { > } > } > } > return totalBytes; > } >- >- >- >+ >+ >+ > public static class RenameRunnable implements Runnable > { > private IRemoteFile _targetFileOrFolder; >@@ -1907,9 +1908,9 @@ > _targetFileOrFolder = targetFileOrFolder; > _namesInUse=namesInUse; > } >- >+ > public void run() { >- ValidatorFileUniqueName validator = null; >+ ValidatorFileUniqueName validator = null; > SystemRenameSingleDialog dlg; > if(_namesInUse!=null && _namesInUse.size()>0) > { >@@ -1925,13 +1926,13 @@ > else > _newName = null; > } >- >+ > public String getNewName() > { > return _newName; > } > } >- >+ > /** > * Perform drop from the "fromSet" of objects to the "to" object > * @param fromSet the source objects for the drop >@@ -1940,10 +1941,10 @@ > * @param sameSystem indication of whether the source and target are on the same system > * @param srcType the type of objects to be dropped > * @param monitor the progress monitor >- * >+ * > * @return the set of new objects created from the drop >- * >- */ >+ * >+ */ > public ISystemResourceSet doDrop(ISystemResourceSet fromSet, Object target, boolean sameSystemType, boolean sameSystem, int srcType, IProgressMonitor monitor) > { > SystemRemoteResourceSet resultSet = new SystemRemoteResourceSet(getSubSystem(target), this); >@@ -1952,7 +1953,7 @@ > { > fromSet = doDrag((SystemRemoteResourceSet)fromSet, monitor); > } >- >+ > if (target instanceof IRemoteFile) > { > IRemoteFile targetFolder = (IRemoteFile) target; >@@ -1972,7 +1973,7 @@ > { > String msgTxt = FileResources.FILEMSG_SECURITY_ERROR; > String msgDetails = NLS.bind(FileResources.FILEMSG_SECURITY_ERROR_DETAILS, targetFS.getHostAliasName()); >- SystemMessage errorMsg = new SimpleSystemMessage(Activator.PLUGIN_ID, >+ SystemMessage errorMsg = new SimpleSystemMessage(Activator.PLUGIN_ID, > ISystemFileConstants.FILEMSG_SECURITY_ERROR, > IStatus.ERROR, msgTxt, msgDetails); > resultSet.setMessage(errorMsg); >@@ -1983,23 +1984,23 @@ > { > return null; > } >- >+ > List set = fromSet.getResourceSet(); > if (set.size() > 0) > { > if (fromSet instanceof SystemWorkspaceResourceSet) >- { >+ { > boolean doSuperTransferProperty = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.DOSUPERTRANSFER); > if (!doSuperTransferProperty) > { > SystemWorkspaceResourceSet flatFromSet = new SystemWorkspaceResourceSet(); > long totalByteSize = getFlatWorkspaceResourceSet(fromSet.getResourceSet(), flatFromSet, monitor); >- >+ > if (monitor != null) >- { >+ { > int size = (int)totalByteSize; > monitor.beginTask(_uploadMessage, size); >- } >+ } > // back to hierarchy > resultSet = UniversalFileTransferUtility.uploadResourcesFromWorkspace((SystemWorkspaceResourceSet)fromSet, targetFolder, monitor, true); > } >@@ -2032,7 +2033,7 @@ > String msgTxt = FileResources.FILEMSG_COPY_INTERRUPTED; > String msgDetails = NLS.bind(FileResources.FILEMSG_COPY_INTERRUPTED_DETAILS, copiedFileNames); > >- SystemMessage thisMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, >+ SystemMessage thisMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, > ISystemFileConstants.FILEMSG_COPY_INTERRUPTED, > IStatus.ERROR, msgTxt, msgDetails); > resultSet.setMessage(thisMessage); >@@ -2045,20 +2046,20 @@ > else if (fromSet instanceof SystemRemoteResourceSet) > { > SystemRemoteResourceSet rmtSet = (SystemRemoteResourceSet)fromSet; >- >+ > //ISystemDragDropAdapter srcAdapter = rmtSet.getAdapter(); > ISubSystem srcSubSystem = rmtSet.getSubSystem(); >- >+ > Object first = set.get(0); > if (first instanceof ISystemFilterReference) >- { >+ { > SystemWorkspaceResourceSet downloadedFilterResults = new SystemWorkspaceResourceSet(); > for (int i = 0; i < set.size(); i++) >- { >+ { > ISystemFilterReference ref = (ISystemFilterReference)set.get(i); > SystemFilterReference filterReference = (SystemFilterReference) ref; >- >- >+ >+ > Object[] children = null; > try > { >@@ -2066,18 +2067,18 @@ > } > catch (Exception e) > { >- } >- >+ } >+ > if (children != null) > { > for (int c = 0; c < children.length; c++) > { > Object child = children[c]; >- >+ > if (child instanceof IAdaptable) > { > Object newSrc = child; >- >+ > if (srcSubSystem != targetFS) > { > ISystemDragDropAdapter cAdapter = (ISystemDragDropAdapter) ((IAdaptable) child).getAdapter(ISystemDragDropAdapter.class); >@@ -2092,13 +2093,13 @@ > downloadedFilterResults.addResource(newSrc); > } > } >- } >+ } > } > } > } >- >+ > return doDrop(downloadedFilterResults, target, sameSystemType, srcSubSystem == targetFS, SystemDNDTransferRunnable.SRC_TYPE_RSE_RESOURCE, monitor); >- >+ > } > else if (first instanceof IRemoteFile) > { >@@ -2107,17 +2108,17 @@ > List toCopyBatch = new ArrayList(); > List existing = new ArrayList(); > boolean overwrite=false; >- >+ > for (int i = 0; i < set.size(); i++) >- { >- IRemoteFile srcFileOrFolder = (IRemoteFile)set.get(i); >+ { >+ IRemoteFile srcFileOrFolder = (IRemoteFile)set.get(i); > if (!srcFileOrFolder.exists()) > { >- String msgTxt = NLS.bind(FileResources.MSG_ERROR_FILE_NOTFOUND, >- srcFileOrFolder.getAbsolutePath(), >+ String msgTxt = NLS.bind(FileResources.MSG_ERROR_FILE_NOTFOUND, >+ srcFileOrFolder.getAbsolutePath(), > srcFileOrFolder.getSystemConnection().getAliasName()); >- >- SystemMessage errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, >+ >+ SystemMessage errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, > ISystemFileConstants.MSG_ERROR_FILE_NOTFOUND, > IStatus.ERROR, msgTxt); > resultSet.setMessage(errorMessage); >@@ -2132,19 +2133,19 @@ > return resultSet; > } > */ >- >- >+ >+ > String name = srcFileOrFolder.getName(); >- >- // same systemfor >+ >+ // same systemfor > if (sameSystem) > { > try > { > if (!targetFolder.getAbsolutePath().equals(srcFileOrFolder.getAbsolutePath()) && !targetFolder.getAbsolutePath().equals(srcFileOrFolder.getParentRemoteFile().getAbsolutePath())) > { >- >- // should be better doing a query for all in the set >+ >+ // should be better doing a query for all in the set > IRemoteFile existingFileOrFolder = ((IRemoteFileSubSystem)srcSubSystem).getRemoteFileObject(targetFolder, name, monitor); > if (existingFileOrFolder.exists()) > { >@@ -2154,7 +2155,7 @@ > */ > existing.add(existingFileOrFolder); > } >- >+ > if (name != null) > { > //toCopy.add(srcFileOrFolder); >@@ -2165,7 +2166,7 @@ > { > toCopyBatch.add(srcFileOrFolder); > }*/ >- } >+ } > } > catch (Exception e) > { >@@ -2177,15 +2178,15 @@ > //System.out.println("HOW DID I GET HERE?!!"); > } > } >- >- >+ >+ > if(existing.size()>0) > { > CopyRunnable rr = new CopyRunnable(existing); > Display.getDefault().syncExec(rr); > overwrite = rr.getOk(); > } >- >+ > //Following code for renaming dialog copying procedures is not required > /*if(existing.size()==0 || overwrite) > { >@@ -2195,30 +2196,30 @@ > IRemoteFile srcFileOrFolder = (IRemoteFile)toCopy.get(x); > String name = (String)toCopyNames.get(x); > >- >+ > SystemMessage copyMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPY_PROGRESS); > copyMessage.makeSubstitution(srcFileOrFolder.getName(), targetFolder.getName()); > if (monitor != null) > { > monitor.beginTask(copyMessage.getLevelOneText(), 100); > } >- >+ > try > { > if (targetFS.copy(srcFileOrFolder, targetFolder, name, monitor)) > { > IRemoteFile copiedFile = targetFS.getRemoteFileObject(targetFolder, name, monitor); >- resultSet.addResource(copiedFile); >+ resultSet.addResource(copiedFile); > } > else > { > // need a failed message here > String msgTxt = NLS.bind(FileResources.FILEMSG_COPY_FILE_FAILED, srcFileOrFolder.getAbsolutePath()); > String msgDetails = FileResources.FILEMSG_COPY_FILE_FAILED_DETAILS; >- >- >- >- SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, >+ >+ >+ >+ SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, > ISystemFileConstants.FILEMSG_COPY_FILE_FAILED, > IStatus.ERROR, msgTxt, msgDetails); > resultSet.setMessage(msg); >@@ -2248,7 +2249,7 @@ > String msgTxt = FileResources.FILEMSG_COPY_INTERRUPTED; > String msgDetails = NLS.bind(FileResources.FILEMSG_COPY_INTERRUPTED_DETAILS, copiedFileNames); > >- SystemMessage thisMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, >+ SystemMessage thisMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, > ISystemFileConstants.FILEMSG_COPY_INTERRUPTED, > IStatus.ERROR, msgTxt, msgDetails); > SystemMessageDialog.displayErrorMessage(shell, thisMessage); >@@ -2269,7 +2270,7 @@ > } > } > }*/ >- // deal with batch copies now >+ // deal with batch copies now > if(existing.size()==0 || overwrite) > { > IRemoteFile[] srcFileOrFolders = new IRemoteFile[toCopyBatch.size()]; >@@ -2311,7 +2312,7 @@ > { > //This object has been deleted > resultSet.addResource(thisCopiedFile); >- } >+ } > } > if (resultSet.size() > 0) > { >@@ -2326,8 +2327,8 @@ > } > String msgTxt = FileResources.FILEMSG_COPY_INTERRUPTED; > String msgDetails = NLS.bind(FileResources.FILEMSG_COPY_INTERRUPTED_DETAILS, copiedFileNames); >- >- SystemMessage thisMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, >+ >+ SystemMessage thisMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, > ISystemFileConstants.FILEMSG_COPY_INTERRUPTED, > IStatus.ERROR, msgTxt, msgDetails); > SystemMessageDialog.displayErrorMessage(shell, thisMessage); >@@ -2348,7 +2349,7 @@ > } > } > } >- } >+ } > } > } > } >@@ -2375,7 +2376,7 @@ > src = doDrag(src, sameSystem, monitor); > } > >- >+ > if (target instanceof IRemoteFile) > { > IRemoteFile targetFolder = (IRemoteFile) target; >@@ -2396,11 +2397,11 @@ > String msgTxt = FileResources.FILEMSG_SECURITY_ERROR; > String msgDetails = NLS.bind(FileResources.FILEMSG_SECURITY_ERROR_DETAILS, targetFS.getHostAliasName()); > SystemMessage errorMsg = null; >- >- errorMsg = new SimpleSystemMessage(Activator.PLUGIN_ID, >+ >+ errorMsg = new SimpleSystemMessage(Activator.PLUGIN_ID, > ISystemFileConstants.FILEMSG_SECURITY_ERROR, > IStatus.ERROR, msgTxt, msgDetails); >- >+ > return errorMsg; > } > >@@ -2416,7 +2417,7 @@ > if (src instanceof String) > { > IRemoteFileSubSystem localFS = getLocalFileSubSystem(); >- >+ > try > { > if (localFS != null) { >@@ -2441,10 +2442,10 @@ > // noop for now > } > } >- >- >+ >+ > if (sourceType == SystemDNDTransferRunnable.SRC_TYPE_ECLIPSE_RESOURCE || sourceType == SystemDNDTransferRunnable.SRC_TYPE_RSE_RESOURCE) >- { >+ { > // Eclipse resource transfer > if (src instanceof IResource) > { >@@ -2452,7 +2453,7 @@ > return UniversalFileTransferUtility.uploadResourceFromWorkspace(srcFileOrFolder, targetFolder, monitor, true); > } > } >- >+ > > // RSE remote file transfer on same system > if (sourceType == SystemDNDTransferRunnable.SRC_TYPE_RSE_RESOURCE) >@@ -2507,21 +2508,21 @@ > IRemoteFile srcFileOrFolder = (IRemoteFile) src; > if (!srcFileOrFolder.exists()) > { >- String msgTxt = NLS.bind(FileResources.MSG_ERROR_FILE_NOTFOUND, >- srcFileOrFolder.getAbsolutePath(), >+ String msgTxt = NLS.bind(FileResources.MSG_ERROR_FILE_NOTFOUND, >+ srcFileOrFolder.getAbsolutePath(), > srcFileOrFolder.getSystemConnection().getAliasName()); >- >- SystemMessage errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, >+ >+ SystemMessage errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, > ISystemFileConstants.MSG_ERROR_FILE_NOTFOUND, > IStatus.ERROR, msgTxt); >- return errorMessage; >+ return errorMessage; > } > > String msgTxt = NLS.bind(CommonMessages.MSG_COPY_PROGRESS, srcFileOrFolder.getName(), targetFolder.getAbsolutePath()); >- SystemMessage copyMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, >+ SystemMessage copyMessage = new SimpleSystemMessage(Activator.PLUGIN_ID, > ICommonMessageIds.MSG_COPY_PROGRESS, > IStatus.INFO, msgTxt); >- >+ > > IRemoteFileSubSystem localFS = srcFileOrFolder.getParentRemoteFileSubSystem(); > >@@ -2547,14 +2548,14 @@ > { > IRemoteFile copiedFile = targetFS.getRemoteFileObject(targetFolder, name, monitor); > return copiedFile; >- >+ > } > } > } > } > else > { >- >+ > //System.out.println("how do we get here!??"); > > if (srcFileOrFolder.isFile()) >@@ -2667,7 +2668,7 @@ > IRemoteFile targetFileOrFolder = ss.getRemoteFileObject(targetFolder, oldName, new NullProgressMonitor()); > > //RSEUIPlugin.logInfo("CHECKING FOR COLLISION ON '"+srcFileOrFolder.getAbsolutePath() + "' IN '" +targetFolder.getAbsolutePath()+"'"); >- //RSEUIPlugin.logInfo("...TARGET FILE: '"+tgtFileOrFolder.getAbsolutePath()+"'"); >+ //RSEUIPlugin.logInfo("...TARGET FILE: '"+tgtFileOrFolder.getAbsolutePath()+"'"); > //RSEUIPlugin.logInfo("...target.exists()? "+tgtFileOrFolder.exists()); > if (targetFileOrFolder.exists()) > { >@@ -2695,7 +2696,7 @@ > return !file.isRoot() && file.canRead(); > } > >- >+ > /** > * Perform the delete action. Defers request to the remote file subsystem > */ >@@ -2704,7 +2705,7 @@ > boolean ok; > IRemoteFile file = (IRemoteFile) element; > IRemoteFile parentFile = file.getParentRemoteFile(); >- >+ > IRemoteFileSubSystem ss = file.getParentRemoteFileSubSystem(); > try > { >@@ -2717,10 +2718,10 @@ > tmp.delete(false, null); > } > catch (Exception e) >- { >+ { > } > } >- >+ > /* > > ISystemEditableRemoteObject editable = getEditableRemoteObject(file); >@@ -2749,7 +2750,7 @@ > } > */ > ok = ss.delete(file, monitor); >- >+ > file.markStale(true); > parentFile.markStale(true); > } >@@ -2758,8 +2759,8 @@ > ok = false; > String msgTxt = NLS.bind(FileResources.FILEMSG_DELETE_FILE_FAILED, file.toString()); > String msgDetails = FileResources.FILEMSG_DELETE_FILE_FAILED_DETAILS; >- >- SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, >+ >+ SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, > ISystemFileConstants.FILEMSG_DELETE_FILE_FAILED, > IStatus.ERROR, msgTxt, msgDetails); > SystemMessageDialog.displayErrorMessage(shell, msg); >@@ -2792,11 +2793,11 @@ > tmp.delete(false, null); > } > catch (Exception e) >- { >+ { > } > } > file.markStale(true); >- parentFile.markStale(true); >+ parentFile.markStale(true); > } > catch (Exception exc) > { >@@ -2804,8 +2805,8 @@ > ok = false; > String msgTxt = NLS.bind(FileResources.FILEMSG_DELETE_FILE_FAILED, file.toString()); > String msgDetails = FileResources.FILEMSG_DELETE_FILE_FAILED_DETAILS; >- >- SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, >+ >+ SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, > ISystemFileConstants.FILEMSG_DELETE_FILE_FAILED, > IStatus.ERROR, msgTxt, msgDetails); > SystemMessageDialog.displayErrorMessage(shell, msg); >@@ -2839,7 +2840,7 @@ > { > moveTempFileProperties(localResource, ss, newRemotePath); > localResource.move(newLocalPath, true, null); >- >+ > } > catch (Exception e) > { >@@ -2874,20 +2875,20 @@ > { > SystemIFileProperties properties = new SystemIFileProperties(localFile); > properties.setRemoteFilePath(remotePath); >- >+ > Object editableObj = properties.getRemoteFileObject(); > if (editableObj != null) > { >- SystemEditableRemoteFile editable = (SystemEditableRemoteFile)editableObj; >+ SystemEditableRemoteFile editable = (SystemEditableRemoteFile)editableObj; > // there's an in-memory editable, so change the associated remote file > IRemoteFile newRemoteFile = ss.getRemoteFileObject(remotePath, new NullProgressMonitor()); > editable.setRemoteFile(newRemoteFile); >- } >+ } > } > catch (Exception e) > { > } >- >+ > } > > } >@@ -2900,19 +2901,19 @@ > boolean ok = true; > IRemoteFile file = (IRemoteFile) element; > IRemoteFileSubSystem ss = file.getParentRemoteFileSubSystem(); >- >- >+ >+ > String newRemotePath = file.getParentPath() + "/" + newName; //$NON-NLS-1$ > IResource localResource = null; > if (SystemRemoteEditManager.getInstance().doesRemoteEditProjectExist()) > { > localResource = UniversalFileTransferUtility.getTempFileFor(file); > } >- >+ > ok = ss.rename(file, newName, monitor); > if (localResource != null && localResource.exists()) > { >- >+ > IPath newLocalPath = localResource.getParent().getFullPath().append(newName); > moveTempResource(localResource, newLocalPath, ss, newRemotePath); > } >@@ -2930,10 +2931,10 @@ > // SystemResourceChangeEvent event = new SystemResourceChangeEvent(file.getParentRemoteFile(), ISystemResourceChangeEvents.EVENT_REFRESH_REMOTE, null); > // sr.fireEvent(event); > // //sr.fireRemoteResourceChangeEvent(ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED, file, file.getParentRemoteFile(), file.getParentRemoteFileSubSystem(), null, null); >-// } >+// } > // file.markStale(true); > return ok; >- >+ > } > > /** >@@ -2980,7 +2981,7 @@ > * Compare the name of the given element to the given new name to decide if they are equal. > * Allows adapters to consider case and quotes as appropriate. > * <p> >- * For Unix/Linux, returns the result of getName(element).equals(newName), which is to say, >+ * For Unix/Linux, returns the result of getName(element).equals(newName), which is to say, > * it is a case sensitive compare. For windows, it is case insensitive (equalsIgnoreCase). > */ > public boolean namesAreEqual(Object element, String newName) >@@ -3011,7 +3012,7 @@ > > // -------------------------------------------------------------------- > // METHODS PRESCRIBED BY THE ISYSTEMREMOTEELEMENT ADAPTER INTERFACE... >- // -------------------------------------------------------------------- >+ // -------------------------------------------------------------------- > > /* > * (non-Javadoc) >@@ -3045,7 +3046,7 @@ > } > return super.getSubSystem(element); > } >- /** >+ /** > * Return the subsystem factory id that owns this remote object > * The value must not be translated, so that property pages registered via xml can subset by it. > */ >@@ -3120,10 +3121,10 @@ > return srcType; > } > /** >- * Some view has updated the name or properties of this remote object. As a result, the >+ * Some view has updated the name or properties of this remote object. As a result, the > * remote object's contents need to be refreshed. You are given the old remote object that has > * old data, and you are given the new remote object that has the new data. For example, on a >- * rename the old object still has the old name attribute while the new object has the new >+ * rename the old object still has the old name attribute while the new object has the new > * new attribute. > * <p> > * This is called by viewers like SystemView in response to rename and property change events. >@@ -3139,16 +3140,16 @@ > { > RemoteFile oldFile = (RemoteFile)oldElement; > RemoteFile newFile = (RemoteFile)newElement; >- >- if ( (oldFile != newFile) >- && ( (oldFile.isFile() && newFile.isFile()) >+ >+ if ( (oldFile != newFile) >+ && ( (oldFile.isFile() && newFile.isFile()) > || (oldFile.isDirectory() && newFile.isDirectory()) )) { > oldFile.getHostFile().renameTo(newFile.getAbsolutePath()); > } >- >+ > return true; > } >- >+ > return false; > } > >@@ -3157,7 +3158,7 @@ > * it is contained in. > * <p> > * The shell is required in order to set the cursor to a busy state if a remote trip is required. >- * >+ * > * @return an IRemoteFile object for the parent > */ > public Object getRemoteParent(Object element, IProgressMonitor monitor) throws Exception >@@ -3166,11 +3167,11 @@ > } > /** > * Given a remote object, return the unqualified names of the objects contained in that parent. This is >- * used for testing for uniqueness on a rename operation, for example. Sometimes, it is not >+ * used for testing for uniqueness on a rename operation, for example. Sometimes, it is not > * enough to just enumerate all the objects in the parent for this purpose, because duplicate >- * names are allowed if the types are different, such as on iSeries. In this case return only >+ * names are allowed if the types are different, such as on iSeries. In this case return only > * the names which should be used to do name-uniqueness validation on a rename operation. >- * >+ * > * @return an array of all file and folder names in the parent of the given IRemoteFile object > */ > public String[] getRemoteParentNamesInUse(Object element, IProgressMonitor monitor) throws Exception >@@ -3208,17 +3209,17 @@ > return false; > } > /** FIXME commands now separate from this >- else if (testAttribute(remoteFile, "classification", "*executable*") || >+ else if (testAttribute(remoteFile, "classification", "*executable*") || > testAttribute(remoteFile, "classification", "*script") || > testAttribute(remoteFile, "classification", "symbolic link(script)*") > ) > { > // instead of opening in editor > // attempt to execute it >- return RemoteCommandHelpers.runUniversalCommand(getShell(), remoteFile.getName(), remoteFile.getParentPath(), >+ return RemoteCommandHelpers.runUniversalCommand(getShell(), remoteFile.getName(), remoteFile.getParentPath(), > remoteFile.getParentRemoteFileSubSystem().getCommandSubSystem()); >- } >- */ >+ } >+ */ > else if (!remoteFile.isArchive() || !remoteFile.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement()) > { > // only handle double click if object is a file >@@ -3242,13 +3243,13 @@ > DownloadAndOpenJob oJob = new DownloadAndOpenJob(editable, false); > oJob.schedule(); > } >- >+ > } > catch (Exception e) > { > } >- >- >+ >+ > } > else if (remoteFile.isDirectory()) > { >@@ -3264,7 +3265,7 @@ > return false; > } > } >- >+ > private boolean isFileCached(ISystemEditableRemoteObject editable, IRemoteFile remoteFile) > { > // DY: check if the file exists and is read-only (because it was previously opened >@@ -3272,15 +3273,15 @@ > IFile file = editable.getLocalResource(); > SystemIFileProperties properties = new SystemIFileProperties(file); > boolean newFile = !file.exists(); >- >+ > // detect whether there exists a temp copy already > if (!newFile && file.exists()) > { > // we have a local copy of this file, so we need to compare timestamps >- >+ > // get stored modification stamp > long storedModifiedStamp = properties.getRemoteFileTimeStamp(); >- >+ > // get updated remoteFile so we get the current remote timestamp > //remoteFile.markStale(true); > IRemoteFileSubSystem subsystem = remoteFile.getParentRemoteFileSubSystem(); >@@ -3290,33 +3291,33 @@ > } > catch (Exception e) > { >- >+ > } >- >+ > // get the remote modified stamp > long remoteModifiedStamp = remoteFile.getLastModified(); >- >+ > // get dirty flag > boolean dirty = properties.getDirty(); >- >+ > boolean remoteNewer = (storedModifiedStamp != remoteModifiedStamp); >- >+ > String remoteEncoding = remoteFile.getEncoding(); > String storedEncoding = properties.getEncoding(); >- >+ > boolean encodingChanged = storedEncoding == null || !(remoteEncoding.equals(storedEncoding)); > > boolean usedBinary = properties.getUsedBinaryTransfer(); > boolean isBinary = remoteFile.isBinary(); >- >- return (!dirty && >- !remoteNewer && >+ >+ return (!dirty && >+ !remoteNewer && > usedBinary == isBinary && > !encodingChanged); > } > return false; > } >- >+ > public boolean canEdit(Object element) > { > IRemoteFile remoteFile = (IRemoteFile) element; >@@ -3359,7 +3360,7 @@ > } > return null; > } >- >+ > public IFile getCachedCopy(IRemoteFile remoteFile) throws SystemMessageException > { > if (SystemRemoteEditManager.getInstance().doesRemoteEditProjectExist()) >@@ -3394,10 +3395,10 @@ > } > return null; > } >- >- /** >+ >+ /** > * From <samp>IActionFilter</samp>, it exposes properties for decorator and popupMenus extension points. >- * <p> >+ * <p> > * <ol> > * <li>name="name". The given value must match the name exactly or if ends with an asterisk the beginning must match. > * (case sensitiveness depends on the subsystem)</li> >@@ -3432,57 +3433,57 @@ > * @see org.eclipse.ui.IActionFilter#testAttribute(java.lang.Object, java.lang.String, java.lang.String) > */ > public boolean testAttribute(Object target, String name, String value) { >- >+ > if (target instanceof IRemoteFile) > { > IRemoteFile tgt = (IRemoteFile) target; >- >+ > String inName = name.toLowerCase(); >- >- >+ >+ > if (inName.equals("classification")) //$NON-NLS-1$ > { > String classification = tgt.getClassification(); >- >+ > if (classification != null) > { > return StringCompare.compare(value, classification, true); > } > } > else if (inName.equals("name")) //$NON-NLS-1$ >- { >+ { > boolean caseSensitive = tgt.getParentRemoteFileSubSystem().isCaseSensitive(); >- >+ > String tgtName = getName(target); > String val = value; >- >+ > // if case does not matter, then lower case the compares > if (!caseSensitive) { > tgtName = tgtName.toLowerCase(); > val = val.toLowerCase(); > } >- >+ > // we have a wild card test, and * is the last character in the value > if (val.endsWith("*")) { //$NON-NLS-1$ > return tgtName.startsWith(val.substring(0, val.length()-1)); >- } >+ } > else { > return val.equals(tgtName); > } > } > else if (inName.equals("absolutePath".toLowerCase())) { //$NON-NLS-1$ >- >+ > boolean caseSensitive = tgt.getParentRemoteFileSubSystem().isCaseSensitive(); >- >+ > String tgtPath = getAbsoluteName(target); > String val = value; >- >+ > // if case does not matter, then lower case the compares > if (!caseSensitive) { > tgtPath = tgtPath.toLowerCase(); > val = val.toLowerCase(); > } >- >+ > // we have a wild card test, and * is the last character in the value > if (val.endsWith("*")) { //$NON-NLS-1$ > return tgtPath.startsWith(val.substring(0, val.length()-1)); >@@ -3492,21 +3493,21 @@ > } > } > else if (inName.equals("extension")) { //$NON-NLS-1$ >- >+ > boolean caseSensitive = tgt.getParentRemoteFileSubSystem().isCaseSensitive(); >- >+ > String tgtExtension = tgt.getExtension(); >- >+ > if (tgtExtension == null) { > return false; > } >- >+ > StringTokenizer st = new StringTokenizer(value, " \t\n\r\f,"); //$NON-NLS-1$ >- >+ > String val = null; >- >+ > while (st.hasMoreTokens()) { >- >+ > val = st.nextToken(); > > // if case does not matter, then lower case the compares >@@ -3514,7 +3515,7 @@ > tgtExtension = tgtExtension.toLowerCase(); > val = val.toLowerCase(); > } >- >+ > boolean match = false; > > // we have a wild card test, and * is the last character in >@@ -3525,13 +3526,13 @@ > else { > match = val.equals(tgtExtension); > } >- >+ > // if there is a match, return true, otherwise check against next extension > if (match) { > return true; > } > } >- >+ > // return false if no match > return false; > } >@@ -3578,19 +3579,19 @@ > else if (inName.equals("isarchive")) { //$NON-NLS-1$ > return tgt.isArchive() && value.equals("true") || //$NON-NLS-1$ > !tgt.isArchive() && value.equals("false"); //$NON-NLS-1$ >- } >+ } > else if (inName.equals("isvirtual")) //$NON-NLS-1$ > { > return tgt instanceof IVirtualRemoteFile && value.equals("true") || //$NON-NLS-1$ > !(tgt instanceof IVirtualRemoteFile) && value.equals("false"); //$NON-NLS-1$ > } > else if (inName.equals("isexecutable")) //$NON-NLS-1$ >- { >+ { > return tgt.isExecutable() && value.equals("true") || //$NON-NLS-1$ > !tgt.isExecutable() && value.equals("false"); //$NON-NLS-1$ > } > else if (inName.equals("islink")) //$NON-NLS-1$ >- { >+ { > return tgt.isLink() && value.equals("true") || //$NON-NLS-1$ > !tgt.isLink() && value.equals("false"); //$NON-NLS-1$ > } >@@ -3601,44 +3602,69 @@ > if (tgt instanceof IAdaptable){ > IFilePermissionsService service = (IFilePermissionsService)((IAdaptable)tgt).getAdapter(IFilePermissionsService.class); > if (service != null){ >- >+ > return (service.getCapabilities(tgt.getHostFile()) & IFilePermissionsService.FS_CAN_GET_PERMISSIONS) != 0; > } >- } >+ } > } > return false; > } > else if (inName.equals("iscommandsubsystemexists")) { //$NON-NLS-1$ >- >+ > boolean test = value.equals("true"); //$NON-NLS-1$ >- >+ > ISubSystem subsystem = getSubSystem(tgt); >- >+ > if (subsystem != null) { > IHost host = subsystem.getHost(); > ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); >- >+ > ISubSystem[] subsystems = registry.getSubSystems(host); >- >+ > for (int i = 0; i < subsystems.length; i++) { > ISubSystem temp = subsystems[i]; >- >+ > if (temp instanceof IRemoteCmdSubSystem) { > return test; > } > } >- >+ > return !test; > } > else { > return !test; > } > } >+ else if (inName.equals("isterminalsubsystemexists")) { //$NON-NLS-1$ >+ >+ boolean test = value.equals("true"); //$NON-NLS-1$ >+ >+ ISubSystem subsystem = getSubSystem(tgt); >+ >+ if (subsystem != null) { >+ IHost host = subsystem.getHost(); >+ ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); >+ >+ ISubSystem[] subsystems = registry.getSubSystems(host); >+ >+ for (int i = 0; i < subsystems.length; i++) { >+ ISubSystem temp = subsystems[i]; >+ if (temp.getSubSystemConfiguration().getId().indexOf("terminal") >= 0) { //$NON-NLS-1$ >+ return test; >+ } >+ } >+ >+ return !test; >+ } >+ else { >+ return !test; >+ } >+ } > } >- >+ > return super.testAttribute(target, name, value); > } >- >+ > /* > * Return whether deferred queries are supported. > */ >@@ -3646,7 +3672,7 @@ > { > return !subSys.getHost().getSystemType().isLocal(); > } >- >+ > > protected SystemFetchOperation getSystemFetchOperation(Object o, IElementCollector collector) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 170910
:
94053
|
94054
|
94056
|
94707
|
94709
|
94791
|
94937
|
94965
|
94966
|
94967
|
94968
|
95078
|
95079
|
95107
|
95109
|
95116
|
95117
|
95455
|
95456
|
95680
|
95681