diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSECoreRegistry.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSECoreRegistry.java index c3de0597c8f..72b24e92b16 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSECoreRegistry.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSECoreRegistry.java @@ -18,10 +18,11 @@ package org.eclipse.rse.core; /** - * Interface for RSE core registry. Clients should use this interface as the starting point for querying and - * manipulating model objects in the RSE framework. - * - * This interface is not intended to be implemented by clients. + * Interface for RSE core registry. Clients should use this interface as the + * starting point for querying and manipulating model objects in the RSE + * framework. + * + * @noimplement This interface is not intended to be implemented by clients. */ public interface IRSECoreRegistry { @@ -45,7 +46,7 @@ public interface IRSECoreRegistry { * @deprecated Use {@link #getSystemTypeById(String)}. */ public IRSESystemType getSystemType(String name); - + /** * Returns a system type object given by the id. * diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSESystemType.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSESystemType.java index 2c662d6e2bd..4cd6ac3979c 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSESystemType.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSESystemType.java @@ -1,13 +1,13 @@ /******************************************************************************** * Copyright (c) 2000, 2008 IBM Corporation 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 + * of the Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html * * Initial Contributors: * The following IBM employees contributed to the Remote System Explorer - * component that contains this file: David McKnight, Kushal Munir, - * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: @@ -29,10 +29,11 @@ import org.osgi.framework.Bundle; * Interface for a system type. Constants are defined for various system types. * These constants are kept in sync with definitions in plugin.xml. *
- * This interface is not intended to be implemented by clients. System type - * implementations must subclass {@link AbstractRSESystemType} rather than - * implementing this interface directly. - *
+ * @noimplement This interface is not intended to be implemented by clients. + * System type implementations must subclass + * {@link AbstractRSESystemType} rather than implementing this + * interface directly. + * */ public interface IRSESystemType extends IAdaptable { @@ -41,7 +42,7 @@ public interface IRSESystemType extends IAdaptable { * @deprecated Use {@link #SYSTEMTYPE_LINUX_ID}. */ public static final String SYSTEMTYPE_LINUX = "Linux"; //$NON-NLS-1$ - + /** * Linux system type, "org.eclipse.rse.systemtype.linux". */ @@ -52,7 +53,7 @@ public interface IRSESystemType extends IAdaptable { * @deprecated Use {@link #SYSTEMTYPE_POWER_LINUX_ID}. */ public static final String SYSTEMTYPE_POWER_LINUX = "Power Linux"; //$NON-NLS-1$ - + /** * Power Linux type, "org.eclipse.rse.systemtype.linux.power". */ @@ -68,7 +69,7 @@ public interface IRSESystemType extends IAdaptable { * Power Linux type, "org.eclipse.rse.systemtype.linux.zseries". */ public static final String SYSTEMTYPE_ZSERIES_LINUX_ID = "org.eclipse.rse.systemtype.linux.zSeries"; //$NON-NLS-1$ - + /** * Unix system type, "Unix". * @deprecated Use {@link #SYSTEMTYPE_UNIX_ID}. @@ -79,7 +80,7 @@ public interface IRSESystemType extends IAdaptable { * Unix system type, "org.eclipse.rse.systemtype.unix". */ public static final String SYSTEMTYPE_UNIX_ID = "org.eclipse.rse.systemtype.unix"; //$NON-NLS-1$ - + /** * AIX system type, "AIX". * @deprecated Use {@link #SYSTEMTYPE_AIX_ID}. @@ -90,7 +91,7 @@ public interface IRSESystemType extends IAdaptable { * AIX system type, "org.eclipse.rse.systemtype.aix". */ public static final String SYSTEMTYPE_AIX_ID = "org.eclipse.rse.systemtype.aix"; //$NON-NLS-1$ - + /** * PASE system type, "PASE". * @deprecated Use {@link #SYSTEMTYPE_PASE_ID}. @@ -101,7 +102,7 @@ public interface IRSESystemType extends IAdaptable { * PASE system type, "org.eclipse.rse.systemtype.PASE". */ public static final String SYSTEMTYPE_PASE_ID = "org.eclipse.rse.systemtype.iseries.PASE"; //$NON-NLS-1$ - + /** * iSeries system type, "iSeries". * @deprecated Use {@link #SYSTEMTYPE_ISERIES_ID}. @@ -112,7 +113,7 @@ public interface IRSESystemType extends IAdaptable { * iSeries system type, "org.eclipse.rse.systemtype.iseries". */ public static final String SYSTEMTYPE_ISERIES_ID = "org.eclipse.rse.systemtype.iseries"; //$NON-NLS-1$ - + /** * Local system type, "Local". * @deprecated Use {@link #SYSTEMTYPE_LOCAL_ID}. @@ -123,7 +124,7 @@ public interface IRSESystemType extends IAdaptable { * Local system type, "org.eclipse.rse.systemtype.local". */ public static final String SYSTEMTYPE_LOCAL_ID = "org.eclipse.rse.systemtype.local"; //$NON-NLS-1$ - + /** * z/OS system type, "z/OS". * @deprecated Use {@link #SYSTEMTYPE_ZSERIES_ID}. @@ -134,7 +135,7 @@ public interface IRSESystemType extends IAdaptable { * z/OS system type, "org.eclipse.rse.systemtype.zseries". */ public static final String SYSTEMTYPE_ZSERIES_ID = "org.eclipse.rse.systemtype.zseries"; //$NON-NLS-1$ - + /** * Windows system type, "Windows". * @deprecated Use {@link #SYSTEMTYPE_WINDOWS_ID}. @@ -143,7 +144,7 @@ public interface IRSESystemType extends IAdaptable { /** Windows system type, "org.eclipse.rse.systemtype.windows". */ public static final String SYSTEMTYPE_WINDOWS_ID = "org.eclipse.rse.systemtype.windows"; //$NON-NLS-1$ - + /** Discovery system type, "org.eclipse.rse.systemtype.discovery". */ public static final String SYSTEMTYPE_DISCOVERY_ID = "org.eclipse.rse.systemtype.discovery"; //$NON-NLS-1$ /** FTP Only system type, "org.eclipse.rse.systemtype.ftp". */ @@ -152,9 +153,9 @@ public interface IRSESystemType extends IAdaptable { public static final String SYSTEMTYPE_SSH_ONLY_ID = "org.eclipse.rse.systemtype.ssh"; //$NON-NLS-1$ /** Telnet Only system type, "org.eclipse.rse.systemtype.telnet". */ public static final String SYSTEMTYPE_TELNET_ONLY_ID = "org.eclipse.rse.systemtype.telnet"; //$NON-NLS-1$ - - /** - * System type Property Key (value: "isLocal") indicating whether + + /** + * System type Property Key (value: "isLocal") indicating whether * a system type is declared in plugin.xml to refers to the local * system. * On a the local system, the following properties are expected: @@ -165,13 +166,13 @@ public interface IRSESystemType extends IAdaptable { * @see #testProperty(String, boolean) */ public static final String PROPERTY_IS_LOCAL = "isLocal"; //$NON-NLS-1$ - - /** - * System type Property Key (value: "isWindows") indicating whether + + /** + * System type Property Key (value: "isWindows") indicating whether * a system type is declared in plugin.xml to refers to a Windows * system. - *- * This is an "aggregate" property consisting of several smaller + *
+ * This is an "aggregate" property consisting of several smaller
* properties like isCaseSensitive. In the future, we'll want more
* fine granular properties to check against. On a Windows system,
* the following properties are expected:
@@ -187,14 +188,14 @@ public interface IRSESystemType extends IAdaptable {
* @see #testProperty(String, boolean)
*/
public static final String PROPERTY_IS_WINDOWS = "isWindows"; //$NON-NLS-1$
-
+
/**
* System type Property Key (value: "isCaseSensitive") indicating
* whether a given system type is in general case sensitive.
* @see #testProperty(String, boolean)
*/
public static final String PROPERTY_IS_CASE_SENSITIVE = "isCaseSensitive"; //$NON-NLS-1$
-
+
/**
* Returns the id of the system type.
* @return the id of the system type
@@ -203,11 +204,11 @@ public interface IRSESystemType extends IAdaptable {
/**
* Returns the translatable label for use in the UI.
- *
+ *
* @return The UI label or null
if not set.
*/
public String getLabel();
-
+
/**
* Returns the name of the system type.
* @return the name of the system type
@@ -230,7 +231,7 @@ public interface IRSESystemType extends IAdaptable {
* @return the value associated with the given key or null
if none
*/
public String getProperty(String key);
-
+
/**
* Tests whether the given boolean property matches the expected value
* for this system type.
@@ -238,7 +239,7 @@ public interface IRSESystemType extends IAdaptable {
* Clients can use their own properties with system types, but should
* use reverse DNS notation to qualify their property keys (e.g.
* com.acme.isFoobarSystem
. Property keys without qualifying
- * namespace are reserved for RSE internal use.
+ * namespace are reserved for RSE internal use.
*
* @param key the name of the property to return
* @param expectedValue the expected boolean value of the property.
@@ -247,7 +248,7 @@ public interface IRSESystemType extends IAdaptable {
* is not set or does not match.
*/
public boolean testProperty(String key, boolean expectedValue);
-
+
/**
* Tests whether the system type is currently enabled.
*
@@ -259,7 +260,7 @@ public interface IRSESystemType extends IAdaptable {
* Implementers of custom system types (which are registered by a SystemTypeProvider)
* can override this method to provide more advanced enabled checks e.g. based on
* license availability.
- *
+ *
* @return true
if the system type is currently enabled, or false
otherwise.
*/
public boolean isEnabled();
@@ -267,11 +268,11 @@ public interface IRSESystemType extends IAdaptable {
/**
* Tests whether the system type refers to the local system.
* This is a shortcut for
- *
- * getId().equals(SYSTEMTYPE_LOCAL_ID) || + *+ * getId().equals(SYSTEMTYPE_LOCAL_ID) || * || testProperty(PROPERTY_IS_LOCAL, true) *- * See {@link #PROPERTY_IS_LOCAL} for properties expected on + * See {@link #PROPERTY_IS_LOCAL} for properties expected on * a Local system. * Extenders (contributors of custom system types) may override. * @return true if the system type refers to the local system. @@ -281,14 +282,14 @@ public interface IRSESystemType extends IAdaptable { /** * Tests whether the system type refers to the Windows system. * This is a shortcut for - *+ ** getId().equals(SYSTEMTYPE_WINDOWS_ID) * || isLocal() && System.getProperty("os.name").toLowerCase().startsWith("win") * || testProperty(PROPERTY_IS_WINDOWS, true) *- * See {@link #PROPERTY_IS_WINDOWS} for properties expected on + * See {@link #PROPERTY_IS_WINDOWS} for properties expected on * a Windows system. This is an "aggregate" property consisting - * of several smaller properties like isCaseSensitive. In the + * of several smaller properties like isCaseSensitive. In the * future, we'll want more fine granular properties to check against. * Extenders (contributors of custom system types) may override. * @return true if the system type refers to a Windows system. @@ -297,16 +298,16 @@ public interface IRSESystemType extends IAdaptable { /** * Returns the bundle which is responsible for the definition of this system type. - * Typically this is used as a base for searching for images and other files + * Typically this is used as a base for searching for images and other files * that are needed in presenting the system type. * * @return the bundle which defines this system type ornull
if none */ public Bundle getDefiningBundle(); - + /** * Returns a list of fully qualified known subsystem configuration id's that - * this system type wants to be registered against. + * this system type wants to be registered against. * More subsystem configurations can be added through the subsystemConfigurations * extension point. *@@ -316,9 +317,9 @@ public interface IRSESystemType extends IAdaptable { * * @return The list of subsystem configuration id's. May be empty, * but never
null
. - */ + */ public String[] getSubsystemConfigurationIds(); - + /** * Creates a newIHost
object instance. This method is * called from {@link SystemHostPool#createHost(IRSESystemType, String, String, String, String, int)}. @@ -326,5 +327,5 @@ public interface IRSESystemType extends IAdaptable { * @param profile The system profile to associate with the host. * @return A newIHost
object instance. */ - public IHost createNewHostInstance(ISystemProfile profile); + public IHost createNewHostInstance(ISystemProfile profile); } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemHostPool.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemHostPool.java index 8144a40fcc0..6410b2830ce 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemHostPool.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemHostPool.java @@ -1,13 +1,13 @@ /******************************************************************************** * Copyright (c) 2002, 2008 IBM Corporation 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 + * of the Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html * * Initial Contributors: * The following IBM employees contributed to the Remote System Explorer - * component that contains this file: David McKnight, Kushal Munir, - * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: @@ -22,14 +22,14 @@ import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.IRSEUserIdConstants; /** - * An ordered list of connections ({@link IHost} objects), owned by an {@link ISystemProfile}. + * An ordered list of connections ({@link IHost} objects), owned by an + * {@link ISystemProfile}. ** Implementations of this interface are expected to be thread-safe in the sense - * that integrity of the host list is maintained even if multiple threads call + * that integrity of the host list is maintained even if multiple threads call * multiple methods in this interface concurrently. - *
- * This interface is not intended to be implemented by clients. *
+ * @noimplement This interface is not intended to be implemented by clients. */ public interface ISystemHostPool extends IRSEPersistableContainer { @@ -62,48 +62,48 @@ public interface ISystemHostPool extends IRSEPersistableContainer { */ public IHost[] getHosts(); - /** - * Create a connection object, given only the minimal information. - *- * THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU. - * @param systemType system type matching one of the system types - * defined via the systemTypes extension point. - * @param aliasName unique connection name. - * @param hostName IP name or address of the host. - * @return IHost object, or null if it failed to create - * because the aliasName is not unique. All other errors throw an exception. - */ + /** + * Create a connection object, given only the minimal information. + *
+ * THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU. + * @param systemType system type matching one of the system types + * defined via the systemTypes extension point. + * @param aliasName unique connection name. + * @param hostName IP name or address of the host. + * @return IHost object, or null if it failed to create + * because the aliasName is not unique. All other errors throw an exception. + */ public IHost createHost(IRSESystemType systemType, String aliasName, String hostName); - /** - * Create a connection object, given all the possible attributes except default userId. - *
- * THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU. - * @param systemType system type matching one of the system types - * defined via the systemTypes extension point. - * @param aliasName unique connection name. - * @param hostName IP name or address of the host. - * @param description optional description of the connection. Can be null. - * @return IHost object, or
null
if it failed to create - * because the aliasName is not unique. All other errors throw an exception. - */ + /** + * Create a connection object, given all the possible attributes except default userId. + *+ * THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU. + * @param systemType system type matching one of the system types + * defined via the systemTypes extension point. + * @param aliasName unique connection name. + * @param hostName IP name or address of the host. + * @param description optional description of the connection. Can be null. + * @return IHost object, or
null
if it failed to create + * because the aliasName is not unique. All other errors throw an exception. + */ public IHost createHost(IRSESystemType systemType, String aliasName, String hostName, String description); - /** - * Create a connection object, given all the possible attributes. - *- * The new connection is added to the list and saved to disk. - * @param systemType system type matching one of the system types - * defined via the systemTypes extension point. - * @param aliasName unique connection name. - * @param hostName IP name or address of the host. - * @param description optional description of the connection. Can be null. - * @param defaultUserId userId to use as the default for the subsystems. - * @param defaultUserIdLocation where to set the given default user Id. See IRSEUserIdConstants for values. - * @return IHost object, or
null
if it failed to create - * because the aliasName is not unique. - * @see IRSEUserIdConstants - */ + /** + * Create a connection object, given all the possible attributes. + *+ * The new connection is added to the list and saved to disk. + * @param systemType system type matching one of the system types + * defined via the systemTypes extension point. + * @param aliasName unique connection name. + * @param hostName IP name or address of the host. + * @param description optional description of the connection. Can be null. + * @param defaultUserId userId to use as the default for the subsystems. + * @param defaultUserIdLocation where to set the given default user Id. See IRSEUserIdConstants for values. + * @return IHost object, or
null
if it failed to create + * because the aliasName is not unique. + * @see IRSEUserIdConstants + */ public IHost createHost(IRSESystemType systemType, String aliasName, String hostName, String description, String defaultUserId, int defaultUserIdLocation); /** @@ -118,7 +118,7 @@ public interface ISystemHostPool extends IRSEPersistableContainer { * @param systemType system type matching one of the system types * defined via the systemType extension point. * @param aliasName unique connection name. - * @param hostName IP name or address of the host. + * @param hostName IP name or address of the host. * @param description optional description of the connection. Can be null. * @param defaultUserId userId to use as the default for the subsystems. * @param defaultUserIdLocation where to set the given default user Id from IRSEUserIdConstants. @@ -126,29 +126,29 @@ public interface ISystemHostPool extends IRSEPersistableContainer { */ public void updateHost(IHost conn, IRSESystemType systemType, String aliasName, String hostName, String description, String defaultUserId, int defaultUserIdLocation); - /** - * Return a connection object, given its alias name. - * - * Can be used to test if an alias name is already used (non-null return). - * - * @param aliasName unique aliasName (case insensitive) to search on. - * @return IHost object with unique aliasName, or null if - * no connection object with this name exists. - */ + /** + * Return a connection object, given its alias name. + * + * Can be used to test if an alias name is already used (non-null return). + * + * @param aliasName unique aliasName (case insensitive) to search on. + * @return IHost object with unique aliasName, or null if + * no connection object with this name exists. + */ public IHost getHost(String aliasName); /** * Return the connection at the given zero-based offset. * @param pos zero-based offset of requested connection in the connection list. - * @return IHost object requested. + * @return IHost object requested. */ public IHost getHost(int pos); /** * Add a new connection to the list. *- * This method will not ensure that the added connection's alias name is - * different (case-insensitive) than all other existing alias names. + * This method will not ensure that the added connection's alias name is + * different (case-insensitive) than all other existing alias names. * Clients are responsible for maintaining this invariant. *
* @param conn Connection to add. Must not benull
. @@ -163,7 +163,7 @@ public interface ISystemHostPool extends IRSEPersistableContainer { *
* @param conn IHost object to remove */ @@ -212,7 +212,7 @@ public interface ISystemHostPool extends IRSEPersistableContainer { /** * Move existing connections a given number of positions in the same pool. - * If the delta is negative, they are all moved up (left) by the given amount. If + * If the delta is negative, they are all moved up (left) by the given amount. If * positive, they are all moved down (right) by the given amount.
*
- * The idea here is that connections are grouped by system profile. At any - * time, there is a user-specified number of profiles "active" and connections - * from each active profile are worked with. - *
- *- * This interface is not intended to be implemented by clients. + * The idea here is that connections are grouped by system profile. At any time, + * there is a user-specified number of profiles "active" and connections from + * each active profile are worked with. *
+ * @noimplement This interface is not intended to be implemented by clients. */ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemViewInputProvider { /** - * Get the SystemFilterStartHere singleton instance. + * Get the SystemFilterStartHere singleton instance. * @return the SystemFilterStartHere singleton instance. */ public ISystemFilterStartHere getSystemFilterStartHere(); // ---------------------------- // SUBSYSTEM FACTORY METHODS... - // ---------------------------- + // ---------------------------- /** * Public method to retrieve list of subsystem factory proxies registered by extension points. @@ -124,7 +122,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie * @return an array of subsystem configurations meeting the criteria */ public ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(IRSESystemType systemType, boolean filterDuplicates, boolean activate); - + // ---------------------------------- // SYSTEMVIEWINPUTPROVIDER METHODS... // ---------------------------------- @@ -141,11 +139,11 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie /** * This method is called by the connection adapter when deciding to show a plus-sign * or not beside a connection. - * @param selectedConnection the connection being shown in the viewer + * @param selectedConnection the connection being shown in the viewer * @return true if this connection has children to be shown. */ public boolean hasConnectionChildren(IHost selectedConnection); - + // ---------------------------- // PROFILE METHODS... // ---------------------------- @@ -175,7 +173,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie * @param profile Source profile to copy * @param newName Unique name to give copied profile * @param makeActive whether to make the copied profile active or not - * @param monitor Progress monitor to reflect each step of the operation + * @param monitor Progress monitor to reflect each step of the operation * @return new SystemProfile object */ public ISystemProfile copySystemProfile(ISystemProfile profile, String newName, boolean makeActive, IProgressMonitor monitor) throws Exception; @@ -199,7 +197,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie public void deleteSystemProfile(ISystemProfile profile) throws Exception; /** - * Make or unmake the given profile active. + * Make or unmake the given profile active. * The default private profile cannot be deactivated and such * a request will be ignored. */ @@ -219,7 +217,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie /** * Return list of subsystem objects for a given host. * @param host the host for which to return the subsystems that are currently known. - * @return an array of subsystem objects known to this host. + * @return an array of subsystem objects known to this host. */ public ISubSystem[] getSubSystems(IHost host); @@ -242,7 +240,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie * @return list of matching subsystems */ public ISubSystem[] getSubsystems(IHost host, Class subsystemInterface); - + /** * Get those subsystems that are registered against a given connection, * which are service subsystems with the given serviceType. @@ -277,11 +275,11 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie public String getAbsoluteNameForConnection(IHost host); /** - * Get a list of subsystem objects for given connection, owned by a subsystem factory + * Get a list of subsystem objects for given connection, owned by a subsystem factory * that is of the given category. Array will never be null but may be length zero. *
* This looks for a match on the "category" of the subsystem factory's xml declaration
- * in its plugin.xml file.
+ * in its plugin.xml file.
*
* @see org.eclipse.rse.core.model.ISubSystemConfigurationCategories
* @deprecated use {@link #getSubSystemConfigurationProxiesByCategory(String)}
@@ -304,7 +302,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
* Return the first connection to the local host we can find.
*
* While we always create a default one in the user's profile, it is possible that
- * this profile is not active or the connection was deleted. However, since any
+ * this profile is not active or the connection was deleted. However, since any
* connection to the local host will usually do, we just search all active profiles
* until we find one, and return it.
* If no connection to the local host can be found, this will return null
.
@@ -337,7 +335,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
*
* This looks for a match on the "category" of the subsystem * configuration's xml declaration in its plugin.xml file. - * Thus, it is efficient as it need not bring to life a + * Thus, it is efficient as it need not bring to life a * subsystem configuration just to test its parent class type. * * @see org.eclipse.rse.core.model.ISubSystemConfigurationCategories @@ -354,7 +352,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie * @return The list of connections or an empty array. */ public IHost[] getHostsBySystemType(IRSESystemType systemType); - + /** * Return all connections for all active profiles, for the given system types. * @@ -364,7 +362,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie public IHost[] getHostsBySystemTypes(IRSESystemType[] systemTypes); /** - * Return a SystemConnection object given a system profile containing it, + * Return a SystemConnection object given a system profile containing it, * and a connection name uniquely identifying it. */ public IHost getHost(ISystemProfile profile, String connectionName); @@ -381,7 +379,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie public int getHostCount(ISystemProfile profile); /** - * Return the number of SystemConnection objects within the given + * Return the number of SystemConnection objects within the given * connection's owning profile. */ public int getHostCountWithinProfile(IHost conn); @@ -421,7 +419,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie public IHost createLocalHost(ISystemProfile profile, String name, String userId); /** - * Create a host object, sometimes called a "connection", + * Create a host object, sometimes called a "connection", * given the containing profile and given all the possible attributes. * The profile is then scheduled to be persisted. *
@@ -496,8 +494,8 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie * because the connectionName is not unique. Call getLastException() if necessary. */ public IHost createHost(IRSESystemType systemType, String connectionName, String hostAddress, String description) throws Exception; - - /** + + /** * Create a host object. The resulting host object is added to the list of existing host objects * in the specified profile. *
- * @param host the host to be updated + * Update an existing host given the new information. + * This method: + *
+ * @param host the host to be updated * @param systemType system type matching one of the system types * defined via the systemTypes extension point. - * @param connectionName unique connection name. - * @param hostName ip name of host. - * @param description optional description of the host. Can be null. - * @param defaultUserId userId to use as the default for the subsystems under this host. - * @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants} - * that tells us where to set the user Id - */ - public void updateHost(IHost host, IRSESystemType systemType, String connectionName, - String hostName, String description, - String defaultUserId, int defaultUserIdLocation); - + * @param connectionName unique connection name. + * @param hostName ip name of host. + * @param description optional description of the host. Can be null. + * @param defaultUserId userId to use as the default for the subsystems under this host. + * @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants} + * that tells us where to set the user Id + */ + public void updateHost(IHost host, IRSESystemType systemType, String connectionName, + String hostName, String description, + String defaultUserId, int defaultUserIdLocation); + /** * Creates subsystems for a given host and subsystem configurations. * @param host the host. @@ -562,7 +560,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie public void setHostOffline(IHost conn, boolean offline); /** - * Delete an existing connection. + * Delete an existing connection. *
* Lots to do here: *
* Lots to do here: *
*
- * This interface is not intended to be implemented by clients. Subsystem - * configuration implementations must subclass SubSystemConfiguration - * rather than implementing this interface directly. - *
+ * @noimplement This interface is not intended to be implemented by clients. + * Subsystem configuration implementations must subclass + * SubSystemConfiguration rather than implementing this interface + * directly. */ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvider, IRSEPersistableContainer { // --------------------------------- @@ -53,7 +52,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide * Reset for a full refresh from disk, such as after a team synch. */ public void reset(); - + /** * Retrieves all the filter pool managers for all the profiles, active or not. * This allows cross references from @@ -146,7 +145,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide */ public boolean supportsQuickFilters(); - /** + /** * Return true if filters of this subsystem factory support dropping into. */ public boolean supportsDropInFilters(); @@ -155,7 +154,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide * Return true if deferred queries are supported. * * Deferred queries work such that when a filter or element - * children query is made, a WorkbenchJob is started to + * children query is made, a WorkbenchJob is started to * perform the query in a background thread. The query can * take time to complete, but a negative side-effect of this * is that it will always take time to complete. @@ -168,15 +167,15 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide * The default implementation returnstrue
, indicating
* that deferred queries are supported for filters, and delegates
* the check for model elements to the ISystemViewElementAdapter.
- *
+ *
* @return true
if deferred queries are supported.
*/
public boolean supportsDeferredQueries();
-
- /**
- * Return true if filters of this subsystem factory provide a custom implementation of drop support.
+
+ /**
+ * Return true if filters of this subsystem factory provide a custom implementation of drop support.
* By default, the filter reference adapter treats a drop on a filter as an update to the list of filter
- * strings for a filter. For things like files, it is more desirable to treat the drop as a physical
+ * strings for a filter. For things like files, it is more desirable to treat the drop as a physical
* resource copy, so in that case, custom drop makes sense.
*
* By default this returns false.
@@ -190,7 +189,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
public boolean supportsFileTypes();
/**
- * Tell us if this subsystem factory supports targets, which are destinations for
+ * Tell us if this subsystem factory supports targets, which are destinations for
* pushes and builds. Normally only true for file system factories.
*/
public boolean supportsTargets();
@@ -198,8 +197,8 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
/**
* Tell us if this subsystem factory supports server launch properties, which allow the user
* to configure how the server-side code for these subsystems are started. There is a Server
- * Launch Setting property page, with a pluggable composite, where users can configure these
- * properties.
+ * Launch Setting property page, with a pluggable composite, where users can configure these
+ * properties.
* Returns false in default implementation. */ public boolean isCaseSensitive(); @@ -328,12 +327,12 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide * (and their folders). *
* Must be called AFTER changing the profile's name!! - *
+ * * @param oldProfileName the old profile name. * @param newProfileName the new profile name. */ public void renameSubSystemProfile(String oldProfileName, String newProfileName); - + // --------------------------------- // SUBSYSTEM METHODS... @@ -341,7 +340,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide /** * Called by SystemRegistry's renameSystemProfile method to ensure we update our - * subsystem names within each subsystem. + * subsystem names within each subsystem. * This should be invoked after changing the profile's name. * @param subsystem the subsystem to be updated * @param oldProfileName the old profile name @@ -350,7 +349,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide public void renameSubSystemProfile(ISubSystem subsystem, String oldProfileName, String newProfileName); /** - * Called by SystemRegistry's renameSystemProfile method to pre-test if we are going to run into errors on a + * Called by SystemRegistry's renameSystemProfile method to pre-test if we are going to run into errors on a * profile rename, due to file or folder in use. */ public void preTestRenameSubSystemProfile(String oldProfileName) throws Exception; @@ -392,14 +391,14 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide * return the connector service specified in {@link #setConnectorService(IHost, IConnectorService)}. * @param host the host for which to create or retrieve the connector service * @return the connector service associated with this host. This can return null if there - * is no connector service associated with this configuration. It is recommended that + * is no connector service associated with this configuration. It is recommended that * there be a connector service if {@link #supportsSubSystemConnect()} is true. */ public IConnectorService getConnectorService(IHost host); /** - * Sets the connector service for a particular host. - * This is usually mangaged by a connector service manager known + * Sets the connector service for a particular host. + * This is usually mangaged by a connector service manager known * to this configuration. * This must be implemented by service subsystem configurations. * Service subsystems allow a connector service to be changed. @@ -442,7 +441,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide * When a subsystem is created, and {@link #supportsServerLaunchProperties(IHost)} * returns true, this method is called to create the server launcher instance * associated with the subsystem. The default implementation is to create an - * instance of {@link IRemoteServerLauncher}, but override to create your own + * instance of {@link IRemoteServerLauncher}, but override to create your own * ServerLauncher instance if you have your own class. */ public IServerLauncherProperties createServerLauncher(IConnectorService connectorService); @@ -525,19 +524,19 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide /** * A subsystem configuration has a filter pool manager for each profile. * Get the filter pool manager for the given profile. - * @param profile The system profile for which to get the manager. - * @param force if true then create the default filters for this subsystem configuration in this profile. This should only be + * @param profile The system profile for which to get the manager. + * @param force if true then create the default filters for this subsystem configuration in this profile. This should only be * done during initial subsystem creation, not during subsystem restore. * @return a filter pool manager */ public ISystemFilterPoolManager getFilterPoolManager(ISystemProfile profile, boolean force); - + /** * A subsystem configuration has a filter pool manager for each profile. * Get the filter pool manager for the given profile. * Do not force the creation of default filter pools. * Fully equivalent to getFilterPoolManager(profile, false). - * @param profile The system profile for which to get the manager. + * @param profile The system profile for which to get the manager. * @return a filter pool manager */ public ISystemFilterPoolManager getFilterPoolManager(ISystemProfile profile); @@ -640,14 +639,14 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide /** * Private. Do not call or use.- * The filter pool manager ensures that - * changes to filters and pools are + * The filter pool manager ensures that changes to filters and pools are * committed and events are fired properly. *
- * This class is not intended to be subclassed by clients. + * + * @noextend This class is not intended to be subclassed by clients. */ public class SystemFilterPoolManager extends RSEPersistableObject implements ISystemFilterPoolManager { private ISystemFilterPoolManagerProvider caller = null; @@ -122,7 +121,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy protected boolean singleFilterStringOnly = SINGLE_FILTER_STRING_ONLY_EDEFAULT; protected List pools = new ArrayList(3); -// protected List pools = null; + // protected List pools = null; /** * Constructor @@ -149,10 +148,10 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy * per manager, the name of the file is derived from this. For other save policies, * the name is not used. * @param allowNestedFilters true if filters inside filter pools in this manager are - * to allow nested filters. This is the default, but can be overridden at the + * to allow nested filters. This is the default, but can be overridden at the * individual filter pool level. */ - public static ISystemFilterPoolManager createSystemFilterPoolManager(ISystemProfile profile, Logger logger, + public static ISystemFilterPoolManager createSystemFilterPoolManager(ISystemProfile profile, Logger logger, ISystemFilterPoolManagerProvider caller, String name, boolean allowNestedFilters) { SystemFilterPoolManager mgr = new SystemFilterPoolManager(profile); mgr.initialize(logger, caller, name, allowNestedFilters); @@ -166,7 +165,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy if (!initialized) { initialize(logger, caller, name); // core data } - setSupportsNestedFilters(allowNestedFilters); // cascade it down + setSupportsNestedFilters(allowNestedFilters); // cascade it down } /* @@ -214,7 +213,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy return isSupportsNestedFilters(); } - /** + /** * Return attribute indicating if filters managed by this manager support nested duplicate filter strings. * Same as isSupportsDuplicateFilterStrings() */ @@ -240,11 +239,11 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy /** * Set attribute indicating if filters managed by this manager support duplicate filter strings, by default. - * Cascaded down to all pools, and all filters in all pools. + * Cascaded down to all pools, and all filters in all pools. * Alternatively, just call it on the particular pool or filter it applies to. */ public void setSupportsDuplicateFilterStrings(boolean newSupportsDuplicateFilterStrings) { - // as generated by emf... + // as generated by emf... setSupportsDuplicateFilterStringsGen(newSupportsDuplicateFilterStrings); // our own stuff.. @@ -279,13 +278,13 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy /** * Set attribute indicating if filters managed by this manager support case-sensitive filter strings, by default. - * Cascaded down to all pools, and all filters in all pools. + * Cascaded down to all pools, and all filters in all pools. * Alternatively, just call it on the particular pool or filter it applies to. */ public void setStringsCaseSensitive(boolean newStringsCaseSensitive) { // as generated by emf... setStringsCaseSensitiveGen(newStringsCaseSensitive); - // our special code... + // our special code... ISystemFilterPool[] pools = getSystemFilterPools(); for (int idx = 0; idx < pools.length; idx++) { pools[idx].setStringsCaseSensitive(newStringsCaseSensitive); @@ -330,17 +329,17 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy ISystemFilterPool[] result = new ISystemFilterPool[pools.size()]; pools.toArray(result); return result; -// //System.out.println("Inside getSFPools for mgr "+getName()+". poolArray null? "+(poolArray==null)); -// if ((poolArray == null) || (getPools().size() != poolArray.length)) { -// List pools = getPools(); -// poolArray = new ISystemFilterPool[pools.size()]; -// Iterator i = pools.iterator(); -// int idx = 0; -// while (i.hasNext()) -// poolArray[idx++] = (ISystemFilterPool) i.next(); -// //System.out.println("Pool array created. length = "+poolArray.length); -// } -// return poolArray; + // //System.out.println("Inside getSFPools for mgr "+getName()+". poolArray null? "+(poolArray==null)); + // if ((poolArray == null) || (getPools().size() != poolArray.length)) { + // List pools = getPools(); + // poolArray = new ISystemFilterPool[pools.size()]; + // Iterator i = pools.iterator(); + // int idx = 0; + // while (i.hasNext()) + // poolArray[idx++] = (ISystemFilterPool) i.next(); + // //System.out.println("Pool array created. length = "+poolArray.length); + // } + // return poolArray; } /** @@ -357,12 +356,12 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy } /* - * Call this to invalidate array cache after any activity + * Call this to invalidate array cache after any activity */ -// private void invalidatePoolCache() { -// poolArray = null; -// poolNames = null; -// } + // private void invalidatePoolCache() { + // poolArray = null; + // poolNames = null; + // } /** * Create a new filter pool. @@ -393,9 +392,9 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy pool.setSystemFilterPoolManager(this); pool.setStringsCaseSensitive(areStringsCaseSensitive()); pool.setSupportsDuplicateFilterStrings(isSetSupportsDuplicateFilterStrings() && supportsDuplicateFilterStrings()); -// List pools = getPools(); + // List pools = getPools(); pools.add(pool); -// invalidatePoolCache(); + // invalidatePoolCache(); commit(pool); if ((caller != null) && !suspendCallbacks) { caller.filterEventFilterPoolCreated(pool); @@ -405,7 +404,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy } /** - * Delete a given filter pool. Dependending on the save policy, the + * Delete a given filter pool. Dependending on the save policy, the * appropriate file or folder on disk will also be deleted. *
* Does the following: @@ -460,8 +459,8 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy */ public boolean preTestRenameFilterPool(ISystemFilterPool pool) throws Exception { /* - * The default implementation returns true. Persistence providers should be able to handle this - * circumstance regardless. If a pool can be renamed internally, it should be able to be + * The default implementation returns true. Persistence providers should be able to handle this + * circumstance regardless. If a pool can be renamed internally, it should be able to be * renamed in its persistent form. */ boolean ok = true; @@ -522,7 +521,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy *
Calls back to inform provider of this event (filterEventFilterCreated) * @param parent The parent which is either a SystemFilterPool or a SystemFilter * @param aliasName The name to give the new filter. Must be unique for this pool. @@ -665,7 +664,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy /** * Creates a new system filter that is typed. - * Same as {@link #createSystemFilter(ISystemFilterContainer, String, String[])} but + * Same as {@link #createSystemFilter(ISystemFilterContainer, String, String[])} but * takes a filter type as an additional parameter. *
* A filter's type is an arbitrary string that is not interpreted or used by the base framework. This @@ -684,7 +683,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy /** * Creates a new system filter that is typed and promptable - * Same as {@link #createSystemFilter(ISystemFilterContainer, String ,String[], String)} but + * Same as {@link #createSystemFilter(ISystemFilterContainer, String ,String[], String)} but * takes a boolean indicating if it is promptable. *
* A promptable filter is one in which the user is prompted for information at expand time. @@ -701,7 +700,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy ISystemFilter newFilter = doCreateSystemFilter(parent, aliasName, filterStrings, type, promptable); return newFilter; } - + /** * Creates a system filter. * @param parent the owning parent of this filter, must be a filter pool or a filter capable of nesting @@ -754,7 +753,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy } /** - * Renames a filter. This is better than filter.setName(String newName) as it + * Renames a filter. This is better than filter.setName(String newName) as it * saves the parent pool to disk. *
* Does the following: @@ -873,7 +872,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy /** * Move existing filters a given number of positions in the same container. - * If the delta is negative, they are all moved up by the given amount. If + * If the delta is negative, they are all moved up by the given amount. If * positive, they are all moved down by the given amount.
*
* Does the following: @@ -1092,7 +1091,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy /** * Move existing filter strings a given number of positions in the same filter - * If the delta is negative, they are all moved up by the given amount. If + * If the delta is negative, they are all moved up by the given amount. If * positive, they are all moved down by the given amount.
*
* Does the following:
@@ -1159,7 +1158,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
// ONE FILE PER FILTER
case SystemFilterConstants.SAVE_POLICY_ONE_FILE_PER_FILTER:
return ((SystemFilterPoolImpl)pool).getSaveFile();
- }
+ }
*/
return null;
}
@@ -1208,7 +1207,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
*
* @param message Message to be written to the log file
*
- * @param exception Any exception that generated the error condition,
+ * @param exception Any exception that generated the error condition,
* this will be used to print a stack trace in the log file.
*/
public void logError(String message, Throwable exception) {
@@ -1225,7 +1224,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
/**
* Helper method for logging debug messages
*
- * @param prefix typically the name of the class issuing the debug message. Pass in either
+ * @param prefix typically the name of the class issuing the debug message. Pass in either
* retrieved using this.getClass() (for non-static methods)
* or using MyClass.class (for static methods)
*
@@ -1258,14 +1257,14 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
}
/**
- * @generated This field/method will be replaced during code generation
+ * @generated This field/method will be replaced during code generation
*/
public String getName() {
return name;
}
/**
- * @generated This field/method will be replaced during code generation
+ * @generated This field/method will be replaced during code generation
*/
public boolean isSupportsNestedFilters() {
return supportsNestedFilters;
@@ -1279,7 +1278,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
}
/**
- * @generated This field/method will be replaced during code generation
+ * @generated This field/method will be replaced during code generation
*/
public boolean isSupportsDuplicateFilterStrings() {
return supportsDuplicateFilterStrings;
@@ -1319,7 +1318,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
}
/**
- * Save all the filter pools to disk.
+ * Save all the filter pools to disk.
* Uses the save policy specified in this manager's factory method.
*/
public boolean commit() {
@@ -1340,7 +1339,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
public IRSEPersistableContainer getPersistableParent() {
return null;
}
-
+
public IRSEPersistableContainer[] getPersistableChildren() {
return IRSEPersistableContainer.NO_CHILDREN;
}
diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/ISystemRemotePath.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/ISystemRemotePath.java
index d9768e12067..3fd9ef2cb92 100644
--- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/ISystemRemotePath.java
+++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/ISystemRemotePath.java
@@ -1,13 +1,13 @@
/********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
+ * component that contains this file: David McKnight, Kushal Munir,
+ * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@@ -17,40 +17,39 @@
package org.eclipse.rse.files.ui.resources;
/**
- * This interface defines a remote path. It is not intended to be implemented by
- * clients.
+ * This interface defines a remote path.
+ *
+ * @noimplement This interface is not intended to be implemented by clients.
*/
public interface ISystemRemotePath {
-
-
/**
* Get the profile name.
* @return the profile name
*/
public String getProfileName();
-
+
/**
* Get the connection name.
* @return the connection name
*/
public String getConnectionName();
-
+
/**
* Get the path of the resource on the server.
* @return the path of the resource on the server
*/
public String getPath();
-
+
/**
* Returns the complete string representation of the remote path.
* @return complete string representation of the remote path
*/
public String toString();
-
+
/**
* Returns whether this path equals the given object.
* This is system dependent.
*/
- public boolean equals(Object obj);
+ public boolean equals(Object obj);
}
\ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java
index 1fa1bb1555d..0448de12a8d 100644
--- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java
+++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java
@@ -1,23 +1,23 @@
/********************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation 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
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
+ * component that contains this file: David McKnight, Kushal Munir,
+ * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* Michael Scharf (Wind River) - Fix 163844: InvalidThreadAccess in checkForCollision
- * 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) - [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) - [186640] Add IRSESystemType.testProperty()
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core
* Xuan Chen (IBM) - [187548] Editor shows incorrect file name after renaming file on Linux dstore
@@ -35,7 +35,7 @@
* 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, passed through check collision as well through overloading.
* Xuan Chen (IBM) - [160775] [api] [breaking] [nl] rename (at least within a zip) blocks UI thread
* David McKnight (IBM) - [203114] don't treat XML files specially (no hidden prefs for bin vs text)
- * David McKnight (IBM) - [209552] get rid of copy APIs to be clearer with download and upload
+ * David McKnight (IBM) - [209552] get rid of copy APIs to be clearer with download and upload
* David McKnight (IBM) - [143503] encoding and isBinary needs to be stored in the IFile properties
* Xuan Chen (IBM) - [191370] [dstore] supertransfer zip not deleted when canceling copy
* Xuan Chen (IBM) - [210816] Archive testcases throw ResourceException if they are run in batch
@@ -87,6 +87,7 @@ import org.eclipse.rse.internal.files.ui.ISystemFileConstants;
import org.eclipse.rse.internal.files.ui.resources.SystemFileNameHelper;
import org.eclipse.rse.internal.files.ui.resources.SystemRemoteEditManager;
import org.eclipse.rse.internal.subsystems.files.core.ISystemFilePreferencesConstants;
+import org.eclipse.rse.internal.ui.dialogs.CopyRunnable;
import org.eclipse.rse.services.clientserver.SystemEncodingUtil;
import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager;
import org.eclipse.rse.services.clientserver.archiveutils.ISystemArchiveHandler;
@@ -108,7 +109,6 @@ import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem;
import org.eclipse.rse.subsystems.files.core.util.ValidatorFileUniqueName;
import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.SystemBasePlugin;
-import org.eclipse.rse.internal.ui.dialogs.CopyRunnable;
import org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog;
import org.eclipse.rse.ui.messages.SystemMessageDialog;
import org.eclipse.swt.widgets.Display;
@@ -117,33 +117,38 @@ import org.eclipse.ui.PlatformUI;
/**
* Utility class for doing file transfers on universal systems.
*
- * Clients may use this class, but not instantiate or subclass it.
- *
- * @noextend
- * @noinstantiate
+ * @noextend This class is not intended to be subclassed by clients.
+ * @noinstantiate This class is not intended to be instantiated by clients.
*/
public class UniversalFileTransferUtility
{
static final boolean doCompressedTransfer = true;//false;
static final String _rootPath = SystemRemoteEditManager.getInstance().getRemoteEditProjectLocation().makeAbsolute().toOSString();
-
+
public static class RenameStatus extends Status {
-
+
private static final int CANCEL_ALL = 16;
/**
- * @param severity
- * @param pluginId
- * @param code
- * @param message
- * @param exception
+ * Creates a new RenameStatus object. The created status has no
+ * children.
+ *
+ * @param severity the severity; one of OK
,
+ * ERROR
, INFO
,
+ * WARNING
, or CANCEL
+ * @param pluginId the unique identifier of the relevant plug-in
+ * @param code the plug-in-specific status code, or OK
+ * @param message a human-readable message, localized to the current
+ * locale
+ * @param exception a low-level exception, or null
if not
+ * applicable
*/
public RenameStatus(int severity, String pluginId, int code, String message, Throwable exception) {
super(severity, pluginId, code, message, exception);
}
}
-
+
/**
* Indicates whether super transfer should be used for a particular file transfer. This will return true if both
* the preference for super transfer is turned on and the subsystem configuration supports archives
@@ -153,10 +158,10 @@ public class UniversalFileTransferUtility
private static boolean doSuperTransfer(IRemoteFileSubSystem subsystem)
{
boolean doSuperTransferProperty = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.DOSUPERTRANSFER) &&
- subsystem.getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement();
+ subsystem.getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement();
return doSuperTransferProperty;
}
-
+
/**
* Transfer a remote file or folder from one remote location to another.
* @param srcFileOrFolder the file or folder to copy
@@ -184,16 +189,16 @@ public class UniversalFileTransferUtility
// compare timestamps
if (storedModifiedStamp > 0)
{
- // ;if they're the same, just use temp file
+ // ;if they're the same, just use temp file
long remoteModifiedStamp = remoteFile.getLastModified();
boolean usedBin = properties.getUsedBinaryTransfer();
boolean shouldUseBin = remoteFile.isBinary();
-
+
// changed encodings matter too
String remoteEncoding = remoteFile.getEncoding();
String lastEncoding = properties.getEncoding();
- if (storedModifiedStamp == remoteModifiedStamp &&
+ if (storedModifiedStamp == remoteModifiedStamp &&
(usedBin == shouldUseBin) &&
(remoteEncoding.equals(lastEncoding))
)
@@ -204,7 +209,7 @@ public class UniversalFileTransferUtility
}
return false;
}
-
+
/**
* replicates a remote file to the temp files project in the workspace
*
@@ -218,42 +223,42 @@ public class UniversalFileTransferUtility
IResource tempResource = getTempFileFor(srcFileOrFolder);
IFile tempFile = (IFile) tempResource;
-
+
boolean available = tempFileAvailable(tempFile, srcFileOrFolder);
if (available){
return tempFile;
}
-
+
try
- {
- // copy remote file to workspace
+ {
+ // copy remote file to workspace
SystemUniversalTempFileListener listener = SystemUniversalTempFileListener.getListener();
listener.addIgnoreFile(tempFile);
String remoteEncoding = srcFileOrFolder.getEncoding();
- srcFS.download(srcFileOrFolder, tempFile.getLocation().makeAbsolute().toOSString(), remoteEncoding, monitor);
- listener.removeIgnoreFile(tempFile);
- if (!tempFile.exists() && !tempFile.isSynchronized(IResource.DEPTH_ZERO))
- {
- // eclipse doesn't like this if the resource appears to be from another project
- try
- {
- //tempFile.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, monitor);
- tempFile.refreshLocal(IResource.DEPTH_ZERO, null/*monitor*/);
- }
- catch (Exception e)
- {
-
- }
- }
- if (tempFile.exists())
- {
+ srcFS.download(srcFileOrFolder, tempFile.getLocation().makeAbsolute().toOSString(), remoteEncoding, monitor);
+ listener.removeIgnoreFile(tempFile);
+ if (!tempFile.exists() && !tempFile.isSynchronized(IResource.DEPTH_ZERO))
+ {
+ // eclipse doesn't like this if the resource appears to be from another project
+ try
+ {
+ //tempFile.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, monitor);
+ tempFile.refreshLocal(IResource.DEPTH_ZERO, null/*monitor*/);
+ }
+ catch (Exception e)
+ {
+
+ }
+ }
+ if (tempFile.exists())
+ {
// if the file is virtual, set read only if necessary
// TODO: why set this here? And why for virtual only??
if (srcFileOrFolder instanceof IVirtualRemoteFile)
{
setReadOnly(tempFile, srcFileOrFolder.canWrite());
}
-
+
if (srcFileOrFolder.isText())
{
try
@@ -265,7 +270,7 @@ public class UniversalFileTransferUtility
String cset = tempFile.getCharset();
if (!cset.equals(remoteEncoding))
{
-
+
//System.out.println("charset ="+cset);
//System.out.println("tempfile ="+tempFile.getFullPath());
tempFile.setCharset(remoteEncoding, monitor);
@@ -276,7 +281,7 @@ public class UniversalFileTransferUtility
e.printStackTrace();
}
}
- }
+ }
}
catch (final SystemMessageException e)
{
@@ -295,7 +300,7 @@ public class UniversalFileTransferUtility
return (IFile) tempResource;
}
-
+
protected static void setIFileProperties(IFile tempFile, IRemoteFile remoteFile, IRemoteFileSubSystem subSystem)
{
// set it's properties for use later
@@ -311,17 +316,17 @@ public class UniversalFileTransferUtility
String subSystemId = registry.getAbsoluteNameForSubSystem(subSystem);
properties.setRemoteFileSubSystem(subSystemId);
properties.setRemoteFilePath(remotePath);
-
-
+
+
properties.setEncoding(remoteFile.getEncoding());
properties.setUsedBinaryTransfer(remoteFile.isBinary());
-
- // get the modified timestamp from the File, not the IFile
+
+ // get the modified timestamp from the File, not the IFile
// for some reason, the modified timestamp from the IFile does not always return
// the right value. There is a Javadoc comment saying the value from IFile might be a
// cached value and that might be the cause of the problem.
properties.setDownloadFileTimeStamp(tempFile.getLocation().toFile().lastModified());
-
+
boolean isMounted = isRemoteFileMounted(subSystem, remotePath);
properties.setRemoteFileMounted(isMounted);
if (isMounted)
@@ -332,7 +337,7 @@ public class UniversalFileTransferUtility
properties.setResolvedMountedRemoteFilePath(actualRemotePath);
}
}
-
+
/**
* Used for local files - special case!
* @param tempFile
@@ -355,27 +360,27 @@ public class UniversalFileTransferUtility
{
properties.setEncoding(tempFile.getCharset());
}
- catch (CoreException e){
+ catch (CoreException e){
}
-
-
- // get the modified timestamp from the File, not the IFile
+
+
+ // get the modified timestamp from the File, not the IFile
// for some reason, the modified timestamp from the IFile does not always return
// the right value. There is a Javadoc comment saying the value from IFile might be a
// cached value and that might be the cause of the problem.
properties.setDownloadFileTimeStamp(tempFile.getLocation().toFile().lastModified());
-
+
boolean isMounted = isRemoteFileMounted(hostname, remotePath, null); // no subsystem
properties.setRemoteFileMounted(isMounted);
if (isMounted)
{
- String actualRemoteHost = getActualHostFor(hostname, remotePath, null); // no subsystem
+ String actualRemoteHost = getActualHostFor(hostname, remotePath, null); // no subsystem
String actualRemotePath = getWorkspaceRemotePath(hostname, remotePath, null); // no subsystem
properties.setResolvedMountedRemoteFileHost(actualRemoteHost);
properties.setResolvedMountedRemoteFilePath(actualRemotePath);
}
}
-
+
/**
* This method downloads a set of remote resources to the workspace. It uses
* the downloadMultiple() API of the remote file subsystem and service layers so
@@ -391,32 +396,32 @@ public class UniversalFileTransferUtility
SystemWorkspaceResourceSet resultSet = new SystemWorkspaceResourceSet();
List set = remoteSet.getResourceSet();
IRemoteFileSubSystem srcFS = (IRemoteFileSubSystem)remoteSet.getSubSystem();
-
+
SystemUniversalTempFileListener listener = SystemUniversalTempFileListener.getListener();
-
-
+
+
List remoteFilesForDownload = new ArrayList();
List tempFilesForDownload = new ArrayList();
List remoteEncodingsForDownload = new ArrayList();
-
+
// step 1: pre-download processing
for (int i = 0; i < set.size() && !resultSet.hasMessage(); i++){
-
+
if (monitor != null && monitor.isCanceled())
{
return resultSet;
}
-
+
IRemoteFile srcFileOrFolder = (IRemoteFile)set.get(i);
// first check for existence
- if (!srcFileOrFolder.exists()){
+ if (!srcFileOrFolder.exists()){
String msgTxt = NLS.bind(FileResources.MSG_ERROR_FILE_NOTFOUND, srcFileOrFolder.getAbsolutePath(), srcFS.getHostAliasName());
-
- 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);
-
+
}
else
{
@@ -425,37 +430,37 @@ public class UniversalFileTransferUtility
IResource tempResource = getTempFileFor(srcFileOrFolder);
IFile tempFile = (IFile) tempResource;
-
+
boolean available = tempFileAvailable(tempFile, srcFileOrFolder);
if (available){
resultSet.addResource(tempFile);
}
- else {
+ else {
listener.addIgnoreFile(tempFile);
-
+
remoteFilesForDownload.add(srcFileOrFolder);
tempFilesForDownload.add(tempFile);
remoteEncodingsForDownload.add(srcFileOrFolder.getEncoding());
-
+
IContainer parent = tempFile.getParent();
if (broadestContainer == null || parent.contains(broadestContainer)){
broadestContainer = parent;
}
else {
if (!broadestContainer.contains(parent)) { // siblings?
- broadestContainer = broadestContainer.getParent();
+ broadestContainer = broadestContainer.getParent();
}
}
}
}
else if (srcFileOrFolder.isDirectory()) // recurse for folders and add to our consolidated resource set
- {
+ {
IResource tempFolder = getTempFileFor(srcFileOrFolder);
try
{
IRemoteFile[] children = srcFS.list(srcFileOrFolder,monitor);
-
-
+
+
SystemRemoteResourceSet childSet = new SystemRemoteResourceSet(srcFS, children);
SystemWorkspaceResourceSet childResults = downloadResourcesToWorkspaceMultiple(childSet, monitor);
if (childResults.hasMessage())
@@ -467,23 +472,23 @@ public class UniversalFileTransferUtility
catch (SystemMessageException e)
{
e.printStackTrace();
- }
+ }
}
- }
+ }
}
-
+
// step 2: downloading
IRemoteFile[] sources = (IRemoteFile[])remoteFilesForDownload.toArray(new IRemoteFile[remoteFilesForDownload.size()]);
-
+
String[] encodings = (String[])remoteEncodingsForDownload.toArray(new String[remoteEncodingsForDownload.size()]);
-
+
// destinations
String[] destinations = new String[remoteFilesForDownload.size()];
for (int t = 0; t < tempFilesForDownload.size(); t++){
destinations[t] = ((IFile)tempFilesForDownload.get(t)).getLocation().toOSString();
}
-
- if (sources.length > 0){
+
+ if (sources.length > 0){
try {
srcFS.downloadMultiple(sources, destinations, encodings, monitor);
}
@@ -491,7 +496,7 @@ public class UniversalFileTransferUtility
resultSet.setMessage(e.getSystemMessage());
}
}
-
+
// step 2.1: refresh the broadest container (keep it down to 1 big refresh)
try
{
@@ -501,15 +506,15 @@ public class UniversalFileTransferUtility
}
catch (Exception e)
{
-
+
}
-
+
// step 3: post download processing
if (!resultSet.hasMessage())
{
for (int p = 0; p < remoteFilesForDownload.size(); p++) {
-
+
IRemoteFile srcFileOrFolder = (IRemoteFile)remoteFilesForDownload.get(p);
IFile tempFile = (IFile)tempFilesForDownload.get(p);
resultSet.addResource(tempFile);
@@ -521,18 +526,18 @@ public class UniversalFileTransferUtility
long currentTime = srcFileOrFolder.getLastModified();
String storedEncoding = properties.getEncoding();
String currentEncoding = srcFileOrFolder.getEncoding();
-
+
if (storedTime != currentTime && (storedEncoding == null || !storedEncoding.equals(currentEncoding)))
{
- if (tempFile.exists())
- {
+ if (tempFile.exists())
+ {
// if the file is virtual, set read only if necessary
// TODO: why set this here? And why for virtual only??
if (srcFileOrFolder instanceof IVirtualRemoteFile)
{
setReadOnly(tempFile, srcFileOrFolder.canWrite());
}
-
+
if (srcFileOrFolder.isText())
{
try
@@ -552,32 +557,32 @@ public class UniversalFileTransferUtility
e.printStackTrace();
}
}
-
+
try
{
- setIFileProperties(tempFile, srcFileOrFolder, srcFS);
+ setIFileProperties(tempFile, srcFileOrFolder, srcFS);
}
catch (Exception e)
{
e.printStackTrace();
}
- }
+ }
}
}
}
-
+
return resultSet;
}
-
-
+
+
/**
* Replicates a set of remote files or folders to the workspace
* @param remoteSet the objects which are being copied
- * @param monitor a progress monitor
+ * @param monitor a progress monitor
* @return the temporary objects that was created after the download
*/
public static SystemWorkspaceResourceSet downloadResourcesToWorkspace(SystemRemoteResourceSet remoteSet, IProgressMonitor monitor)
- {
+ {
boolean ok = true;
SystemWorkspaceResourceSet resultSet = new SystemWorkspaceResourceSet();
IRemoteFileSubSystem srcFS = (IRemoteFileSubSystem)remoteSet.getSubSystem();
@@ -588,7 +593,7 @@ public class UniversalFileTransferUtility
}
boolean doSuperTransferProperty = doSuperTransfer(srcFS);
-
+
List set = remoteSet.getResourceSet();
for (int i = 0; i < set.size() && !resultSet.hasMessage(); i++)
{
@@ -596,18 +601,18 @@ public class UniversalFileTransferUtility
{
return resultSet;
}
-
-
+
+
IRemoteFile srcFileOrFolder = (IRemoteFile)set.get(i);
if (!srcFileOrFolder.exists())
{
String msgTxt = NLS.bind(FileResources.MSG_ERROR_FILE_NOTFOUND, srcFileOrFolder.getAbsolutePath(), srcFS.getHostAliasName());
-
- 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);
-
+
}
else
{
@@ -615,17 +620,17 @@ public class UniversalFileTransferUtility
{
IFile tempFile = downloadFileToWorkspace(srcFileOrFolder, monitor);
- resultSet.addResource(tempFile);
+ resultSet.addResource(tempFile);
}
else // folder transfer
{
IResource tempFolder = null;
-
- if (doCompressedTransfer && doSuperTransferProperty && !srcFileOrFolder.isRoot()
+
+ if (doCompressedTransfer && doSuperTransferProperty && !srcFileOrFolder.isRoot()
&& !(srcFileOrFolder.getParentRemoteFileSubSystem().getHost().getSystemType().isLocal()))
{
try
- {
+ {
tempFolder = compressedDownloadToWorkspace(srcFileOrFolder, monitor);
}
catch (Exception e)
@@ -645,8 +650,8 @@ public class UniversalFileTransferUtility
try
{
IRemoteFile[] children = srcFS.list(srcFileOrFolder,monitor);
-
-
+
+
SystemRemoteResourceSet childSet = new SystemRemoteResourceSet(srcFS, children);
SystemWorkspaceResourceSet childResults = downloadResourcesToWorkspace(childSet, monitor);
if (childResults.hasMessage())
@@ -659,20 +664,20 @@ public class UniversalFileTransferUtility
{
e.printStackTrace();
}
- }
+ }
}
}
}
-
+
// refresh and set IFile properties
for (int r = 0; r < resultSet.size(); r++)
{
IResource tempResource = (IResource)resultSet.get(r);
IRemoteFile rmtFile = (IRemoteFile)remoteSet.get(r);
-
+
if (tempResource != null && !tempResource.exists()) // need to check for null resource
- // because it's possible to be null when the download fails
+ // because it's possible to be null when the download fails
{
// refresh temp file in project
try
@@ -688,7 +693,7 @@ public class UniversalFileTransferUtility
{
try
{
- setIFileProperties((IFile)tempResource, rmtFile, srcFS);
+ setIFileProperties((IFile)tempResource, rmtFile, srcFS);
}
catch (Exception e)
{
@@ -708,13 +713,13 @@ public class UniversalFileTransferUtility
e.printStackTrace();
}
}
- */
+ */
}
-
+
return resultSet;
}
-
+
public static void discardReplicasOfDeletedFiles(IRemoteFileSubSystem ss, IContainer folder)
{
try
@@ -728,8 +733,8 @@ public class UniversalFileTransferUtility
// is this a valid replica?
SystemIFileProperties properties = new SystemIFileProperties(member);
String path = properties.getRemoteFilePath();
- if (path != null)
- {
+ if (path != null)
+ {
IRemoteFile remoteFile = null;
if (ss instanceof RemoteFileSubSystem)
{
@@ -755,24 +760,24 @@ public class UniversalFileTransferUtility
}
}
catch (Exception e)
- {
+ {
}
}
-
+
public static Object downloadResourceToWorkspace(File srcFileOrFolder, IProgressMonitor monitor) {
-
+
if (!srcFileOrFolder.exists()) {
String msgTxt = NLS.bind(FileResources.MSG_ERROR_FILE_NOTFOUND, srcFileOrFolder.getAbsolutePath(), "LOCALHOST"); //$NON-NLS-1$
- SystemMessage errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID,
- ISystemFileConstants.MSG_ERROR_FILE_NOTFOUND,
+ SystemMessage errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID,
+ ISystemFileConstants.MSG_ERROR_FILE_NOTFOUND,
IStatus.ERROR, msgTxt);
return errorMessage;
}
-
+
if (srcFileOrFolder.isFile()) {
IFile tempFile = downloadFileToWorkspace(srcFileOrFolder, monitor);
-
+
if (!tempFile.exists())
{
// refresh temp file in project
@@ -813,9 +818,9 @@ public class UniversalFileTransferUtility
return null;
}
}
-
+
/**
- * Replicates a local file to the temporary files project in the workspace.
+ * Replicates a local file to the temporary files project in the workspace.
* @param srcFileOrFolder the file to copy.
* @param monitor the progress monitor.
* @return the resulting local replica.
@@ -825,7 +830,7 @@ public class UniversalFileTransferUtility
IResource tempResource = getTempFileFor(srcFileOrFolder);
IFile tempFile = (IFile) tempResource;
-
+
// before we make the transfer to the temp file check whether a temp file already exists
if (tempFile.exists())
{
@@ -836,7 +841,7 @@ public class UniversalFileTransferUtility
// compare timestamps
if (storedModifiedStamp > 0)
{
- // if they're the same, just use temp file
+ // if they're the same, just use temp file
long remoteModifiedStamp = srcFileOrFolder.lastModified();
boolean usedBin = properties.getUsedBinaryTransfer();
@@ -847,29 +852,29 @@ public class UniversalFileTransferUtility
}
}
}
-
+
try
- {
- // copy remote file to workspace
+ {
+ // copy remote file to workspace
SystemUniversalTempFileListener listener = SystemUniversalTempFileListener.getListener();
listener.addIgnoreFile(tempFile);
String encoding = System.getProperty("file.encoding"); //$NON-NLS-1$
- download(srcFileOrFolder, tempFile, encoding, monitor);
- listener.removeIgnoreFile(tempFile);
- if (!tempFile.exists() && !tempFile.isSynchronized(IResource.DEPTH_ZERO))
- {
- // eclipse doesn't like this if the resource appears to be from another project
- try
- {
- tempFile.refreshLocal(IResource.DEPTH_ZERO, null);
- }
- catch (Exception e)
- {
-
- }
- }
- if (tempFile.exists())
- {
+ download(srcFileOrFolder, tempFile, encoding, monitor);
+ listener.removeIgnoreFile(tempFile);
+ if (!tempFile.exists() && !tempFile.isSynchronized(IResource.DEPTH_ZERO))
+ {
+ // eclipse doesn't like this if the resource appears to be from another project
+ try
+ {
+ tempFile.refreshLocal(IResource.DEPTH_ZERO, null);
+ }
+ catch (Exception e)
+ {
+
+ }
+ }
+ if (tempFile.exists())
+ {
if (RemoteFileUtility.getSystemFileTransferModeRegistry().isText(srcFileOrFolder))
{
try
@@ -889,7 +894,7 @@ public class UniversalFileTransferUtility
e.printStackTrace();
}
}
- }
+ }
}
catch (Exception e)
{
@@ -899,7 +904,7 @@ public class UniversalFileTransferUtility
return (IFile)tempResource;
}
-
+
protected static boolean download(File file, IFile tempFile, String hostEncoding, IProgressMonitor monitor) {
FileInputStream inputStream = null;
@@ -909,12 +914,12 @@ public class UniversalFileTransferUtility
OutputStreamWriter outputWriter = null;
BufferedWriter bufWriter = null;
boolean isCancelled = false;
-
+
File destinationFile = tempFile.getLocation().toFile();
-
+
try
{
-
+
if (!destinationFile.exists())
{
File parentDir = destinationFile.getParentFile();
@@ -924,17 +929,17 @@ public class UniversalFileTransferUtility
// encoding conversion required if it a text file but not an xml file
boolean isBinary = RemoteFileUtility.getSystemFileTransferModeRegistry().isBinary(file);
boolean isEncodingConversionRequired = !isBinary;
-
+
inputStream = new FileInputStream(file);
bufInputStream = new BufferedInputStream(inputStream);
outputStream = new FileOutputStream(destinationFile);
-
- if (isEncodingConversionRequired)
+
+ if (isEncodingConversionRequired)
{
outputWriter = new OutputStreamWriter(outputStream, hostEncoding);
- bufWriter = new BufferedWriter(outputWriter);
+ bufWriter = new BufferedWriter(outputWriter);
}
- else
+ else
{
bufOutputStream = new BufferedOutputStream(outputStream);
}
@@ -944,9 +949,9 @@ public class UniversalFileTransferUtility
long totalSize = file.length();
int totalRead = 0;
- while (totalRead < totalSize && !isCancelled)
+ while (totalRead < totalSize && !isCancelled)
{
-
+
int available = bufInputStream.available();
available = (available < 512000) ? available : 512000;
@@ -955,25 +960,25 @@ public class UniversalFileTransferUtility
if (bytesRead == -1) {
break;
}
-
+
// need to convert encoding, i.e. text file, but not xml
// ensure we read in file using the encoding for the file system
// which can be specified by user as text file encoding in preferences
- if (isEncodingConversionRequired)
+ if (isEncodingConversionRequired)
{
String s = new String(buffer, 0, bytesRead, hostEncoding);
if (bufWriter != null)
bufWriter.write(s);
}
- else
+ else
{
if (bufOutputStream != null)
- bufOutputStream.write(buffer, 0, bytesRead);
+ bufOutputStream.write(buffer, 0, bytesRead);
}
totalRead += bytesRead;
-
- if (monitor != null)
+
+ if (monitor != null)
{
monitor.worked(bytesRead);
isCancelled = monitor.isCanceled();
@@ -1012,7 +1017,7 @@ public class UniversalFileTransferUtility
}
else if (destinationFile != null && file.exists()) {
destinationFile.setLastModified(file.lastModified());
-
+
if (destinationFile.length() != file.length()) {
return false;
}
@@ -1022,14 +1027,14 @@ public class UniversalFileTransferUtility
{
}
}
-
+
return true;
}
/**
* Replicates a remote file or folder to the workspace
* @param srcFileOrFolder the object which is being copied
- * @param monitor a progress monitor
+ * @param monitor a progress monitor
* @return the temporary object that was created after the download
*/
public static Object downloadResourceToWorkspace(IRemoteFile srcFileOrFolder, IProgressMonitor monitor)
@@ -1046,8 +1051,8 @@ public class UniversalFileTransferUtility
if (!srcFileOrFolder.exists())
{
String msgTxt = NLS.bind(FileResources.MSG_ERROR_FILE_NOTFOUND, srcFileOrFolder.getAbsolutePath(), srcFS.getHostAliasName());
-
- SystemMessage errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID,
+
+ SystemMessage errorMessage = new SimpleSystemMessage(Activator.PLUGIN_ID,
ISystemFileConstants.MSG_ERROR_FILE_NOTFOUND,
IStatus.ERROR, msgTxt);
return errorMessage;
@@ -1083,7 +1088,7 @@ public class UniversalFileTransferUtility
{
try
{
- setIFileProperties(tempFile, srcFileOrFolder, srcFS);
+ setIFileProperties(tempFile, srcFileOrFolder, srcFS);
}
catch (Exception e)
{
@@ -1096,14 +1101,14 @@ public class UniversalFileTransferUtility
else
{
IResource tempFolder = null;
-
+
boolean doSuperTransferProperty = doSuperTransfer(srcFileOrFolder.getParentRemoteFileSubSystem());
-
- if (doCompressedTransfer && doSuperTransferProperty && !srcFileOrFolder.isRoot()
+
+ if (doCompressedTransfer && doSuperTransferProperty && !srcFileOrFolder.isRoot()
&& !(srcFileOrFolder.getParentRemoteFileSubSystem().getHost().getSystemType().isLocal()))
{
try
- {
+ {
tempFolder = compressedDownloadToWorkspace(srcFileOrFolder, monitor);
}
catch (Exception e)
@@ -1130,16 +1135,16 @@ public class UniversalFileTransferUtility
e.printStackTrace();
}
IResource[] childResources = null;
-
+
if (children != null)
{
childResources = new IResource[children.length];
- if (children.length == 0)
+ if (children.length == 0)
{
File tempFolderFile = tempFolder.getLocation().toFile();
tempFolderFile.mkdirs();
}
-
+
for (int i = 0; i < children.length && ok; i++)
{
IRemoteFile child = children[i];
@@ -1163,18 +1168,18 @@ public class UniversalFileTransferUtility
childResources[i] = childResource;
}
}
-
+
if (ok)
{
refreshResourceInWorkspace(tempFolder);
-
+
// set properties of files
if (tempFolder.exists() && children != null && childResources != null)
{
for (int i = 0; i < childResources.length; i++)
{
IResource tempFile = childResources[i];
-
+
if (tempFile.exists() && tempFile instanceof IFile)
{
IRemoteFile child = children[i];
@@ -1182,7 +1187,7 @@ public class UniversalFileTransferUtility
}
}
}
-
+
return tempFolder;
}
}
@@ -1220,13 +1225,13 @@ public class UniversalFileTransferUtility
* @param targetFolder the object to be copied to.
* @param monitor the progress monitor
* @return the resulting remote object
- */
+ */
public static Object uploadResourceFromWorkspace(IResource srcFileOrFolder, IRemoteFile targetFolder, IProgressMonitor monitor)
{
return uploadResourceFromWorkspace(srcFileOrFolder, targetFolder, monitor, true);
}
-
-/**
+
+ /**
* Perform a copy via drag and drop.
* @param workspaceSet the objects to be copied. If the target and sources are not on the same system, then this is a
* temporary object produced by the doDrag.
@@ -1236,14 +1241,14 @@ public class UniversalFileTransferUtility
* @return the resulting remote objects
*/
public static SystemRemoteResourceSet uploadResourcesFromWorkspace(SystemWorkspaceResourceSet workspaceSet, IRemoteFile targetFolder, IProgressMonitor monitor, boolean checkForCollisions)
- {
-
-
+ {
+
+
IRemoteFileSubSystem targetFS = targetFolder.getParentRemoteFileSubSystem();
-
+
boolean doSuperTransferPreference = doSuperTransfer(targetFS);
SystemRemoteResourceSet resultSet = new SystemRemoteResourceSet(targetFS);
-
+
if (targetFolder.isStale())
{
try
@@ -1260,7 +1265,7 @@ public class UniversalFileTransferUtility
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);
@@ -1282,9 +1287,9 @@ public class UniversalFileTransferUtility
}
else if (isTargetVirtual)
{
- //if the target is a virtual folder, we need to append ArchiveHandlerManager.VIRTUAL_FOLDER_SEPARATOR
- //instead of the file separator of the file subsystem.
- newPathBuf.append(ArchiveHandlerManager.VIRTUAL_FOLDER_SEPARATOR);
+ //if the target is a virtual folder, we need to append ArchiveHandlerManager.VIRTUAL_FOLDER_SEPARATOR
+ //instead of the file separator of the file subsystem.
+ newPathBuf.append(ArchiveHandlerManager.VIRTUAL_FOLDER_SEPARATOR);
}
else
{
@@ -1297,8 +1302,8 @@ public class UniversalFileTransferUtility
List resources = workspaceSet.getResourceSet();
List newFilePathList = new ArrayList();
-
-
+
+
// query what we're going to create
for (int n = 0; n < resources.size(); n++)
{
@@ -1318,13 +1323,13 @@ public class UniversalFileTransferUtility
e.printStackTrace();
}
-
+
// clear the list so that next time we use renamed names
newFilePathList.clear();
//List toCopyNames = new ArrayList(); //was used for rename operation (no longer needed)
List copyFilesOrFolders = new ArrayList();
List existingFilesOrFolders = new ArrayList();
-
+
for (int i = 0; i < resources.size() && !resultSet.hasMessage(); i++)
{
if (monitor != null && monitor.isCanceled())
@@ -1344,11 +1349,11 @@ public class UniversalFileTransferUtility
}
return resultSet;
}
-
-
- IResource srcFileOrFolder = (IResource)resources.get(i);
+
+
+ IResource srcFileOrFolder = (IResource)resources.get(i);
String name = srcFileOrFolder.getName();
-
+
if (srcFileOrFolder instanceof IFile)
{
String oldPath = newPathBuf.toString() + name;
@@ -1357,21 +1362,21 @@ public class UniversalFileTransferUtility
if(existingFiles!=null)
{
if(checkForCollision(existingFiles, targetFolder, oldPath))
- {
+ {
existingFilesOrFolders.add(existingFiles.get(oldPath));
}
}
//below code is used for renaming operation, which is no longer needed
/*int severity = status.getSeverity();
-
+
if (severity == IStatus.OK) {
name = status.getMessage();
toCopyNames.add(name);
}
else if (severity == IStatus.CANCEL) {
-
+
int code = status.getCode();
-
+
if (code == IStatus.CANCEL) {
continue;
}
@@ -1382,7 +1387,7 @@ public class UniversalFileTransferUtility
}
copyFilesOrFolders.add(srcFileOrFolder);
}
-
+
else if (srcFileOrFolder instanceof IContainer)
{
String oldPath = newPathBuf.toString() + name;
@@ -1391,7 +1396,7 @@ public class UniversalFileTransferUtility
if(existingFiles!=null)
{
if(checkForCollision(existingFiles, targetFolder, oldPath))
- {
+ {
existingFilesOrFolders.add(existingFiles.get(oldPath));
}
}
@@ -1399,15 +1404,15 @@ public class UniversalFileTransferUtility
/*
RenameStatus status = checkForCollision(existingFiles, targetFolder, name, oldPath, toCopyNames);
int severity = status.getSeverity();
-
+
if (severity == IStatus.OK) {
name = status.getMessage();
toCopyNames.add(name);
}
else if (severity == IStatus.CANCEL) {
-
+
int code = status.getCode();
-
+
if (code == IStatus.CANCEL) {
continue;
}
@@ -1415,8 +1420,8 @@ public class UniversalFileTransferUtility
break;
}
}
- */
-
+ */
+
}
copyFilesOrFolders.add(srcFileOrFolder);
}
@@ -1432,12 +1437,12 @@ public class UniversalFileTransferUtility
{
for (int i = 0; i < copyFilesOrFolders.size() && !resultSet.hasMessage(); i++)
{
-
- IResource srcFileOrFolder = (IResource)copyFilesOrFolders.get(i);
+
+ IResource srcFileOrFolder = (IResource)copyFilesOrFolders.get(i);
String name = srcFileOrFolder.getName();
String newPath = newPathBuf.toString() + name;
-
+
if (srcFileOrFolder instanceof IFile)
{
try
@@ -1458,7 +1463,7 @@ public class UniversalFileTransferUtility
String srcFileLocation = srcFileOrFolder.getLocation().toOSString();
- targetFS.upload(srcFileLocation, srcCharSet, newPath, targetFS.getRemoteEncoding(),monitor);
+ targetFS.upload(srcFileLocation, srcCharSet, newPath, targetFS.getRemoteEncoding(),monitor);
newFilePathList.add(newPath);
// should check preference first
@@ -1494,49 +1499,49 @@ public class UniversalFileTransferUtility
}
catch (Exception e)
{
-
+
}
}
try
{
if (existingFiles != null)
{
- IRemoteFile newTargetFolder = (IRemoteFile)existingFiles.get(newPath);
- // newTargetFolder will be null if user chose to do a rename
- if (newTargetFolder == null) {
- newTargetFolder = targetFS.getRemoteFileObject(newPath, monitor);
- }
- if (newTargetFolder != null && !newTargetFolder.exists())
- {
- newTargetFolder = targetFS.createFolder(newTargetFolder, monitor);
- }
-
- boolean isTargetLocal = newTargetFolder.getParentRemoteFileSubSystem().getHost().getSystemType().isLocal();
- boolean destInArchive = (newTargetFolder instanceof IVirtualRemoteFile) || newTargetFolder.isArchive();
-
- if (doCompressedTransfer && doSuperTransferPreference && !destInArchive && !isTargetLocal)
- {
- compressedUploadFromWorkspace(directory, newTargetFolder, monitor);
- }
- else
- {
- //sometimes, IContainer#members does not return the right members under
- //this folder. We need to call refreshLocal() first to overcome this problem
- directory.refreshLocal(IResource.DEPTH_ONE, monitor);
- IResource[] children = directory.members();
- SystemWorkspaceResourceSet childSet = new SystemWorkspaceResourceSet(children);
- SystemRemoteResourceSet childResults = uploadResourcesFromWorkspace(childSet, newTargetFolder, monitor, false);
- if (childResults == null)
- {
- return null;
- }
- if (childResults.hasMessage())
- {
- resultSet.setMessage(childResults.getMessage());
+ IRemoteFile newTargetFolder = (IRemoteFile)existingFiles.get(newPath);
+ // newTargetFolder will be null if user chose to do a rename
+ if (newTargetFolder == null) {
+ newTargetFolder = targetFS.getRemoteFileObject(newPath, monitor);
}
- }
-
- newFilePathList.add(newPath);
+ if (newTargetFolder != null && !newTargetFolder.exists())
+ {
+ newTargetFolder = targetFS.createFolder(newTargetFolder, monitor);
+ }
+
+ boolean isTargetLocal = newTargetFolder.getParentRemoteFileSubSystem().getHost().getSystemType().isLocal();
+ boolean destInArchive = (newTargetFolder instanceof IVirtualRemoteFile) || newTargetFolder.isArchive();
+
+ if (doCompressedTransfer && doSuperTransferPreference && !destInArchive && !isTargetLocal)
+ {
+ compressedUploadFromWorkspace(directory, newTargetFolder, monitor);
+ }
+ else
+ {
+ //sometimes, IContainer#members does not return the right members under
+ //this folder. We need to call refreshLocal() first to overcome this problem
+ directory.refreshLocal(IResource.DEPTH_ONE, monitor);
+ IResource[] children = directory.members();
+ SystemWorkspaceResourceSet childSet = new SystemWorkspaceResourceSet(children);
+ SystemRemoteResourceSet childResults = uploadResourcesFromWorkspace(childSet, newTargetFolder, monitor, false);
+ if (childResults == null)
+ {
+ return null;
+ }
+ if (childResults.hasMessage())
+ {
+ resultSet.setMessage(childResults.getMessage());
+ }
+ }
+
+ newFilePathList.add(newPath);
}
}
catch (SystemMessageException e)
@@ -1554,7 +1559,7 @@ public class UniversalFileTransferUtility
}
}
}
-
+
try
{
IRemoteFile[] results = targetFS.getRemoteFileObjects((String[])newFilePathList.toArray(new String[newFilePathList.size()]), monitor);
@@ -1568,9 +1573,9 @@ public class UniversalFileTransferUtility
{
e.printStackTrace();
}
- return resultSet;
+ return resultSet;
}
-
+
/**
* Perform a copy via drag and drop.
* @param srcFileOrFolder the object to be copied. If the target and source are not on the same system, then this is a
@@ -1601,7 +1606,7 @@ public class UniversalFileTransferUtility
{
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);
return errorMsg;
@@ -1615,10 +1620,10 @@ public class UniversalFileTransferUtility
/*
SystemMessage copyMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPY_PROGRESS);
copyMessage.makeSubstitution(srcFileOrFolder.getName(), targetFolder.getAbsolutePath());
- */
-
+ */
+
String name = srcFileOrFolder.getName();
-
+
if (srcFileOrFolder instanceof IFile)
{
if (checkForCollisions)
@@ -1647,9 +1652,9 @@ public class UniversalFileTransferUtility
try
{
-
+
String srcCharSet = null;
-
+
boolean isText = RemoteFileUtility.getSystemFileTransferModeRegistry().isText(newPath);
if (isText)
{
@@ -1684,31 +1689,31 @@ public class UniversalFileTransferUtility
}
}
catch (Exception e)
- {
+ {
}
-
+
}
}
else
{
// just copy using local location
- String srcFileLocation = location.toOSString();
- targetFS.upload(srcFileLocation, srcCharSet, newPath, targetFS.getRemoteEncoding(), monitor);
+ String srcFileLocation = location.toOSString();
+ targetFS.upload(srcFileLocation, srcCharSet, newPath, targetFS.getRemoteEncoding(), monitor);
}
-
+
copiedFile = targetFS.getRemoteFileObject(targetFolder, name, monitor);
-
+
// should check preference first
-
+
if (RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.PRESERVETIMESTAMPS))
{
SystemIFileProperties properties = new SystemIFileProperties(srcFileOrFolder);
targetFS.setLastModified(copiedFile, properties.getRemoteFileTimeStamp(), monitor);
}
-
+
return copiedFile;
}
-
+
catch (RemoteFileIOException e)
{
return e.getSystemMessage();
@@ -1757,7 +1762,7 @@ public class UniversalFileTransferUtility
newTargetFolder = targetFS.getRemoteFileObject(newPath, monitor);
}
-
+
if (!directory.isSynchronized(IResource.DEPTH_ONE))
{
try
@@ -1769,14 +1774,14 @@ public class UniversalFileTransferUtility
e.printStackTrace();
}
}
-
-
+
+
boolean isTargetLocal = newTargetFolder.getParentRemoteFileSubSystem().getHost().getSystemType().isLocal();
boolean destInArchive = (newTargetFolder instanceof IVirtualRemoteFile) || newTargetFolder.isArchive();
boolean doSuperTransferPreference = doSuperTransfer(targetFS);
if (doCompressedTransfer && doSuperTransferPreference && !destInArchive && !isTargetLocal)
{
- compressedUploadFromWorkspace(directory, newTargetFolder, monitor);
+ compressedUploadFromWorkspace(directory, newTargetFolder, monitor);
}
else
{
@@ -1796,9 +1801,9 @@ public class UniversalFileTransferUtility
}
}
}
- }
+ }
return newTargetFolder;
-
+
}
catch (SystemMessageException e)
{
@@ -1830,7 +1835,7 @@ public class UniversalFileTransferUtility
String newPath = null;
IRemoteFileSubSystem targetFS = null;
IRemoteFile remoteArchive = null;
-
+
try
{
monitor.beginTask(FileResources.RESID_SUPERTRANSFER_PROGMON_MAIN,IProgressMonitor.UNKNOWN);
@@ -1839,14 +1844,14 @@ public class UniversalFileTransferUtility
FileServiceSubSystem localSS = (FileServiceSubSystem)getLocalFileSubSystem();
try
{
- localSS.delete(destinationArchive, monitor);
+ localSS.delete(destinationArchive, monitor);
}
catch (Exception e)
{
-
+
}
localSS.createFile(destinationArchive, monitor);
-
+
if (destinationArchive == null)
{
return;
@@ -1854,31 +1859,31 @@ public class UniversalFileTransferUtility
if (!destinationArchive.isArchive())
{
return;
- }
+ }
IRemoteFile newTargetParent = newTargetFolder.getParentRemoteFile();
monitor.subTask(FileResources.RESID_SUPERTRANSFER_PROGMON_SUBTASK_POPULATE);
IRemoteFile sourceDir = localSS.getRemoteFileObject(directory.getLocation().toOSString(), monitor);
targetFS = newTargetFolder.getParentRemoteFileSubSystem();
-
-
- // FIXME
+
+
+ // FIXME
//localSS.copyToArchiveWithEncoding(sourceDir, destinationArchive, sourceDir.getName(), targetFS.getRemoteEncoding(), monitor);
localSS.copy(sourceDir, destinationArchive, sourceDir.getName(), monitor);
-
+
monitor.subTask(FileResources.RESID_SUPERTRANSFER_PROGMON_SUBTASK_TRANSFER);
newPath = newTargetParent.getAbsolutePath() + targetFS.getSeparator() + destinationArchive.getName();
-
+
// copy local zip to remote
targetFS.upload(destinationArchive.getAbsolutePath(), SystemEncodingUtil.ENCODING_UTF_8, newPath, System.getProperty("file.encoding"), monitor); //$NON-NLS-1$
remoteArchive = targetFS.getRemoteFileObject(newPath, monitor);
-
+
monitor.subTask(FileResources.RESID_SUPERTRANSFER_PROGMON_SUBTASK_EXTRACT);
String compressedFolderPath = newPath + ArchiveHandlerManager.VIRTUAL_SEPARATOR + directory.getName();
IRemoteFile compressedFolder = targetFS.getRemoteFileObject(compressedFolderPath, monitor);
-
+
// extract the compressed folder from the temp archive on remote
targetFS.copy(compressedFolder, newTargetParent, newTargetFolder.getName(), monitor);
-
+
}
catch (SystemMessageException e)
{
@@ -1891,22 +1896,22 @@ public class UniversalFileTransferUtility
targetFS.delete(newTargetFolder, null);
}
}
- throw e;
+ throw e;
//SystemMessageDialog.displayMessage(e);
}
catch (Exception e)
{
- e.printStackTrace();
+ e.printStackTrace();
throw e;
}
finally {
if (newPath == null) cleanup(destinationArchive, null);
else cleanup(destinationArchive, new File(newPath));
-
+
// delete the temp remote archive
// now, DStoreFileService#getFile() (which is invoked by getRemoteFileObject() call)
// has been updated to also put the query object into the dstore file map,
- // we don't need to do the query on the remoteArchive object before the
+ // we don't need to do the query on the remoteArchive object before the
// delete.
if (remoteArchive != null && remoteArchive.exists())
{
@@ -1915,7 +1920,7 @@ public class UniversalFileTransferUtility
monitor.done();
}
}
-
+
protected static void setReadOnly(IFile file, boolean flag)
{
ResourceAttributes attrs = file.getResourceAttributes();
@@ -1925,7 +1930,7 @@ public class UniversalFileTransferUtility
file.setResourceAttributes(attrs);
}
catch (CoreException e)
- {
+ {
}
}
public static void transferProperties(IResource source, IRemoteFile target, IProgressMonitor monitor) throws CoreException, RemoteFileSecurityException, RemoteFileIOException, SystemMessageException
@@ -1959,7 +1964,7 @@ public class UniversalFileTransferUtility
protected static String getArchiveExtensionFromProperties()
{
-
+
IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
String archiveType = store.getString(ISystemFilePreferencesConstants.SUPERTRANSFER_ARC_TYPE);
if (archiveType == null || !ArchiveHandlerManager.getInstance().isRegisteredArchive("test." + archiveType)) //$NON-NLS-1$
@@ -1973,7 +1978,7 @@ public class UniversalFileTransferUtility
//String archiveType = ".zip";
return archiveType;
}
-
+
public static IResource compressedDownloadToWorkspace(IRemoteFile directory, IProgressMonitor monitor) throws Exception
{
if (!directory.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement()) return null;
@@ -1992,36 +1997,36 @@ public class UniversalFileTransferUtility
IRemoteFile destinationParent = directory.getParentRemoteFile();
if (!destinationParent.getAbsolutePath().endsWith(directory.getSeparator()))
separator = directory.getSeparator();
-
-
+
+
if (destinationParent.canWrite())
{
try
{
- String destArchPath = destinationParent.getAbsolutePath() + separator + file.getName();
+ String destArchPath = destinationParent.getAbsolutePath() + separator + file.getName();
destinationArchive = directory.getParentRemoteFileSubSystem().getRemoteFileObject(destArchPath, monitor);
- if (destinationArchive.exists())
+ if (destinationArchive.exists())
{
- directory.getParentRemoteFileSubSystem().delete(destinationArchive, monitor);
+ directory.getParentRemoteFileSubSystem().delete(destinationArchive, monitor);
}
directory.getParentRemoteFileSubSystem().createFile(destinationArchive, monitor);
}
catch (RemoteFileSecurityException e)
{
- // can't write to this directory
+ // can't write to this directory
}
}
if (destinationArchive == null)
{
- String homeFolder = directory.getParentRemoteFileSubSystem().getRemoteFileObject("./", monitor).getAbsolutePath(); //$NON-NLS-1$
- String destArchPath = homeFolder + separator + file.getName();
+ String homeFolder = directory.getParentRemoteFileSubSystem().getRemoteFileObject("./", monitor).getAbsolutePath(); //$NON-NLS-1$
+ String destArchPath = homeFolder + separator + file.getName();
destinationArchive = directory.getParentRemoteFileSubSystem().getRemoteFileObject(destArchPath, monitor);
if (destinationArchive.exists()) directory.getParentRemoteFileSubSystem().delete(destinationArchive,monitor);
destinationArchive = directory.getParentRemoteFileSubSystem().createFile(destinationArchive, monitor);
}
-
+
targetResource = getTempFileFor(directory);
-
+
if (destinationArchive == null)
{
return null;
@@ -2030,11 +2035,11 @@ public class UniversalFileTransferUtility
{
return null;
}
-
+
monitor.subTask(FileResources.RESID_SUPERTRANSFER_PROGMON_SUBTASK_POPULATE);
IRemoteFileSubSystem sourceFS = directory.getParentRemoteFileSubSystem();
IRemoteFile sourceDir = sourceFS.getRemoteFileObject(directory.getAbsolutePath(), monitor);
-
+
// DKM - copy src dir to remote temp archive
try
{
@@ -2049,35 +2054,35 @@ public class UniversalFileTransferUtility
}
}
destinationArchive.markStale(true);
-
+
// reget it so that it's properties (namely "size") are correct
cpdest = destinationArchive = destinationArchive.getParentRemoteFileSubSystem().getRemoteFileObject(destinationArchive.getAbsolutePath(), monitor);
-
+
monitor.subTask(FileResources.RESID_SUPERTRANSFER_PROGMON_SUBTASK_TRANSFER);
String name = destinationArchive.getName();
-
+
// DKM - use parent folder as dest
dest = new File(targetResource.getParent().getLocation().toOSString() + File.separator + name);
sourceFS.download(cpdest, dest.getAbsolutePath(), System.getProperty("file.encoding"), monitor); //$NON-NLS-1$
-
-
+
+
ISystemArchiveHandler handler = ArchiveHandlerManager.getInstance().getRegisteredHandler(dest);
-
+
VirtualChild[] arcContents = handler.getVirtualChildrenList(null);
monitor.beginTask(FileResources.RESID_SUPERTRANSFER_PROGMON_SUBTASK_EXTRACT, arcContents.length);
-
+
for (int i = 0; i < arcContents.length; i++)
{
if (arcContents[i].isDirectory && handler.getVirtualChildren(arcContents[i].fullName, null) == null) continue;
String currentTargetPath = targetResource.getParent().getLocation().toOSString() + localSS.getSeparator() + useLocalSeparator(arcContents[i].fullName);
IRemoteFile currentTarget = localSS.getRemoteFileObject(currentTargetPath, monitor);
boolean replace = false;
-
+
if (currentTarget != null && currentTarget.exists())
{
IResource currentTargetResource = SystemBasePlugin.getWorkspaceRoot().getContainerForLocation(new Path(currentTarget.getAbsolutePath()));
SystemIFileProperties properties = new SystemIFileProperties(currentTargetResource);
-
+
if (properties.getRemoteFileTimeStamp() != arcContents[i].getTimeStamp())
{
replace = true;
@@ -2087,66 +2092,66 @@ public class UniversalFileTransferUtility
{
replace = true;
}
-
+
if (replace)
{
-
- if (!monitor.isCanceled())
- {
+
+ if (!monitor.isCanceled())
+ {
String currentSourcePath = dest.getAbsolutePath() + ArchiveHandlerManager.VIRTUAL_SEPARATOR + arcContents[i].fullName;
IRemoteFile currentSource = localSS.getRemoteFileObject(currentSourcePath, monitor);
boolean shouldExtract = currentSource.isFile();
-
+
if (!shouldExtract)
{
- // check for empty dir
- IRemoteFile[] children = localSS.list(currentSource, monitor);
-
- if (children == null || children.length == 0)
- {
- shouldExtract = true;
- }
+ // check for empty dir
+ IRemoteFile[] children = localSS.list(currentSource, monitor);
+
+ if (children == null || children.length == 0)
+ {
+ shouldExtract = true;
+ }
}
-
+
if (shouldExtract)
{
String msgTxt = NLS.bind(FileResources.MSG_EXTRACT_PROGRESS, currentSource.getName());
monitor.subTask(msgTxt);
-
+
boolean canWrite = true;
if (currentTarget != null)
{
- IResource currentTargetResource = SystemBasePlugin.getWorkspaceRoot().getContainerForLocation(new Path(currentTarget.getAbsolutePath()));
- if (currentTargetResource != null && currentTargetResource.exists())
- {
- try
+ IResource currentTargetResource = SystemBasePlugin.getWorkspaceRoot().getContainerForLocation(new Path(currentTarget.getAbsolutePath()));
+ if (currentTargetResource != null && currentTargetResource.exists())
{
- currentTargetResource.delete(false, monitor);
+ try
+ {
+ currentTargetResource.delete(false, monitor);
+ }
+ catch (Exception e)
+ {
+ // don't extract this one
+ canWrite = false;
+ }
}
- catch (Exception e)
- {
- // don't extract this one
- canWrite = false;
- }
- }
-
- if (canWrite)
- {
- localSS.copy(currentSource, currentTarget.getParentRemoteFile(), currentSource.getName(), monitor);
- // FIXME localSS.copyFromArchiveWithEncoding(currentSource, currentTarget.getParentRemoteFile(), currentSource.getName(), sourceEncoding, isText, monitor);
- SystemIFileProperties properties = new SystemIFileProperties(currentTargetResource);
- properties.setRemoteFileTimeStamp(arcContents[i].getTimeStamp());
- monitor.worked(1);
- }
+ if (canWrite)
+ {
+ localSS.copy(currentSource, currentTarget.getParentRemoteFile(), currentSource.getName(), monitor);
+ // FIXME localSS.copyFromArchiveWithEncoding(currentSource, currentTarget.getParentRemoteFile(), currentSource.getName(), sourceEncoding, isText, monitor);
+
+ SystemIFileProperties properties = new SystemIFileProperties(currentTargetResource);
+ properties.setRemoteFileTimeStamp(arcContents[i].getTimeStamp());
+ monitor.worked(1);
+ }
}
}
- }
- else
- {
- //return null;
- }
+ }
+ else
+ {
+ //return null;
+ }
}
}
@@ -2158,32 +2163,32 @@ public class UniversalFileTransferUtility
}
catch (Exception e)
{
- e.printStackTrace();
+ e.printStackTrace();
cleanup(cpdest, dest);
throw e;
}
-
+
cleanup(cpdest, dest);
monitor.done();
return targetResource;
}
-
+
protected static void cleanup(IRemoteFile arc1, File arc2) throws RemoteFileIOException, RemoteFileSecurityException, RemoteFolderNotEmptyException
{
if (arc1 != null)
{
- try
- {
- arc1.getParentRemoteFileSubSystem().delete(arc1, null);
- }
+ try
+ {
+ arc1.getParentRemoteFileSubSystem().delete(arc1, null);
+ }
catch (SystemMessageException e)
{
SystemMessageDialog.displayMessage(e);
}
- catch (Exception e)
- {
- e.printStackTrace();
- }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
}
if (arc2 != null && arc2.exists())
arc2.delete();
@@ -2195,34 +2200,34 @@ public class UniversalFileTransferUtility
{
return virtualPath.replace('/', getLocalFileSubSystem().getSeparatorChar());
}
-
+
/**
* Returns the corresponding temp file location for a remote file or folder
* @param srcFileOrFolder the remote file or folder
* @return the local replica location
*/
public static IResource getTempFileFor(IRemoteFile srcFileOrFolder)
- {
+ {
SystemRemoteEditManager editMgr = SystemRemoteEditManager.getInstance();
if (!editMgr.doesRemoteEditProjectExist())
{
editMgr.getRemoteEditProject();
}
-
+
//char separator = IFileConstants.PATH_SEPARATOR_CHAR_WINDOWS;
char separator = '/';
StringBuffer path = new StringBuffer(editMgr.getRemoteEditProjectLocation().makeAbsolute().toOSString());
-
- String actualHost = getActualHostFor(srcFileOrFolder.getParentRemoteFileSubSystem(), srcFileOrFolder.getAbsolutePath());
+
+ String actualHost = getActualHostFor(srcFileOrFolder.getParentRemoteFileSubSystem(), srcFileOrFolder.getAbsolutePath());
path = path.append(separator + actualHost + separator);
String absolutePath = srcFileOrFolder.getAbsolutePath();
-
+
if (srcFileOrFolder.getSystemConnection().getSystemType().isLocal())
{
absolutePath = editMgr.getWorkspacePathFor(actualHost, srcFileOrFolder.getAbsolutePath(), srcFileOrFolder.getParentRemoteFileSubSystem());
}
-
+
IPath remote = new Path(absolutePath);
absolutePath = SystemFileNameHelper.getEscapedPath(remote.toOSString());
@@ -2243,12 +2248,12 @@ public class UniversalFileTransferUtility
absolutePath = absolutePath.substring(0, colonIndex).toLowerCase() + absolutePath.substring(colonIndex + 1);
}
}
-
+
path = path.append(absolutePath);
String pathstr = normalizePath(path.toString(), srcFileOrFolder.getParentRemoteFileSubSystem().getSeparatorChar());
-
+
IPath workspacePath = getLocalPathObject(pathstr);
-
+
IResource result = null;
if (srcFileOrFolder.isDirectory())
{
@@ -2261,34 +2266,34 @@ public class UniversalFileTransferUtility
return result;
}
-
+
protected static String normalizePath(String localpath, char rmtSeparator)
{
char localSeparator = File.separatorChar;
if (localSeparator != rmtSeparator)
{
- return localpath.replace(rmtSeparator, localSeparator);
+ return localpath.replace(rmtSeparator, localSeparator);
}
return localpath;
}
-
+
/**
* Returns the corresponding temp file location for a local file or folder.
* @param srcFileOrFolder the local file or folder.
* @return the local replica location.
*/
public static IResource getTempFileFor(File srcFileOrFolder)
- {
+ {
SystemRemoteEditManager editMgr = SystemRemoteEditManager.getInstance();
if (!editMgr.doesRemoteEditProjectExist())
{
editMgr.getRemoteEditProject();
}
-
+
//char separator = IFileConstants.PATH_SEPARATOR_CHAR_WINDOWS;
char separator = '/';
StringBuffer path = new StringBuffer(editMgr.getRemoteEditProjectLocation().makeAbsolute().toOSString());
-
+
String actualHost = "LOCALHOST"; //$NON-NLS-1$
path = path.append(separator + actualHost + separator);
@@ -2312,10 +2317,10 @@ public class UniversalFileTransferUtility
absolutePath = absolutePath.substring(0, colonIndex).toLowerCase() + absolutePath.substring(colonIndex + 1);
}
}
-
+
path = path.append(absolutePath);
IPath workspacePath = getLocalPathObject(path.toString());
-
+
IResource result = null;
if (srcFileOrFolder.isDirectory())
{
@@ -2328,8 +2333,8 @@ public class UniversalFileTransferUtility
return result;
}
-
-
+
+
private static IPath getLocalPathObject(String localPath)
{
IPath actualPath = null;
@@ -2401,15 +2406,15 @@ public class UniversalFileTransferUtility
public static String getActualHostFor(IRemoteFileSubSystem subsystem, String remotePath)
{
- String hostname = subsystem.getHost().getHostName();
- if (subsystem.getHost().getSystemType().isLocal())
- {
- String result = SystemRemoteEditManager.getInstance().getActualHostFor(hostname, remotePath, subsystem);
- return result;
- }
- return hostname;
+ String hostname = subsystem.getHost().getHostName();
+ if (subsystem.getHost().getSystemType().isLocal())
+ {
+ String result = SystemRemoteEditManager.getInstance().getActualHostFor(hostname, remotePath, subsystem);
+ return result;
+ }
+ return hostname;
}
-
+
public static String getActualHostFor(String hostname, String remotePath, IRemoteFileSubSystem subsystem)
{
return SystemRemoteEditManager.getInstance().getActualHostFor(hostname, remotePath, subsystem);
@@ -2432,7 +2437,7 @@ public class UniversalFileTransferUtility
}
}
}
-
+
protected static boolean isRemoteFileMounted(ISubSystem subsystem, String remotePath)
{
String hostname = subsystem.getHost().getHostName();
@@ -2444,30 +2449,30 @@ public class UniversalFileTransferUtility
return true;
}
}
- return false;
+ return false;
}
-
+
protected static boolean isRemoteFileMounted(String hostname, String remotePath, IRemoteFileSubSystem subsystem)
{
String result = SystemRemoteEditManager.getInstance().getActualHostFor(hostname, remotePath, subsystem);
-
+
if (!result.equals(hostname)) {
return true;
}
-
- return false;
+
+ return false;
}
-
+
protected static String getWorkspaceRemotePath(IRemoteFileSubSystem subsystem, String remotePath) {
-
+
if (subsystem != null) {
return SystemRemoteEditManager.getInstance().getWorkspacePathFor(subsystem.getHost().getHostName(), remotePath, subsystem);
}
-
+
return remotePath;
}
-
- protected static String getWorkspaceRemotePath(String hostname, String remotePath, IRemoteFileSubSystem subsystem) {
+
+ protected static String getWorkspaceRemotePath(String hostname, String remotePath, IRemoteFileSubSystem subsystem) {
return SystemRemoteEditManager.getInstance().getWorkspacePathFor(hostname, remotePath, subsystem);
}
@@ -2507,30 +2512,30 @@ public class UniversalFileTransferUtility
return status;
}
-
+
protected static boolean checkForCollision(SystemRemoteResourceSet existingFiles, IRemoteFile targetFolder, String oldPath)
{
-
+
IRemoteFile targetFileOrFolder = (IRemoteFile) existingFiles.get(oldPath);
- if (targetFileOrFolder != null && targetFileOrFolder.exists())
+ if (targetFileOrFolder != null && targetFileOrFolder.exists())
return true;
else
return false;
}
-
+
public static class RenameRunnable implements Runnable
{
private IRemoteFile _targetFileOrFolder;
private String _newName;
private List _namesInUse = new ArrayList();
private int cancelStatus;
-
+
public static int RENAME_DIALOG_NOT_CANCELED = -1;
public static int RENAME_DIALOG_CANCELED = 0;
public static int RENAME_DIALOG_CANCELED_ALL = 1;
-
+
public RenameRunnable(IRemoteFile targetFileOrFolder)
{
_targetFileOrFolder = targetFileOrFolder;
@@ -2542,9 +2547,9 @@ public class UniversalFileTransferUtility
cancelStatus = RENAME_DIALOG_NOT_CANCELED;
_namesInUse=namesInUse;
}
-
+
public void run() {
- ValidatorFileUniqueName validator = null;
+ ValidatorFileUniqueName validator = null;
SystemRenameSingleDialog dlg;
if(_namesInUse!=null && _namesInUse.size()>0)
{
@@ -2555,13 +2560,13 @@ public class UniversalFileTransferUtility
dlg = new SystemRenameSingleDialog(null, true, _targetFileOrFolder, validator); // true => copy-collision-mode
}
dlg.setShowCancelAllButton(true);
-
+
dlg.open();
if (!dlg.wasCancelled() && !dlg.wasCancelledAll())
_newName = dlg.getNewName();
else {
_newName = null;
-
+
if (dlg.wasCancelledAll()) {
cancelStatus = RENAME_DIALOG_CANCELED_ALL;
}
@@ -2570,17 +2575,17 @@ public class UniversalFileTransferUtility
}
}
}
-
+
public String getNewName()
{
return _newName;
}
-
+
public int getCancelStatus() {
return cancelStatus;
}
}
-
+
protected static String checkForCollision(final IRemoteFile targetFolder, String oldName)
{
final String[] newName = new String[]{oldName};
@@ -2592,7 +2597,7 @@ public class UniversalFileTransferUtility
final 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())
{
@@ -2635,9 +2640,9 @@ public class UniversalFileTransferUtility
}
}
-
-
-
+
+
+
/**
* replicates a remote file to the temp files project in the workspace
*
@@ -2651,9 +2656,9 @@ public class UniversalFileTransferUtility
{
return downloadFileToWorkspace(srcFileOrFolder, monitor);
}
-
-
-
+
+
+
/**
* This method downloads a set of remote resources to the workspace. It uses
@@ -2670,31 +2675,31 @@ public class UniversalFileTransferUtility
{
return downloadResourcesToWorkspaceMultiple(remoteSet, monitor);
}
-
-
+
+
/**
* Replicates a set of remote files or folders to the workspace
* @param remoteSet the objects which are being copied
- * @param monitor a progress monitor
+ * @param monitor a progress monitor
* @return the temporary objects that was created after the download
*
* @deprecated use downloadResourcesToWorkspace
*/
public static SystemWorkspaceResourceSet copyRemoteResourcesToWorkspace(SystemRemoteResourceSet remoteSet, IProgressMonitor monitor)
- {
+ {
return downloadResourcesToWorkspace(remoteSet, monitor);
}
-
+
/**
*
* @deprecated use downloadResourceToWorkspace
*/
- public static Object copyRemoteResourceToWorkspace(File srcFileOrFolder, IProgressMonitor monitor) {
+ public static Object copyRemoteResourceToWorkspace(File srcFileOrFolder, IProgressMonitor monitor) {
return downloadResourceToWorkspace(srcFileOrFolder, monitor);
}
-
+
/**
- * Replicates a local file to the temp files project in the workspace.
+ * Replicates a local file to the temp files project in the workspace.
* @param srcFileOrFolder the file to copy.
* @param monitor the progress monitor.
* @return the resulting local replica.
@@ -2705,13 +2710,13 @@ public class UniversalFileTransferUtility
{
return downloadFileToWorkspace(srcFileOrFolder, monitor);
}
-
+
/**
* Replicates a remote file or folder to the workspace
* @param srcFileOrFolder the object which is being copied
- * @param monitor a progress monitor
+ * @param monitor a progress monitor
* @return the temporary object that was created after the download
*
* @deprecated use downloadResourceToWorkspace
@@ -2729,13 +2734,13 @@ public class UniversalFileTransferUtility
* @return the resulting remote object
*
* @deprecated use uploadResourceFromWorkspace
- */
+ */
public static Object copyWorkspaceResourceToRemote(IResource srcFileOrFolder, IRemoteFile targetFolder, IProgressMonitor monitor)
{
return uploadResourceFromWorkspace(srcFileOrFolder, targetFolder, monitor);
}
-
-/**
+
+ /**
* Perform a copy via drag and drop.
* @param workspaceSet the objects to be copied. If the target and sources are not on the same system, then this is a
* temporary object produced by the doDrag.
@@ -2747,10 +2752,10 @@ public class UniversalFileTransferUtility
* @deprecated use uploadResourcesFromWorkspace
*/
public static SystemRemoteResourceSet copyWorkspaceResourcesToRemote(SystemWorkspaceResourceSet workspaceSet, IRemoteFile targetFolder, IProgressMonitor monitor, boolean checkForCollisions)
- {
+ {
return uploadResourcesFromWorkspace(workspaceSet, targetFolder, monitor, checkForCollisions);
}
-
+
/**
* Perform a copy via drag and drop.
* @param srcFileOrFolder the object to be copied. If the target and source are not on the same system, then this is a
@@ -2779,7 +2784,7 @@ public class UniversalFileTransferUtility
{
compressedUploadFromWorkspace(directory, newTargetFolder, monitor);
}
-
+
/**
*
* @param directory
diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/resources/SystemRemoteMarker.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/resources/SystemRemoteMarker.java
index 3350463dcb2..1d0bdb1c1bd 100644
--- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/resources/SystemRemoteMarker.java
+++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/resources/SystemRemoteMarker.java
@@ -7,8 +7,8 @@
*
* 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:
@@ -23,18 +23,18 @@ import org.eclipse.rse.files.ui.resources.ISystemRemoteMarker;
import org.eclipse.rse.files.ui.resources.ISystemRemoteResource;
/**
- * This class is an internal implementation of the ISystemRemoteMarker interface.
- * It is not intended to be implemented by clients.
+ * This class is an internal implementation of the ISystemRemoteMarker
+ * interface.
+ *
+ * @noextend This class is not intended to be subclassed by clients.
*/
public class SystemRemoteMarker implements ISystemRemoteMarker {
-
-
/**
* Resource with which this marker is associated.
*/
protected ISystemRemoteResource resource;
-
+
/**
* The marker id.
*/
@@ -45,7 +45,7 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public SystemRemoteMarker(ISystemRemoteResource resource, long id) {
this.resource = resource;
- this.id = id;
+ this.id = id;
}
/**
@@ -54,12 +54,12 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
public void delete() {
SystemRemoteMarkerManager.getInstance().removeMarker(getResource(), getId());
}
-
+
/**
* @see org.eclipse.rse.files.ui.resources.ISystemRemoteMarker#equals(Object)
*/
public boolean equals(Object object) {
-
+
if (!(object instanceof ISystemRemoteMarker)) {
return false;
}
@@ -75,7 +75,7 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
public boolean exists() {
return getInfo() != null;
}
-
+
/**
* Get the marker info.
* @return the marker info.
@@ -89,12 +89,12 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public Object getAttribute(String attributeName) {
SystemRemoteMarkerInfo info = getInfo();
-
+
if (info == null) {
return null;
}
-
- return info.getAttribute(attributeName);
+
+ return info.getAttribute(attributeName);
}
/**
@@ -102,17 +102,17 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public int getAttribute(String attributeName, int defaultValue) {
SystemRemoteMarkerInfo info = getInfo();
-
+
if (info == null) {
return defaultValue;
}
-
+
Object value = info.getAttribute(attributeName);
-
+
if ((value != null) && (value instanceof Integer)) {
return ((Integer)value).intValue();
}
-
+
return defaultValue;
}
@@ -121,17 +121,17 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public String getAttribute(String attributeName, String defaultValue) {
SystemRemoteMarkerInfo info = getInfo();
-
+
if (info == null) {
return defaultValue;
}
-
+
Object value = info.getAttribute(attributeName);
-
+
if ((value != null) && (value instanceof String)) {
return (String)value;
}
-
+
return defaultValue;
}
@@ -140,17 +140,17 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public boolean getAttribute(String attributeName, boolean defaultValue) {
SystemRemoteMarkerInfo info = getInfo();
-
+
if (info == null) {
return defaultValue;
}
-
+
Object value = info.getAttribute(attributeName);
-
+
if ((value != null) && (value instanceof Integer)) {
return ((Boolean)value).booleanValue();
}
-
+
return defaultValue;
}
@@ -159,11 +159,11 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public Map getAttributes() {
SystemRemoteMarkerInfo info = getInfo();
-
+
if (info == null) {
return null;
}
-
+
return info.getAttributes();
}
@@ -172,11 +172,11 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public Object[] getAttributes(String[] attributeNames) {
SystemRemoteMarkerInfo info = getInfo();
-
+
if (info == null) {
return new Object[0];
}
-
+
return info.getAttributes(attributeNames);
}
@@ -185,11 +185,11 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public long getCreationTime() {
SystemRemoteMarkerInfo info = getInfo();
-
+
if (info == null) {
return -1;
}
-
+
return info.getCreationTime();
}
@@ -199,7 +199,7 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
public long getId() {
return id;
}
-
+
/**
* @see org.eclipse.rse.files.ui.resources.ISystemRemoteMarker#getResource()
*/
@@ -212,11 +212,11 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public String getType() {
SystemRemoteMarkerInfo info = getInfo();
-
+
if (info == null) {
return null;
}
-
+
return info.getType();
}
@@ -225,11 +225,11 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public boolean isSubtypeOf(String superType) {
String type = getType();
-
+
if (type == null) {
return false;
}
-
+
return SystemRemoteMarkerManager.getInstance().getCache().isSubtype(type, superType);
}
@@ -247,7 +247,7 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
SystemRemoteMarkerManager manager = SystemRemoteMarkerManager.getInstance();
SystemRemoteMarkerInfo info = getInfo();
info.setAttribute(attributeName, value);
-
+
if (manager.isPersistent(info)) {
((SystemRemoteResource)resource).getResourceInfo().set(ISystemRemoteCoreConstants.M_MARKERS_DIRTY); // need to change this
}
@@ -267,7 +267,7 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
SystemRemoteMarkerManager manager = SystemRemoteMarkerManager.getInstance();
SystemRemoteMarkerInfo info = getInfo();
info.setAttributes(attributeNames, values);
-
+
if (manager.isPersistent(info)) {
((SystemRemoteResource)resource).getResourceInfo().set(ISystemRemoteCoreConstants.M_MARKERS_DIRTY); // need to change this
}
@@ -280,7 +280,7 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
SystemRemoteMarkerManager manager = SystemRemoteMarkerManager.getInstance();
SystemRemoteMarkerInfo info = getInfo();
info.setAttributes(attributes);
-
+
if (manager.isPersistent(info)) {
((SystemRemoteResource)resource).getResourceInfo().set(ISystemRemoteCoreConstants.M_MARKERS_DIRTY); // need to change this
}
diff --git a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteExportWizard.java b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteExportWizard.java
index e9142f31a02..5b5524c43e6 100644
--- a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteExportWizard.java
+++ b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteExportWizard.java
@@ -25,25 +25,28 @@ import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
/**
- * Standard workbench wizard for exporting resources from the workspace
- * to the local file system.
+ * Standard workbench wizard for exporting resources from the workspace to the
+ * local file system.
*
- * This class may be instantiated and used without further configuration; - * this class is not intended to be subclassed. + * This class may be instantiated and used without further configuration. *
** Example: + * *
* IWizard wizard = new RemoteExportWizard(); * wizard.init(workbench, selection); * WizardDialog dialog = new WizardDialog(shell, wizard); * dialog.open(); *- * During the call to
open
, the wizard dialog is presented to the
- * user. When the user hits Finish, the user-selected workspace resources
- * are exported to the user-specified location in the local file system,
- * the dialog closes, and the call to open
returns.
+ *
+ * During the call to open
, the wizard dialog is presented to
+ * the user. When the user hits Finish, the user-selected workspace resources
+ * are exported to the user-specified location in the local file system, the
+ * dialog closes, and the call to open
returns.
*
+ *
+ * @noextend This class is not intended to be subclassed by clients.
*/
public class RemoteExportWizard extends AbstractSystemWizard implements IExportWizard {
private IStructuredSelection selection;
diff --git a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileImportOperation.java b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileImportOperation.java
index 97a39ebdcbf..323ab380c05 100644
--- a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileImportOperation.java
+++ b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteFileImportOperation.java
@@ -52,11 +52,10 @@ import org.eclipse.ui.dialogs.IOverwriteQuery;
// Similar to org.eclipse.ui.wizards.datatransfer.ImportOperation
/**
- * An operation which does the actual work of copying objects from the local file
- * system into the workspace.
- * - * This class may be instantiated; it is not intended to be subclassed. - *
+ * An operation which does the actual work of copying objects from the local + * file system into the workspace. + * + * @noextend This class is not intended to be subclassed by clients. */ public class RemoteFileImportOperation extends WorkspaceModifyOperation { private static final int POLICY_DEFAULT = 0; @@ -84,7 +83,7 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation { * Creates a new operation that recursively imports the entire contents of the * specified root file system object. *
- * The source
parameter represents the root file system object to
+ * The source
parameter represents the root file system object to
* import. All contents of this object are imported. Valid types for this parameter
* are determined by the supplied IImportStructureProvider
.
*
* The default import behavior is to recreate the complete container structure
- * for the contents of the root file system object in their destination.
- * If setCreateContainerStructure
is set to false then the container
+ * for the contents of the root file system object in their destination.
+ * If setCreateContainerStructure
is set to false then the container
* structure created is relative to the root file system object.
*
- * The source
parameter represents the root file system object to
- * import. Valid types for this parameter are determined by the supplied
+ * The source
parameter represents the root file system object to
+ * import. Valid types for this parameter are determined by the supplied
* IImportStructureProvider
. The contents of the source which
* are to be imported are specified in the filesToImport
* parameter.
@@ -138,7 +137,7 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
*
* The default import behavior is to recreate the complete container structure
* for the file system objects in their destination. If setCreateContainerStructure
- * is set to false
, then the container structure created for each of
+ * is set to false
, then the container structure created for each of
* the file system objects is relative to the supplied root file system object.
*
- * The filesToImport
parameter specifies what file system objects
+ * The filesToImport
parameter specifies what file system objects
* are to be imported.
*
* The default import behavior is to recreate the complete container structure
* for the file system objects in their destination. If setCreateContainerStructure
- * is set to false
, then no container structure is created for each of
+ * is set to false
, then no container structure is created for each of
* the file system objects.
*
true
if the resource does not exist, and
+ * @return true
if the resource does not exist, and
* false
if it does exist
*/
boolean ensureTargetDoesNotExist(IResource targetResource, int policy) {
@@ -596,7 +595,7 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
*/
boolean queryOverwrite(IPath resourcePath) throws OperationCanceledException {
String overwriteAnswer = overwriteCallback.queryOverwrite(resourcePath.makeRelative().toString());
- if (overwriteAnswer.equals(IOverwriteQuery.CANCEL)) //throw new OperationCanceledException(UniversalSystemPlugin.getString("customs.emptyString"));
+ if (overwriteAnswer.equals(IOverwriteQuery.CANCEL)) //throw new OperationCanceledException(UniversalSystemPlugin.getString("customs.emptyString"));
throw new OperationCanceledException(""); //$NON-NLS-1$
if (overwriteAnswer.equals(IOverwriteQuery.NO)) {
return false;
@@ -634,7 +633,7 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
* Sets whether imported file system objects should automatically overwrite
* existing workbench resources when a conflict occurs.
*
- * @param value true
to automatically overwrite, and
+ * @param value true
to automatically overwrite, and
* false
otherwise
*/
public void setOverwriteResources(boolean value) {
diff --git a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteImportWizard.java b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteImportWizard.java
index 39ccbac0f6b..b88b12041e2 100644
--- a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteImportWizard.java
+++ b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files/RemoteImportWizard.java
@@ -28,22 +28,25 @@ import org.eclipse.ui.IWorkbench;
* Standard workbench wizard for importing resources from the local file system
* into the workspace.
* - * This class may be instantiated and used without further configuration; - * this class is not intended to be subclassed. + * This class may be instantiated and used without further configuration. *
** Example: + * *
* IWizard wizard = new RemoteImportWizard(); * wizard.init(workbench, selection); * WizardDialog dialog = new WizardDialog(shell, wizard); * dialog.open(); *- * During the call to
open
, the wizard dialog is presented to the
- * user. When the user hits Finish, the user-selected files are imported
+ *
+ * During the call to open
, the wizard dialog is presented to
+ * the user. When the user hits Finish, the user-selected files are imported
* into the workspace, the dialog closes, and the call to open
* returns.
*
+ *
+ * @noextend This class is not intended to be subclassed by clients.
*/
public class RemoteImportWizard extends AbstractSystemWizard implements IImportWizard {
private IWorkbench workbench;
@@ -117,9 +120,9 @@ public class RemoteImportWizard extends AbstractSystemWizard implements IImportW
public boolean performFinish() {
return mainPage.finish();
}
-
- public boolean performCancel() {
- mainPage.cancel();
- return super.performCancel();
- }
+
+ public boolean performCancel() {
+ mainPage.cancel();
+ return super.performCancel();
+ }
}
diff --git a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/java/BasicClassFileParser.java b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/java/BasicClassFileParser.java
index 2ccef3aba85..63a4f130848 100644
--- a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/java/BasicClassFileParser.java
+++ b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/java/BasicClassFileParser.java
@@ -1,13 +1,13 @@
/********************************************************************************
* Copyright (c) 2004, 2007 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
+ * component that contains this file: David McKnight, Kushal Munir,
+ * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@@ -41,12 +41,13 @@ import org.eclipse.rse.internal.services.clientserver.java.StringInfo;
import org.eclipse.rse.internal.services.clientserver.java.UTF8Info;
/**
- * This is a basic class file parser that returns a package name from a class file.
+ * This is a basic class file parser that returns a package name from a class
+ * file.
*
- * This class is not intended to be subclassed by clients.
+ * @noextend This class is not intended to be subclassed by clients.
*/
public class BasicClassFileParser {
-
+
//private long magic;
//private int minor_version;
//private int major_version;
@@ -62,7 +63,7 @@ public class BasicClassFileParser {
private MethodInfo[] methods;
private int attributes_count;
private InputStream stream;
-
+
/**
* Constuctor.
* @param stream the input stream to parse.
@@ -70,104 +71,104 @@ public class BasicClassFileParser {
public BasicClassFileParser(InputStream stream) {
this.stream = stream;
}
-
+
/**
* Returns the package.
* @return the package.
*/
public String getQualifiedClassName() {
-
+
ClassInfo info = (ClassInfo)(getCPInfo(this_class));
-
+
int nameIndex = info.getNameIndex();
String name = getString(nameIndex);
-
+
return name.replace('/', '.');
}
-
+
/**
* Returns whether there is a public static void main(String[])
method.
* @return true
if there is, otherwise false
.
*/
public boolean isExecutable() {
-
+
for (int i = 0; i < methods_count; i++) {
MethodInfo info = methods[i];
-
+
// first ensure method name is "main"
int nameIndex = info.getNameIndex();
String name = getString(nameIndex);
-
+
if (name.equals("main")) { //$NON-NLS-1$
-
+
// check access flags for public and static
int accessFlags = info.getAccessFlags();
-
+
if ((accessFlags & 0x000F) == 0x0009) {
-
+
// now check descriptor for parameter and return value
int descriptorIndex = info.getDescriptorIndex();
String descriptor = getString(descriptorIndex);
-
+
if (descriptor.equals("([Ljava/lang/String;)V")) { //$NON-NLS-1$
return true;
}
}
}
}
-
+
return false;
}
-
+
/**
* Parses a class file.
* @throws IOException if an I/O error occurs.
*/
public void parse() throws IOException {
-
+
EnhancedDataInputStream dataStream = new EnhancedDataInputStream(stream);
-
+
/*magic = */ dataStream.readUnsignedInt();
/*minor_version =*/ dataStream.readUnsignedShort();
/*major_version =*/ dataStream.readUnsignedShort();
constant_pool_count = dataStream.readUnsignedShort();
-
+
readConstantPool(dataStream);
-
+
/*access_flags =*/ dataStream.readUnsignedShort();
-
+
this_class = dataStream.readUnsignedShort();
-
+
/*super_class =*/ dataStream.readUnsignedShort();
-
+
interfaces_count = dataStream.readUnsignedShort();
-
+
readInterfaces(dataStream);
-
+
fields_count = dataStream.readUnsignedShort();
-
+
readFields(dataStream);
-
+
methods_count = dataStream.readUnsignedShort();
-
+
readMethods(dataStream);
-
+
dataStream.close();
}
-
+
/**
* Reads the constant pool.
* @param dataStream the data stream.
* @throws IOException if an I/O error occurs.
*/
protected void readConstantPool(EnhancedDataInputStream dataStream) throws IOException {
-
+
constant_pool = new ArrayList();
-
+
for (int i = 0; i < constant_pool_count-1; i++) {
- AbstractCPInfo info = readConstantInfo(dataStream);
+ AbstractCPInfo info = readConstantInfo(dataStream);
constant_pool.add(i, info);
-
+
// each long or double info takes two spaces, so fill in the next entry with an empty object
// this entry is not usable according to the VM Specification
if (info instanceof LongInfo || info instanceof DoubleInfo) {
@@ -176,7 +177,7 @@ public class BasicClassFileParser {
}
}
}
-
+
/**
* Gets the constant info.
* @param dataStream the data stream.
@@ -185,68 +186,68 @@ public class BasicClassFileParser {
*/
protected AbstractCPInfo readConstantInfo(EnhancedDataInputStream dataStream) throws IOException {
short tag = (short)(dataStream.readUnsignedByte());
-
+
switch (tag) {
-
- case IClassFileConstants.CONSTANT_CLASS: {
- int nameIndex = dataStream.readUnsignedShort();
- return new ClassInfo(tag, nameIndex);
- }
- case IClassFileConstants.CONSTANT_FIELD_REF: {
- int classIndex = dataStream.readUnsignedShort();
- int nameAndTypeIndex = dataStream.readUnsignedShort();
- return new FieldRefInfo(tag, classIndex, nameAndTypeIndex);
- }
- case IClassFileConstants.CONSTANT_METHOD_REF: {
- int classIndex = dataStream.readUnsignedShort();
- int nameAndTypeIndex = dataStream.readUnsignedShort();
- return new MethodRefInfo(tag, classIndex, nameAndTypeIndex);
- }
- case IClassFileConstants.CONSTANT_INTERFACE_METHOD_REF: {
- int classIndex = dataStream.readUnsignedShort();
- int nameAndTypeIndex = dataStream.readUnsignedShort();
- return new InterfaceMethodRefInfo(tag, classIndex, nameAndTypeIndex);
- }
- case IClassFileConstants.CONSTANT_STRING: {
- int stringIndex = dataStream.readUnsignedShort();
- return new StringInfo(tag, stringIndex);
- }
- case IClassFileConstants.CONSTANT_INTEGER: {
- long bytes = dataStream.readUnsignedInt();
- return new IntegerInfo(tag, bytes);
- }
- case IClassFileConstants.CONSTANT_FLOAT: {
- long bytes = dataStream.readUnsignedInt();
- return new FloatInfo(tag, bytes);
- }
- case IClassFileConstants.CONSTANT_LONG: {
- long highBytes = dataStream.readUnsignedInt();
- long lowBytes = dataStream.readUnsignedInt();
- return new LongInfo(tag, highBytes, lowBytes);
- }
- case IClassFileConstants.CONSTANT_DOUBLE: {
- long highBytes = dataStream.readUnsignedInt();
- long lowBytes = dataStream.readUnsignedInt();
- return new DoubleInfo(tag, highBytes, lowBytes);
- }
- case IClassFileConstants.CONSTANT_NAME_AND_TYPE: {
- int nameIndex = dataStream.readUnsignedShort();
- int descriptorIndex = dataStream.readUnsignedShort();
- return new NameAndTypeInfo(tag, nameIndex, descriptorIndex);
- }
- case IClassFileConstants.CONSTANT_UTF8: {
- int length = dataStream.readUnsignedShort();
- short[] bytes = new short[length];
-
- for (int i = 0; i < length; i++) {
- bytes[i] = (short)(dataStream.readUnsignedByte());
- }
-
- return new UTF8Info(tag, length, bytes);
- }
- default: {
- return null;
+
+ case IClassFileConstants.CONSTANT_CLASS: {
+ int nameIndex = dataStream.readUnsignedShort();
+ return new ClassInfo(tag, nameIndex);
+ }
+ case IClassFileConstants.CONSTANT_FIELD_REF: {
+ int classIndex = dataStream.readUnsignedShort();
+ int nameAndTypeIndex = dataStream.readUnsignedShort();
+ return new FieldRefInfo(tag, classIndex, nameAndTypeIndex);
+ }
+ case IClassFileConstants.CONSTANT_METHOD_REF: {
+ int classIndex = dataStream.readUnsignedShort();
+ int nameAndTypeIndex = dataStream.readUnsignedShort();
+ return new MethodRefInfo(tag, classIndex, nameAndTypeIndex);
+ }
+ case IClassFileConstants.CONSTANT_INTERFACE_METHOD_REF: {
+ int classIndex = dataStream.readUnsignedShort();
+ int nameAndTypeIndex = dataStream.readUnsignedShort();
+ return new InterfaceMethodRefInfo(tag, classIndex, nameAndTypeIndex);
+ }
+ case IClassFileConstants.CONSTANT_STRING: {
+ int stringIndex = dataStream.readUnsignedShort();
+ return new StringInfo(tag, stringIndex);
+ }
+ case IClassFileConstants.CONSTANT_INTEGER: {
+ long bytes = dataStream.readUnsignedInt();
+ return new IntegerInfo(tag, bytes);
+ }
+ case IClassFileConstants.CONSTANT_FLOAT: {
+ long bytes = dataStream.readUnsignedInt();
+ return new FloatInfo(tag, bytes);
+ }
+ case IClassFileConstants.CONSTANT_LONG: {
+ long highBytes = dataStream.readUnsignedInt();
+ long lowBytes = dataStream.readUnsignedInt();
+ return new LongInfo(tag, highBytes, lowBytes);
+ }
+ case IClassFileConstants.CONSTANT_DOUBLE: {
+ long highBytes = dataStream.readUnsignedInt();
+ long lowBytes = dataStream.readUnsignedInt();
+ return new DoubleInfo(tag, highBytes, lowBytes);
+ }
+ case IClassFileConstants.CONSTANT_NAME_AND_TYPE: {
+ int nameIndex = dataStream.readUnsignedShort();
+ int descriptorIndex = dataStream.readUnsignedShort();
+ return new NameAndTypeInfo(tag, nameIndex, descriptorIndex);
+ }
+ case IClassFileConstants.CONSTANT_UTF8: {
+ int length = dataStream.readUnsignedShort();
+ short[] bytes = new short[length];
+
+ for (int i = 0; i < length; i++) {
+ bytes[i] = (short)(dataStream.readUnsignedByte());
}
+
+ return new UTF8Info(tag, length, bytes);
+ }
+ default: {
+ return null;
+ }
}
}
@@ -257,24 +258,24 @@ public class BasicClassFileParser {
*/
protected void readInterfaces(EnhancedDataInputStream dataStream) throws IOException {
interfaces = new int[interfaces_count];
-
+
for (int i = 0; i < interfaces_count; i++) {
interfaces[i] = dataStream.readUnsignedShort();
}
}
-
+
/**
* Reads the fields.
* @param dataStream the data stream.
* @throws IOException if an I/O error occurs.
*/
protected void readFields(EnhancedDataInputStream dataStream) throws IOException {
-
+
for (int i = 0; i < fields_count; i++) {
readField(dataStream);
}
}
-
+
/**
* Reads a field.
* @param dataStream the data stream.
@@ -285,47 +286,47 @@ public class BasicClassFileParser {
/*int nameIndex = */ dataStream.readUnsignedShort();
/*int descriptorIndex =*/ dataStream.readUnsignedShort();
int attributesCount = dataStream.readUnsignedShort();
-
+
for (int i = 0; i < attributesCount; i++) {
readAttribute(dataStream);
}
return null;
}
-
+
/**
* Reads the methods.
* @param dataStream the data stream.
* @throws IOException if an I/O error occurs.
*/
protected void readMethods(EnhancedDataInputStream dataStream) throws IOException {
-
+
methods = new MethodInfo[methods_count];
-
+
for (int i = 0; i < methods_count; i++) {
methods[i] = readMethod(dataStream);
}
}
-
+
/**
* Reads a method.
* @param dataStream the data stream.
* @throws IOException if an I/O error occurs.
*/
protected MethodInfo readMethod(EnhancedDataInputStream dataStream) throws IOException {
-
+
int accessFlags = dataStream.readUnsignedShort();
int nameIndex = dataStream.readUnsignedShort();
int descriptorIndex = dataStream.readUnsignedShort();
int attributesCount = dataStream.readUnsignedShort();
-
+
for (int i = 0; i < attributesCount; i++) {
readAttribute(dataStream);
}
-
+
return new MethodInfo(accessFlags, nameIndex, descriptorIndex, attributes_count, null);
}
-
+
/**
* Reads an attribute.
* @param dataStream the data stream.
@@ -334,14 +335,14 @@ public class BasicClassFileParser {
protected AbstractAttributeInfo readAttribute(EnhancedDataInputStream dataStream) throws IOException {
dataStream.skip(2);
long length = dataStream.readUnsignedInt();
-
+
if (length > 0) {
dataStream.skip(length);
}
-
+
return null;
}
-
+
/**
* Returns the entry at the constant pool index.
* @param index the index.
@@ -350,7 +351,7 @@ public class BasicClassFileParser {
protected AbstractCPInfo getCPInfo(int index) {
return (AbstractCPInfo)(constant_pool.get(index-1));
}
-
+
/**
* Returns the name given an index to the constant pool table.
* The entry at the index must be a UTF8 string entry
diff --git a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/java/ClassFileUtil.java b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/java/ClassFileUtil.java
index 2b250406fd2..33e206b78b5 100644
--- a/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/java/ClassFileUtil.java
+++ b/rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/java/ClassFileUtil.java
@@ -1,13 +1,13 @@
/********************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
+ * component that contains this file: David McKnight, Kushal Munir,
+ * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@@ -24,10 +24,10 @@ import java.io.InputStream;
/**
* Singleton class for obtaining various information about class files.
*
- * This class is not intended to be subclassed by clients.
+ * @noextend This class is not intended to be subclassed by clients.
*/
public class ClassFileUtil {
-
+
private static ClassFileUtil instance;
/**
@@ -36,20 +36,20 @@ public class ClassFileUtil {
private ClassFileUtil() {
super();
}
-
+
/**
* Returns the singleton instance.
* @return the singleton instance.
*/
public static final ClassFileUtil getInstance() {
-
+
if (instance == null) {
instance = new ClassFileUtil();
}
-
+
return instance;
}
-
+
/**
* Returns whether the class with the given path is runnable, i.e. whether it contains public
* static void main (String[])
method.
@@ -61,7 +61,7 @@ public class ClassFileUtil {
File classFile = new File(classFilePath);
return isRunnable(classFile);
}
-
+
/**
* Returns whether the class is runnable, i.e. whether it contains public
* static void main (String[])
method.
@@ -72,8 +72,8 @@ public class ClassFileUtil {
public boolean isRunnable(File classFile) throws IOException {
FileInputStream stream = new FileInputStream(classFile);
return isRunnable(stream);
- }
-
+ }
+
/**
* Returns whether the class represented by the given input stream is runnable,
* i.e. whether it contains public static void main (String[])
method.
@@ -86,7 +86,7 @@ public class ClassFileUtil {
parser.parse();
return parser.isExecutable();
}
-
+
/**
* Gets the qualified class name for the file with the given path.
* @param classFilePath the class file path.
@@ -96,7 +96,7 @@ public class ClassFileUtil {
File classFile = new File(classFilePath);
return getQualifiedClassName(classFile);
}
-
+
/**
* Gets the qualified class name.
* @param classFile the class file.
@@ -106,7 +106,7 @@ public class ClassFileUtil {
FileInputStream stream = new FileInputStream(classFile);
return getQualifiedClassName(stream);
}
-
+
/**
* Gets the qualified class name for the class represented by the given input stream.
* @param stream the input stream representing a class.
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/IFileService.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/IFileService.java
index da8caf36542..91020f33143 100644
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/IFileService.java
+++ b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/IFileService.java
@@ -37,22 +37,24 @@ import org.eclipse.rse.services.IService;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
/**
- * A IFileService is an abstraction of a file service that runs over some sort of connection.
- * It can be shared among multiple instances of a subsystem. At some point this file
- * service layer may become official API but for now it is experimental. Each
- * subsystem is currently responsible for layering an abstraction over whatever it
- * wants to construct as a service.
+ * A IFileService is an abstraction of a file service that runs over some sort
+ * of connection. It can be shared among multiple instances of a subsystem. At
+ * some point this file service layer may become official API but for now it is
+ * experimental. Each subsystem is currently responsible for layering an
+ * abstraction over whatever it wants to construct as a service.
*
- * This is a very bare bones definition. A real definition would probably have changed - * terminology, use URI's rather than Strings, and have much more robust error handling. - *
- * Implementers of this interface will have to either be instantiated, initialized, or - * somehow derive a connection as part of its state. - *
- * This interface is not intended to be implemented by clients. File service - * implementations must subclass {@link AbstractFileService} rather than implementing - * this interface directly. + * This is a very bare bones definition. A real definition would probably have + * changed terminology, use URI's rather than Strings, and have much more robust + * error handling. *
+ *+ * Implementers of this interface will have to either be instantiated, + * initialized, or somehow derive a connection as part of its state. + *
+ * @noimplement This interface is not intended to be implemented by clients. + * File service implementations must subclass + * {@link AbstractFileService} rather than implementing this + * interface directly. */ public interface IFileService extends IService { diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/model/SystemFileTransferModeMapping.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/model/SystemFileTransferModeMapping.java index 242372db605..8d2b55f5054 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/model/SystemFileTransferModeMapping.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/model/SystemFileTransferModeMapping.java @@ -7,8 +7,8 @@ * * 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: @@ -23,10 +23,13 @@ import org.eclipse.rse.subsystems.files.core.model.ISystemFileTransferModeMappin /** - * An internal class. Clients must not instantiate or subclass it. + * An internal class. + * + * @noextend This class is not intended to be subclassed by clients. + * @noinstantiate This class is not intended to be instantiated by clients. */ public class SystemFileTransferModeMapping implements ISystemFileTransferModeMapping, Cloneable { - + public static final int DEFAULT_PRIORITY = Integer.MAX_VALUE; private String name; private String extension; @@ -40,21 +43,21 @@ public class SystemFileTransferModeMapping implements ISystemFileTransferModeMap public SystemFileTransferModeMapping(String extension) { this("*", extension); //$NON-NLS-1$ } - + /** * Constructor for SystemFileTransferModeMapping. * @param name the name. If the name isnull
or if it is an empty string, it is set to *
.
* @param extension the extension. Can be null
.
*/
public SystemFileTransferModeMapping(String name, String extension) {
-
+
if ((name == null) || (name.length() < 1)) {
setName("*"); //$NON-NLS-1$
}
else {
setName(name);
}
-
+
setExtension(extension);
}
@@ -71,7 +74,7 @@ public class SystemFileTransferModeMapping implements ISystemFileTransferModeMap
* @see org.eclipse.rse.subsystems.files.core.model.ISystemFileTransferModeMapping#getLabel()
*/
public String getLabel() {
-
+
if (extension != null) {
return (name + "." + extension); //$NON-NLS-1$
}
@@ -103,35 +106,35 @@ public class SystemFileTransferModeMapping implements ISystemFileTransferModeMap
public boolean isText() {
return !isBinary();
}
-
+
/**
* Set whether transfer mode is binary
*/
public void setAsBinary() {
isBinary = true;
}
-
+
/**
* Set whether transfer mode is text
*/
public void setAsText() {
isBinary = false;
}
-
+
/**
* Set the name
*/
public void setName(String name) {
this.name = name;
}
-
+
/**
* Set the extension
*/
public void setExtension(String extension) {
this.extension = extension;
}
-
+
/**
* Set the priority - the smaller the number, the higher priority
* @param priority priority to set.
@@ -139,7 +142,7 @@ public class SystemFileTransferModeMapping implements ISystemFileTransferModeMap
public void setPriority(int priority) {
this.priority = priority;
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.rse.subsystems.files.core.model.ISystemFileTransferModeMapping#getPriority()
@@ -148,7 +151,7 @@ public class SystemFileTransferModeMapping implements ISystemFileTransferModeMap
{
return this.priority;
}
-
+
/**
* Clone this object.
*
diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/model/SystemFileTransferModeRegistry.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/model/SystemFileTransferModeRegistry.java
index 9252d945408..80d677f619c 100644
--- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/model/SystemFileTransferModeRegistry.java
+++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/model/SystemFileTransferModeRegistry.java
@@ -7,8 +7,8 @@
*
* 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:
@@ -49,17 +49,20 @@ import org.eclipse.ui.XMLMemento;
/**
- * An internal class. Clients must not instantiate or subclass it.
+ * An internal class.
+ *
+ * @noextend This class is not intended to be subclassed by clients.
+ * @noinstantiate This class is not intended to be instantiated by clients.
*/
public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRegistry {
private static SystemFileTransferModeRegistry instance;
-
+
private HashMap typeModeMappings;
-
+
private RSEUIPlugin plugin;
-
+
// Constants for reading from and writing to xml file
private static final String FILENAME = "fileTransferMode.xml"; //$NON-NLS-1$
private static final String ENCODING = SystemEncodingUtil.ENCODING_UTF_8;
@@ -70,7 +73,7 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
private static final String MODE_ATTRIBUTE = "mode"; //$NON-NLS-1$
private static final String BINARY_VALUE = "binary"; //$NON-NLS-1$
private static final String TEXT_VALUE = "text"; //$NON-NLS-1$
- private static final String PRIORITY_ATTRIBUTE = "priority"; //$NON-NLS-1$
+ private static final String PRIORITY_ATTRIBUTE = "priority"; //$NON-NLS-1$
/**
* Constructor for SystemFileTransferModeRegistry
@@ -80,20 +83,20 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
this.plugin = RSEUIPlugin.getDefault();
initialize();
}
-
-
+
+
/**
* Get the singleton instance
*/
public static SystemFileTransferModeRegistry getInstance() {
-
+
if (instance == null) {
instance = new SystemFileTransferModeRegistry();
}
-
+
return instance;
}
-
+
/**
* Delete's the existing file associations and reinitializes with defaults
*/
@@ -102,16 +105,16 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
deleteAssociations();
initialize();
}
-
+
/**
* Initialize the registry from storage.
*/
private void initialize() {
-
+
// load our current associations (if any)
loadAssociations();
-
-
+
+
// get reference to the extension registry
IExtensionRegistry extRegistry = Platform.getExtensionRegistry();
@@ -131,9 +134,9 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
String type = element.getAttribute("type"); //$NON-NLS-1$
if (type != null && !type.equals("")) { //$NON-NLS-1$
-
+
SystemFileTransferModeMapping mapping = new SystemFileTransferModeMapping(extension);
-
+
// add extension to list of text types
if (type.equalsIgnoreCase("text")) { //$NON-NLS-1$
mapping.setAsText();
@@ -142,7 +145,7 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
if (type.equalsIgnoreCase("binary")) { //$NON-NLS-1$
mapping.setAsBinary();
}
-
+
int priority = SystemFileTransferModeMapping.DEFAULT_PRIORITY;
String priorityStr = element.getAttribute("priority"); //$NON-NLS-1$
try
@@ -152,10 +155,10 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
}
}
catch (Exception e)
- {
+ {
}
mapping.setPriority(priority);
-
+
String key = getMappingKey(mapping);
if (!typeModeMappings.containsKey(key)){
typeModeMappings.put(key, mapping);
@@ -164,7 +167,7 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
SystemFileTransferModeMapping existingMapping = (SystemFileTransferModeMapping)typeModeMappings.get(key);
int existingPriority = existingMapping.getPriority();
if (priority < existingPriority){
-
+
// change properties of existing mapping to that of new priority
if (mapping.isBinary() && existingMapping.isText()){
existingMapping.setAsBinary();
@@ -172,19 +175,19 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
else if (mapping.isText() && existingMapping.isBinary()){
existingMapping.setAsText();
}
-
+
existingMapping.setPriority(priority);
}
}
}
-
+
}
else {
continue;
}
- }
+ }
}
-
+
/**
* @see ISystemFileTransferModeRegistry#getModeMappings()
*/
@@ -194,8 +197,8 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
sortedMappings.toArray(array);
return array;
}
-
-
+
+
/**
* The mappings are kept in a hash map for fast lookup. Sorting is
* typically only needed for certain dialogs/choices etc.
@@ -213,23 +216,23 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
List result = new ArrayList(s);
return result;
}
-
-
+
+
/**
* Sets new mode mappings
*/
public void setModeMappings(SystemFileTransferModeMapping[] newMappings) {
typeModeMappings = new HashMap();
-
+
for (int i = 0; i < newMappings.length; i++) {
SystemFileTransferModeMapping mapping = newMappings[i];
typeModeMappings.put(getMappingKey(mapping), mapping);
}
}
-
-
+
+
/**
- * Return a key given the mapping
+ * Return a key given the mapping
*/
private String getMappingKey(ISystemFileTransferModeMapping mapping) {
return mapping.getLabel().toLowerCase();
@@ -297,26 +300,26 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
*/
public boolean isText(IRemoteFile remoteFile) {
return isText(remoteFile.getName());
- }
-
-
+ }
+
+
/**
* Get the mode mapping given a file name
*/
private SystemFileTransferModeMapping getMapping(String fileName) {
SystemFileTransferModeMapping mapping = (SystemFileTransferModeMapping)(typeModeMappings.get(fileName.toLowerCase()));
-
+
if (mapping == null) {
mapping = createMappingFromModeMappings(fileName);
}
-
+
if (mapping == null) {
return getDefaultMapping(fileName);
}
-
+
return mapping;
- }
-
+ }
+
private SystemFileTransferModeMapping createMappingFromModeMappings(String fileName)
{
// get file extension
@@ -325,7 +328,7 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
String name = null;
String extension = null;
-
+
// if there is no extension
if ((extIndex == -1) || (extIndex == (fileName.length() - 1))) {
name = fileName;
@@ -333,45 +336,45 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
else {
name = fileName.substring(0, extIndex);
extension = fileName.substring(extIndex + 1);
- }
-
+ }
+
// check if the name and extension combination exists already
SystemFileTransferModeMapping mapping = (SystemFileTransferModeMapping)(typeModeMappings.get(getMappingKey(new SystemFileTransferModeMapping(name, extension))));
-
+
// if not, check only for the extension
if (mapping == null) {
mapping = (SystemFileTransferModeMapping)(typeModeMappings.get(getMappingKey(new SystemFileTransferModeMapping(extension))));
}
-
+
if (mapping == null) {
return null;
}
-
-
+
+
SystemFileTransferModeMapping fileMapping = new SystemFileTransferModeMapping(name, extension);
-
+
if (mapping.isText())
{
fileMapping.setAsText();
}
else
{
- fileMapping.setAsBinary();
+ fileMapping.setAsBinary();
}
-
+
return fileMapping;
}
-
+
/**
- * Return whether to automatically detect, use binary or text during file transfer
+ * Return whether to automatically detect, use binary or text during file transfer
* for unspecified file types
*/
- public static int getFileTransferModeDefaultPreference()
+ public static int getFileTransferModeDefaultPreference()
{
IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
return store.getInt(ISystemFilePreferencesConstants.FILETRANSFERMODEDEFAULT);
}
-
+
/**
* Get a default mapping given an extension. Should never return null.
*/
@@ -381,13 +384,13 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
// DY int extIndex = fileName.indexOf('.');
int extIndex = fileName.lastIndexOf('.');
String name, extension;
-
+
// if there is no extension
// DY 04-23-2002 changed from default binary to default text for files that
// a) Have no extension
// b) Ends with a period
// c) Start with a '.' i.e. .bash_history
- if ((extIndex == -1) || (extIndex == (fileName.length() - 1)) || (extIndex == 0))
+ if ((extIndex == -1) || (extIndex == (fileName.length() - 1)) || (extIndex == 0))
{
name = fileName;
extension = null;
@@ -395,15 +398,15 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
else
{
name = fileName.substring(0, extIndex);
- extension = fileName.substring(extIndex + 1);
+ extension = fileName.substring(extIndex + 1);
}
-
- SystemFileTransferModeMapping mapping = new SystemFileTransferModeMapping(name, extension);
-
- // default
+
+ SystemFileTransferModeMapping mapping = new SystemFileTransferModeMapping(name, extension);
+
+ // default
int defaultFileTransferMode = getFileTransferModeDefaultPreference();
-
+
if (defaultFileTransferMode == ISystemFilePreferencesConstants.FILETRANSFERMODE_BINARY)
{
mapping.setAsBinary();
@@ -415,50 +418,50 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
return mapping;
}
-
-
+
+
/**
* Load the saved associations to the registry
*
* @return true if operation successful, false otherwise
*/
public boolean loadAssociations() {
-
+
typeModeMappings = new HashMap();
-
+
String location = getFileLocation();
-
+
File file = new File(location);
-
+
if (!file.exists())
return false;
-
+
FileInputStream stream = null;
InputStreamReader reader = null;
-
+
boolean result = false;
-
+
try {
stream = new FileInputStream(file);
reader = new InputStreamReader(stream, ENCODING);
XMLMemento memento = XMLMemento.createReadRoot(reader);
IMemento[] mementos = memento.getChildren(INFO_NODE);
-
+
for (int i = 0; i < mementos.length; i++) {
String name = mementos[i].getString(NAME_ATTRIBUTE);
String extension = mementos[i].getString(EXTENSION_ATTRIBUTE);
String mode = mementos[i].getString(MODE_ATTRIBUTE);
-
-
+
+
SystemFileTransferModeMapping mapping = new SystemFileTransferModeMapping(name, extension);
-
+
if (mode.equals(TEXT_VALUE)) {
mapping.setAsText();
}
else {
mapping.setAsBinary();
}
-
+
try
{
Integer priorityInt = mementos[i].getInteger(PRIORITY_ATTRIBUTE);
@@ -468,13 +471,13 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
}
}
catch (Exception e)
- {
+ {
}
-
-
+
+
typeModeMappings.put(getMappingKey(mapping), mapping);
}
-
+
result = true;
}
catch (Exception e) {
@@ -482,9 +485,9 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
result = false;
}
finally {
-
+
try {
-
+
if (reader != null)
reader.close();
}
@@ -492,27 +495,27 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
SystemBasePlugin.logError("Could not close reader for transfer mode xml file", e); //$NON-NLS-1$
}
}
-
-
+
+
return result;
}
-
- private void deleteAssociations()
+
+ private void deleteAssociations()
{
String location = getFileLocation();
File assFile = new File(location);
assFile.delete();
}
-
+
/**
* Save the contents of the registry
*/
public void saveAssociations() {
-
+
String location = getFileLocation();
-
+
XMLMemento memento = XMLMemento.createWriteRoot(ROOT_NODE);
-
+
Iterator iter = typeModeMappings.values().iterator();
while (iter.hasNext()) {
@@ -520,25 +523,25 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
IMemento infoMemento = memento.createChild(INFO_NODE);
infoMemento.putString(NAME_ATTRIBUTE, mapping.getName());
infoMemento.putString(EXTENSION_ATTRIBUTE, mapping.getExtension());
- infoMemento.putString(MODE_ATTRIBUTE, mapping.isBinary() ? BINARY_VALUE : TEXT_VALUE);
+ infoMemento.putString(MODE_ATTRIBUTE, mapping.isBinary() ? BINARY_VALUE : TEXT_VALUE);
infoMemento.putInteger(PRIORITY_ATTRIBUTE, mapping.getPriority());
}
-
+
FileOutputStream stream = null;
OutputStreamWriter writer = null;
-
+
try {
stream = new FileOutputStream(location);
- writer = new OutputStreamWriter(stream, ENCODING);
+ writer = new OutputStreamWriter(stream, ENCODING);
memento.save(writer);
}
catch (Exception e) {
SystemBasePlugin.logError("Could not write to transfer mode xml file", e); //$NON-NLS-1$
}
finally {
-
+
try {
-
+
if (writer != null)
writer.close();
}
@@ -547,8 +550,8 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
}
}
}
-
-
+
+
/**
* Get the file location
*/
diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemoteFileUtility.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemoteFileUtility.java
index 8851f8a86ba..b165d4cc711 100644
--- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemoteFileUtility.java
+++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/model/RemoteFileUtility.java
@@ -1,13 +1,13 @@
/********************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation 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
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
+ * component that contains this file: David McKnight, Kushal Munir,
+ * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@@ -35,7 +35,8 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystemConf
/**
* Public utility class for dealing with remote file subsystems.
*
- * Clients may use this class, but not instantiate or subclass it.
+ * @noextend This class is not intended to be subclassed by clients.
+ * @noinstantiate This class is not intended to be instantiated by clients.
*/
public class RemoteFileUtility
{
@@ -52,7 +53,7 @@ public class RemoteFileUtility
ISubSystem[] sses = sr.getSubSystems(connection);
for (int i = 0; i < sses.length; i++)
{
- if (sses[i] instanceof IRemoteFileSubSystem)
+ if (sses[i] instanceof IRemoteFileSubSystem)
{
IRemoteFileSubSystem subSystem = (IRemoteFileSubSystem)sses[i];
return subSystem;
@@ -60,7 +61,7 @@ public class RemoteFileUtility
}
return null;
}
-
+
/**
* Return the list of file subsystems associated with a connection.
* @param connection the connection to query.
@@ -73,7 +74,7 @@ public class RemoteFileUtility
ISubSystem[] sses = sr.getSubSystems(connection);
for (int i = 0; i < sses.length; i++)
{
- if (sses[i] instanceof IRemoteFileSubSystem)
+ if (sses[i] instanceof IRemoteFileSubSystem)
{
IRemoteFileSubSystem subSystem = (IRemoteFileSubSystem)sses[i];
results.add(subSystem);
@@ -81,34 +82,34 @@ public class RemoteFileUtility
}
return (IRemoteFileSubSystem[])results.toArray(new IRemoteFileSubSystem[results.size()]);
}
-
+
/**
* Return the first remote file subsystem configuration associated with a system type.
* @param systemType the system type to query.
* @return an IRemoteFileSubSystemConfiguration instance, or null
if
* no file subsystem is configured with the given system type.
*/
- public static IRemoteFileSubSystemConfiguration getFileSubSystemConfiguration(IRSESystemType systemType)
- {
- ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
- ISubSystemConfiguration[] sses = sr.getSubSystemConfigurationsBySystemType(systemType, false);
- for (int i = 0; i < sses.length; i++)
+ public static IRemoteFileSubSystemConfiguration getFileSubSystemConfiguration(IRSESystemType systemType)
+ {
+ ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
+ ISubSystemConfiguration[] sses = sr.getSubSystemConfigurationsBySystemType(systemType, false);
+ for (int i = 0; i < sses.length; i++)
+ {
+ if (sses[i] instanceof IRemoteFileSubSystemConfiguration)
{
- if (sses[i] instanceof IRemoteFileSubSystemConfiguration)
- {
- return (IRemoteFileSubSystemConfiguration)sses[i];
- }
+ return (IRemoteFileSubSystemConfiguration)sses[i];
}
- return null;
- }
-
- /**
- * Return the global SystemFileTransferModeRegistry.
- * @return the global SystemFileTransferModeRegistry.
- */
- public static ISystemFileTransferModeRegistry getSystemFileTransferModeRegistry()
- {
- return SystemFileTransferModeRegistry.getInstance();
- }
-
+ }
+ return null;
+ }
+
+ /**
+ * Return the global SystemFileTransferModeRegistry.
+ * @return the global SystemFileTransferModeRegistry.
+ */
+ public static ISystemFileTransferModeRegistry getSystemFileTransferModeRegistry()
+ {
+ return SystemFileTransferModeRegistry.getInstance();
+ }
+
}
\ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemComboBoxCellEditor.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemComboBoxCellEditor.java
index 0821f48d0bf..6d35e73a4d6 100644
--- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemComboBoxCellEditor.java
+++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemComboBoxCellEditor.java
@@ -7,8 +7,8 @@
*
* 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:
@@ -30,19 +30,18 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
/**
- * A slight variation of the Eclipse-supplied ComboBoxCellEditor class,
- * which allows the input array to be changed dynamically.
+ * A slight variation of the Eclipse-supplied ComboBoxCellEditor class, which
+ * allows the input array to be changed dynamically.
* - * A cell editor that presents a list of items in a combo box. - * The cell editor's value is the zero-based index of the selected - * item. - *
- * This class may be instantiated; it is not intended to be subclassed. + * A cell editor that presents a list of items in a combo box. The cell editor's + * value is the zero-based index of the selected item. *
+ * + * @noextend This class is not intended to be subclassed by clients. */ -public class SystemComboBoxCellEditor extends CellEditor +public class SystemComboBoxCellEditor extends CellEditor { - private boolean readOnly = false; + private boolean readOnly = false; /** * The list of items to present in the combo box. */ @@ -58,42 +57,42 @@ public class SystemComboBoxCellEditor extends CellEditor */ private CCombo comboBox; /** - * Creates a new cell editor with a combo containing the given + * Creates a new cell editor with a combo containing the given * list of choices and parented under the given control. The cell * editor value is the zero-based index of the selected item. * Initially, the cell editor has no cell validator and - * the first item in the list is selected. + * the first item in the list is selected. * * @param parent the parent control * @param items the list of strings for the combo box */ - public SystemComboBoxCellEditor(Composite parent, String[] items) + public SystemComboBoxCellEditor(Composite parent, String[] items) { - super(parent); + super(parent); selection = 0; if (items != null) - setItems(items); + setItems(items); else - setValueValid(true); + setValueValid(true); } /** - * Creates a new cell editor with a combo containing the given + * Creates a new cell editor with a combo containing the given * list of choices and parented under the given control. The cell * editor value is the zero-based index of the selected item. * Initially, the cell editor has no cell validator and - * the first item in the list is selected. + * the first item in the list is selected. * * @param parent the parent control * //@param whether or not this is readonly */ - //public SystemComboBoxCellEditor(Composite parent, boolean readOnly) - public SystemComboBoxCellEditor(Composite parent) + //public SystemComboBoxCellEditor(Composite parent, boolean readOnly) + public SystemComboBoxCellEditor(Composite parent) { - super(parent); + super(parent); selection = 0; //this.readOnly = readOnly; - setValueValid(true); - } + setValueValid(true); + } /** * Change the input items */ @@ -101,17 +100,17 @@ public class SystemComboBoxCellEditor extends CellEditor { this.items = items; populateComboBoxItems(); - setValueValid(true); + setValueValid(true); } /* (non-Javadoc) * Method declared on CellEditor. */ - protected Control createControl(Composite parent) + protected Control createControl(Composite parent) { - if (!readOnly) - comboBox = new CCombo(parent, SWT.NONE); + if (!readOnly) + comboBox = new CCombo(parent, SWT.NONE); else - comboBox = new CCombo(parent, SWT.READ_ONLY); + comboBox = new CCombo(parent, SWT.READ_ONLY); comboBox.setFont(parent.getFont()); comboBox.addKeyListener(new KeyAdapter() { @@ -122,24 +121,24 @@ public class SystemComboBoxCellEditor extends CellEditor comboBox.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { - + // DKM - only process this when there is a selection change // fix for defect 138324 if (selection == comboBox.getSelectionIndex() && comboBox.getText().equals(comboBox.getItem(comboBox.getSelectionIndex()))) return; // no change - + // must set the selection before getting value - selection = comboBox.getSelectionIndex(); + selection = comboBox.getSelectionIndex(); Object newValue = doGetValue(); - - + + boolean newValidState = isCorrect(newValue); if (newValidState) { doSetValue(newValue); } else { // try to insert the current value into the error message. setErrorMessage( - NLS.bind(getErrorMessage(), items[selection])); + NLS.bind(getErrorMessage(), items[selection])); } fireApplyEditorValue(); } @@ -163,14 +162,14 @@ public class SystemComboBoxCellEditor extends CellEditor * @return the zero-based index of the current selection wrapped * as anInteger
*/
- protected Object doGetValue()
+ protected Object doGetValue()
{
- return new Integer(selection);
+ return new Integer(selection);
}
/* (non-Javadoc)
* Method declared on CellEditor.
*/
- protected void doSetFocus()
+ protected void doSetFocus()
{
comboBox.setFocus();
}
@@ -179,10 +178,10 @@ public class SystemComboBoxCellEditor extends CellEditor
* this CellEditor
framework method
* accepts a zero-based index of a selection.
*
- * @param value the zero-based index of the selection wrapped
+ * @param value the zero-based index of the selection wrapped
* as an Integer
- */
- protected void doSetValue(Object value)
+ */
+ protected void doSetValue(Object value)
{
if (!(value instanceof Integer))
{
@@ -193,11 +192,11 @@ public class SystemComboBoxCellEditor extends CellEditor
if (item.equals(value))
{
selection = i;
- }
+ }
}
- return;
+ return;
}
-
+
//Assert.isTrue(comboBox != null && (value instanceof Integer));
int newselection = ((Integer) value).intValue();
if (newselection != selection)
@@ -213,9 +212,9 @@ public class SystemComboBoxCellEditor extends CellEditor
/**
* Add the items to the combo box.
*/
- private void populateComboBoxItems()
+ private void populateComboBoxItems()
{
- if (comboBox != null && items != null)
+ if (comboBox != null && items != null)
{
comboBox.removeAll();
for (int i = 0; i < items.length; i++)
diff --git a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemRegistryUI.java b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemRegistryUI.java
index 67584a7b4c7..a0511472341 100644
--- a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemRegistryUI.java
+++ b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemRegistryUI.java
@@ -1,13 +1,13 @@
/********************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation 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
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
+ * component that contains this file: David McKnight, Kushal Munir,
+ * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@@ -65,7 +65,7 @@ import org.eclipse.ui.part.ResourceTransfer;
/**
* Registry and control center for RSE UI related operations.
*
- * This class is not intended to be subclassed by clients.
+ * @noextend This class is not intended to be subclassed by clients.
*/
public class SystemRegistryUI implements ISystemRegistryUI {
@@ -119,7 +119,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
{
SystemPerspectiveHelpers.openRSEPerspective();
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.rse.ui.model.ISystemRegistryUI#expandHost(org.eclipse.rse.core.model.IHost)
@@ -138,7 +138,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
}
}
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.rse.ui.model.ISystemRegistryUI#expandSubSystem(org.eclipse.rse.core.subsystems.ISubSystem)
@@ -207,7 +207,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
public void clearRunnableContext()
{
//this.currentRunnableContext = null;
- //this.currentRunnableContextShell = null;
+ //this.currentRunnableContextShell = null;
popRunnableContext();
}
@@ -256,7 +256,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
previousRunnableContextShells.remove(disposedShells.elementAt(idx));
previousRunnableContexts.remove(disposedContexts.elementAt(idx));
}
-
+
return currentRunnableContext;
}
@@ -289,7 +289,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
}
clipboard = new Clipboard(display);
}
-
+
return clipboard;
}
@@ -305,21 +305,21 @@ public class SystemRegistryUI implements ISystemRegistryUI {
int connectionDelim = str.indexOf(":"); //$NON-NLS-1$
if (connectionDelim == -1) // not subsystem, therefore likely to be a connection
{
- int profileDelim = str.indexOf("."); //$NON-NLS-1$
- if (profileDelim != -1)
+ int profileDelim = str.indexOf("."); //$NON-NLS-1$
+ if (profileDelim != -1)
{
- String profileId = str.substring(0, profileDelim);
- String connectionId = str.substring(profileDelim + 1, str.length());
- ISystemProfile profile = registry.getSystemProfile(profileId);
- return registry.getHost(profile, connectionId);
+ String profileId = str.substring(0, profileDelim);
+ String connectionId = str.substring(profileDelim + 1, str.length());
+ ISystemProfile profile = registry.getSystemProfile(profileId);
+ return registry.getHost(profile, connectionId);
}
}
-
+
int subsystemDelim = str.indexOf(":", connectionDelim + 1); //$NON-NLS-1$
-
+
String subSystemId = str.substring(0, subsystemDelim);
String srcKey = str.substring(subsystemDelim + 1, str.length());
-
+
ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
ISubSystem subSystem = registry.getSubSystem(subSystemId);
if (subSystem != null)
@@ -364,26 +364,26 @@ public class SystemRegistryUI implements ISystemRegistryUI {
Clipboard clipboard = getSystemClipboard();
ArrayList srcObjects = new ArrayList();
Object object = null;
-
+
if (srcType == SystemDNDTransferRunnable.SRC_TYPE_RSE_RESOURCE)
{
-
+
// determine the source objects
object = clipboard.getContents(PluginTransfer.getInstance());
-
+
if (object instanceof PluginTransferData)
{
// RSE transfer
PluginTransferData data = (PluginTransferData) object;
byte[] result = data.getData();
-
+
//StringTokenizer tokenizer = new StringTokenizer(new String(result), SystemViewDataDropAdapter.RESOURCE_SEPARATOR);
String[] tokens = (new String(result)).split("\\"+SystemViewDataDropAdapter.RESOURCE_SEPARATOR); //$NON-NLS-1$
-
+
for (int i = 0;i < tokens.length; i++)
{
String srcStr = tokens[i];
-
+
Object srcObject = getObjectFor(srcStr);
srcObjects.add(srcObject);
}
@@ -403,7 +403,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
}
}
}
-
+
else if (srcType == SystemDNDTransferRunnable.SRC_TYPE_OS_RESOURCE)
{
// Local File transfer
@@ -438,11 +438,11 @@ public class SystemRegistryUI implements ISystemRegistryUI {
*/
public SystemScratchpad getSystemScratchPad()
{
- if (scratchpad == null)
- {
- scratchpad = new SystemScratchpad();
- }
- return scratchpad;
+ if (scratchpad == null)
+ {
+ scratchpad = new SystemScratchpad();
+ }
+ return scratchpad;
}
@@ -474,7 +474,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
}
if (SystemPreferencesManager.getShowFilterPools())
{
- registry.fireEvent(new SystemResourceChangeEvent(registry, ISystemResourceChangeEvents.EVENT_REFRESH, registry));
+ registry.fireEvent(new SystemResourceChangeEvent(registry, ISystemResourceChangeEvents.EVENT_REFRESH, registry));
}
}
@@ -513,8 +513,8 @@ public class SystemRegistryUI implements ISystemRegistryUI {
if ((factory!=null)&&factory.supportsFilters())
factory.setShowFilterStrings(show);
}
- }
- }
+ }
+ }
}*/
/**
* Reflect the user changing the preference for showing new connection prompt
@@ -526,7 +526,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
// ----------------------------
// RESOURCE EVENT METHODS...
- // ----------------------------
+ // ----------------------------
/*
* (non-Javadoc)
diff --git a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/model/ISystemRegistryUI.java b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/model/ISystemRegistryUI.java
index fcc9a90a501..f5a2828967b 100644
--- a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/model/ISystemRegistryUI.java
+++ b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/model/ISystemRegistryUI.java
@@ -1,13 +1,13 @@
/********************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation 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
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
+ * component that contains this file: David McKnight, Kushal Munir,
+ * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@@ -31,16 +31,15 @@ import org.eclipse.swt.widgets.Shell;
/**
* Registry and control center for RSE UI related operations.
- * - * This interface is not intended to be implemented by clients. - *
+ * + * @noimplement This interface is not intended to be implemented by clients. */ public interface ISystemRegistryUI extends ISystemShellProvider { // ---------------------------------- // UI METHODS... // ---------------------------------- - + /** * Show the RSE perspective if it is not already showing */ @@ -58,10 +57,10 @@ public interface ISystemRegistryUI extends ISystemShellProvider { */ public void expandSubSystem(ISubSystem subsystem); - /** - * Returns the clipboard used for copy actions - */ - public Clipboard getSystemClipboard(); + /** + * Returns the clipboard used for copy actions + */ + public Clipboard getSystemClipboard(); /** * Returns the list of objects on the system clipboard @@ -115,7 +114,7 @@ public interface ISystemRegistryUI extends ISystemShellProvider { public void setRunnableContext(Shell shell, IRunnableContext context); /** - * Clear the current active runnable context to be used for a progress monitor. + * Clear the current active runnable context to be used for a progress monitor. * Be sure to call this from you dispose method. */ public void clearRunnableContext(); @@ -129,21 +128,21 @@ public interface ISystemRegistryUI extends ISystemShellProvider { // ---------------------------- // RESOURCE EVENT METHODS... - // ---------------------------- + // ---------------------------- /** * Notify all listeners of a change to a system resource such as a connection. * You would not normally call this as the methods in this class call it when appropriate. *- * This version calls fireEvent at the next reasonable opportunity, leveraging SWT's + * This version calls fireEvent at the next reasonable opportunity, leveraging SWT's * Display.asyncExec() method. */ public void postEvent(ISystemResourceChangeEvent event); - + /** * Notify a specific listener of a change to a system resource such as a connection. *
- * This version calls fireEvent at the next reasonable opportunity, leveraging SWT's + * This version calls fireEvent at the next reasonable opportunity, leveraging SWT's * Display.asyncExec() method. */ public void postEvent(ISystemResourceChangeListener listener, ISystemResourceChangeEvent event); diff --git a/terminal/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/PageBook.java b/terminal/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/PageBook.java index ffe91a38110..abb3283b825 100644 --- a/terminal/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/PageBook.java +++ b/terminal/org.eclipse.tm.terminal.view/src/org/eclipse/tm/internal/terminal/view/PageBook.java @@ -15,12 +15,10 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; /** - * A pagebook is a composite control where only a single control is visible - * at a time. It is similar to a notebook, but without tabs. - *
- * This class may be instantiated; it is not intended to be subclassed. - *
- * + * A pagebook is a composite control where only a single control is visible at a + * time. It is similar to a notebook, but without tabs. + * + * @noextend This class is not intended to be subclassed by clients. */ public class PageBook extends Composite { private StackLayout fLayout; diff --git a/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ITerminalControl.java b/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ITerminalControl.java index 47acc769119..86b009e259c 100644 --- a/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ITerminalControl.java +++ b/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/provisional/api/ITerminalControl.java @@ -1,11 +1,11 @@ /******************************************************************************* * Copyright (c) 2006, 2007 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 + * 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: + * Contributors: * Michael Scharf (Wind River) - initial API and implementation * Martin Oberhuber (Wind River) - fixed copyright headers and beautified *******************************************************************************/ @@ -17,18 +17,19 @@ import org.eclipse.swt.widgets.Shell; /** * Represents the terminal view as seen by a terminal connection. - * - *Not to be implemented by clients. - * @author Michael Scharf *
* EXPERIMENTAL. This class or interface has been added as - * part of a work in progress. There is no guarantee that this API will - * work or that it will remain the same. Please do not use this API without - * consulting with the Target Management team. + * part of a work in progress. There is no guarantee that this API will work or + * that it will remain the same. Please do not use this API without consulting + * with the Target Management + * team. *
+ * + * @author Michael Scharf + * @noimplement This interface is not intended to be implemented by clients. */ public interface ITerminalControl { - + /** * @return the current state of the connection */ @@ -38,7 +39,7 @@ public interface ITerminalControl { * @param state */ void setState(TerminalState state); - + /** * A shell to show dialogs. * @return the shell in which the terminal is shown. @@ -48,7 +49,7 @@ public interface ITerminalControl { /** * Show a text in the terminal. If puts newlines at the beginning and the end. * @param text - * TODO: Michael Scharf: Is this really needed? + * TODO: Michael Scharf: Is this really needed? */ void displayTextInTerminal(String text); @@ -71,5 +72,5 @@ public interface ITerminalControl { * TODO: Michael Scharf: Should be replaced by a better error notification mechanism! */ void setMsg(String msg); - + } diff --git a/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextData.java b/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextData.java index f3359e10fb4..23eeac5716f 100644 --- a/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextData.java +++ b/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextData.java @@ -1,23 +1,24 @@ /******************************************************************************* * Copyright (c) 2007 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 + * 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: + * Contributors: * Michael Scharf (Wind River) - initial API and implementation *******************************************************************************/ package org.eclipse.tm.terminal.model; /** - * A writable matrix of characters and {@link Style}. This is intended to be the - * low level representation of the text of a Terminal. Higher layers are responsible - * to fill the text and styles into this representation. - * - *Note: Implementations of this interface has to be thread safe. - *
Note: This interface is not intended to be implemented by clients. + * A writable matrix of characters and {@link Style}. This is intended to be + * the low level representation of the text of a Terminal. Higher layers are + * responsible to fill the text and styles into this representation. + *
+ * Note: Implementations of this interface has to be thread safe. + *
+ * @noimplement This interface is not intended to be implemented by clients. */ public interface ITerminalTextData extends ITerminalTextDataReadOnly { @@ -61,30 +62,30 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly { * @param style the style or null */ void setChars(int line, int column, char[] chars, int start, int len, Style style); - + /** * Cleans the entire line. * @param line */ void cleanLine(int line); -// /** -// * @param line -// * @return true if this line belongs to the previous line but is simply -// * wrapped. -// */ -// boolean isWrappedLine(int line); -// -// /** -// * Makes this line an extension to the previous line. Wrapped lines get folded back -// * when the width of the terminal changes -// * @param line -// * @param extendsPreviousLine -// */ -// void setWrappedLine(int line, boolean extendsPreviousLine); - + // /** + // * @param line + // * @return true if this line belongs to the previous line but is simply + // * wrapped. + // */ + // boolean isWrappedLine(int line); + // + // /** + // * Makes this line an extension to the previous line. Wrapped lines get folded back + // * when the width of the terminal changes + // * @param line + // * @param extendsPreviousLine + // */ + // void setWrappedLine(int line, boolean extendsPreviousLine); + /** - * Shifts some lines up or down. The "empty" space is filled with'\000'
chars
+ * Shifts some lines up or down. The "empty" space is filled with '\000'
chars
* and null
{@link Style}
* To illustrate shift, here is some sample data: *
@@ -100,7 +101,7 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly { * 0 aaaa * 1 cccc * 2 dddd - * 3 + * 3 * 4 eeee ** @@ -108,7 +109,7 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly { * Shift a region of 3 lines down by one line
shift(1,3,1)
* * 0 aaaa - * 1 + * 1 * 2 bbbb * 3 cccc * 4 eeee @@ -119,7 +120,7 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly { * Negative number means scroll down, positive scroll up (see example above). */ void scroll(int startLine, int size, int shift); - + /**Adds a new line to the terminal. If maxHeigth is reached, the entire terminal * will be scrolled. Else a line will be added. */ @@ -145,7 +146,7 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly { * @param length */ void copyRange(ITerminalTextData source, int sourceStartLine, int destStartLine,int length); - + void setCursorLine(int line); void setCursorColumn(int column); } \ No newline at end of file diff --git a/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextDataSnapshot.java b/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextDataSnapshot.java index 7d4065e7581..652e1041407 100644 --- a/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextDataSnapshot.java +++ b/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/terminal/model/ITerminalTextDataSnapshot.java @@ -1,11 +1,11 @@ /******************************************************************************* * Copyright (c) 2007 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 + * 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: + * Contributors: * Michael Scharf (Wind River) - initial API and implementation *******************************************************************************/ package org.eclipse.tm.terminal.model; @@ -13,62 +13,73 @@ package org.eclipse.tm.terminal.model; /** * This class maintains a snapshot of an instance of {@link ITerminalTextData}. * While the {@link ITerminalTextData} continues changing, the snapshot remains - * unchanged until the next snapshot is taken by calling {@link #updateSnapshot(boolean)}. - * This is important, because the {@link ITerminalTextData} might get - * modified by another thread. Suppose you would want to draw the content of - * the {@link ITerminalTextData} using the following loop: + * unchanged until the next snapshot is taken by calling + * {@link #updateSnapshot(boolean)}. This is important, because the + * {@link ITerminalTextData} might get modified by another thread. Suppose you + * would want to draw the content of the {@link ITerminalTextData} using the + * following loop: + * *- * for(int line=0;line<term.getHeight();line++) - * for(int column=0; column<term.getWidth();column++) - * drawCharacter(column,line,term.getChar(column,line),term.getStyle(column,line)); + * for (int line = 0; line < term.getHeight(); line++) + * for (int column = 0; column < term.getWidth(); column++) + * drawCharacter(column, line, term.getChar(column, line), term.getStyle(column, line)); *- * This might fail because the background thread could change the dimensions of the - * {@link ITerminalTextData} while you iterate the loop. One solution would be to - * put asynchronized(term){}
statement around the code. This has - * two problems: 1. you would have to know about the internals of the synchronisation - * of {@link ITerminalTextData}. 2. The other thread that changes {@link ITerminalTextData} - * is blocked while the potentially slow drawing is done. + * + * This might fail because the background thread could change the dimensions of + * the {@link ITerminalTextData} while you iterate the loop. One solution would + * be to put asynchronized(term){}
statement around the code. + * This has two problems: 1. you would have to know about the internals of the + * synchronisation of {@link ITerminalTextData}. 2. The other thread that + * changes {@link ITerminalTextData} is blocked while the potentially slow + * drawing is done. *- * Solution: Take a snapshot of the terminal and use the snapshot to draw - * the content. There is no danger that the data structure get changed while - * you draw. There are also methods to find out what has changed to minimize - * the number of lines that get redrawn.
- * - *Drawing optimization: To optimize redrawing of changed lines, this class keeps - * track of lines that have changed since the previous snapshot.
- * - *- * // iterate over the potentially changed lines - * for(int line=snap.getFirstChangedLine();line<=snap.getLastChangedLine();line++) - * // redraw only if the line has changed - * if(snap.hasLineChanged(line)) - * for(int column=0; column<snap.getWidth();column++) - * drawCharacter(column,line,snap.getChar(column,line),snap.getStyle(column,line)); - *- * - *Scroll optimization: Often new lines are appended at the bottom of the - * terminal and the rest of the lines are scrolled up. In this case all lines would be - * marked as changed. To optimize for this - * case, {@link #updateSnapshot(boolean)} can be called with
true
for - * thedetectScrolling
parameter. The object will keep track of scrolling. - * The UI must first handle the scrolling and then use the {@link #hasLineChanged(int)} - * method to determine scrolling: - *- * // scroll the visible region of the UI before drawing the changed lines. - * doUIScrolling(snap.getScrollChangeY(),snap.getScrollChangeN(),snap.getScrollChangeShift()); - * // iterate over the potentially changed lines - * for(int line=snap.getFirstChangedLine();line<=snap.getFirstChangedLine();line++) - * // redraw only if the line has changed - * if(snap.hasLineChanged(line)) - * for(int column=0; column<snap.getWidth();column++) - * drawCharacter(column,line,snap.getChar(column,line),snap.getStyle(column,line)); - *+ * Solution: Take a snapshot of the terminal and use the snapshot to + * draw the content. There is no danger that the data structure get changed + * while you draw. There are also methods to find out what has changed to + * minimize the number of lines that get redrawn. * * - *Note: This interface is not intended to be implemented by clients.
- *Threading Note: This class is not thread save! All methods have to be called by - * the a same thread, that created the instance by calling - * {@link ITerminalTextDataReadOnly#makeSnapshot()}.
+ *+ * Drawing optimization: To optimize redrawing of changed lines, this + * class keeps track of lines that have changed since the previous snapshot. + *
+ * + *+ * // iterate over the potentially changed lines + * for (int line = snap.getFirstChangedLine(); line <= snap.getLastChangedLine(); line++) + * // redraw only if the line has changed + * if (snap.hasLineChanged(line)) + * for (int column = 0; column < snap.getWidth(); column++) + * drawCharacter(column, line, snap.getChar(column, line), snap.getStyle(column, line)); + *+ * + *+ * Scroll optimization: Often new lines are appended at the bottom of + * the terminal and the rest of the lines are scrolled up. In this case all + * lines would be marked as changed. To optimize for this case, + * {@link #updateSnapshot(boolean)} can be called with
true
for + * thedetectScrolling
parameter. The object will keep track of + * scrolling. The UI must first handle the scrolling and then use the + * {@link #hasLineChanged(int)} method to determine scrolling: + * + *+ * // scroll the visible region of the UI <b>before</b> drawing the changed lines. + * doUIScrolling(snap.getScrollChangeY(), snap.getScrollChangeN(), snap.getScrollChangeShift()); + * // iterate over the potentially changed lines + * for (int line = snap.getFirstChangedLine(); line <= snap.getFirstChangedLine(); line++) + * // redraw only if the line has changed + * if (snap.hasLineChanged(line)) + * for (int column = 0; column < snap.getWidth(); column++) + * drawCharacter(column, line, snap.getChar(column, line), snap.getStyle(column, line)); + *+ * + *+ * Threading Note: This class is not thread safe! All methods have to be + * called by the a same thread, that created the instance by calling + * {@link ITerminalTextDataReadOnly#makeSnapshot()}. + *
+ * + * @noimplement This interface is not intended to be implemented by clients. */ public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly { /** @@ -79,7 +90,7 @@ public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly { * is called and a new snapshot needs to be updated again. ** A typical terminal view would not update the snapshot immediately - * after the {@link #snapshotOutOfDate(ITerminalTextDataSnapshot)} has been called. It would introduce a + * after the {@link #snapshotOutOfDate(ITerminalTextDataSnapshot)} has been called. It would introduce a * delay to update the UI (and the snapshot} 10 or 20 times per second. * *
Make sure you don't spend too much time in this method. @@ -94,7 +105,7 @@ public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly { } void addListener(SnapshotOutOfDateListener listener); void removeListener(SnapshotOutOfDateListener listener); - + /** * Ends the listening to the {@link ITerminalTextData}. After this * has been called no new snapshot data is collected. @@ -115,11 +126,11 @@ public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly { void setInterestWindow(int startLine, int size); int getInterestWindowStartLine(); int getInterestWindowSize(); - + /** * Create a new snapshot of the {@link ITerminalTextData}. It will efficiently * copy the data of the {@link ITerminalTextData} into an internal representation. - * The snapshot also keeps track of the changes since the previous snapshot. + * The snapshot also keeps track of the changes since the previous snapshot. *
With the methods {@link #getFirstChangedLine()}, {@link #getLastChangedLine()} and * {@link #hasLineChanged(int)} * you can find out what has changed in the current snapshot since the previous snapshot. @@ -134,9 +145,9 @@ public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly { /** * @return The first line changed in this snapshot compared - * to the previous snapshot. + * to the previous snapshot. * - *
Note: If no line has changed, this + *
Note: If no line has changed, this * returns {@link Integer#MAX_VALUE} * *
Note: if {@link #updateSnapshot(boolean)} has been called with
true
, @@ -171,11 +182,11 @@ public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly { * @return true if the line has changed since the previous snapshot */ boolean hasLineChanged(int line); - + boolean hasDimensionsChanged(); - + /** - * @return true if the terminal has changed (and not just the + * @return true if the terminal has changed (and not just the * window of interest) */ boolean hasTerminalChanged(); @@ -203,7 +214,7 @@ public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly { * to the previous snapshot. See also {@link ITerminalTextData#scroll(int, int, int)} */ int getScrollWindowShift(); - + /** * @return The {@link ITerminalTextData} on that this instance is observing. */