Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ptp-dev] Re: [ptp-cvs-commit] crecoskie org.eclipse.ptp/core/org.eclipse.ptp.remote.core/src/org/eclipse/ptp/remote/core IRemoteProcessBuilder.java AbstractRemoteProcessBuilder.java PTPRemoteCorePlugin.java

Chris,

I noticed that you added getHomeDirectory() to IRemoteProcessBuilder. Did you know that IRemoteConnection already provides g/setWorkingDirectory()? Did you specifically want to get the user's home directory? It's usually the user's home directory when the connection is first established, but can be changed using this interface if required.

Regards,
Greg

On May 11, 2010, at 6:50 PM, Eclipse CVS Genie wrote:

> Update of /cvsroot/tools/org.eclipse.ptp/core/org.eclipse.ptp.remote.core/src/org/eclipse/ptp/remote/core
> In directory node1:/tmp/cvs-serv131960/src/org/eclipse/ptp/remote/core
> 
> Modified Files:
> 	IRemoteProcessBuilder.java AbstractRemoteProcessBuilder.java 
> 	PTPRemoteCorePlugin.java 
> Log Message:
> - merged ptp_2_1 to HEAD
> 
> Index: AbstractRemoteProcessBuilder.java
> ===================================================================
> RCS file: /cvsroot/tools/org.eclipse.ptp/core/org.eclipse.ptp.remote.core/src/org/eclipse/ptp/remote/core/AbstractRemoteProcessBuilder.java,v
> retrieving revision 1.3
> retrieving revision 1.4
> diff -C2 -d -r1.3 -r1.4
> *** AbstractRemoteProcessBuilder.java	28 Jan 2010 13:15:04 -0000	1.3
> --- AbstractRemoteProcessBuilder.java	11 May 2010 22:50:48 -0000	1.4
> ***************
> *** 1,4 ****
>  /*******************************************************************************
> !  * Copyright (c) 2007 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
> --- 1,4 ----
>  /*******************************************************************************
> !  * Copyright (c) 2007, 2010 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
> ***************
> *** 77,80 ****
> --- 77,87 ----
>  		return fRemoteDir;
>  	}
> + 	
> + 	/* (non-Javadoc)
> + 	 * @see org.eclipse.ptp.remote.core.IRemoteProcessBuilder#getHomeDirectory()
> + 	 */
> + 	public IFileStore getHomeDirectory() {
> + 		return null;
> + 	}
> 
>  	/* (non-Javadoc)
> 
> Index: PTPRemoteCorePlugin.java
> ===================================================================
> RCS file: /cvsroot/tools/org.eclipse.ptp/core/org.eclipse.ptp.remote.core/src/org/eclipse/ptp/remote/core/PTPRemoteCorePlugin.java,v
> retrieving revision 1.10
> retrieving revision 1.11
> diff -C2 -d -r1.10 -r1.11
> *** PTPRemoteCorePlugin.java	22 Apr 2010 14:56:20 -0000	1.10
> --- PTPRemoteCorePlugin.java	11 May 2010 22:50:48 -0000	1.11
> ***************
> *** 1,4 ****
>  /*******************************************************************************
> !  * Copyright (c) 2007 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
> --- 1,4 ----
>  /*******************************************************************************
> !  * Copyright (c) 2007, 2010 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
> ***************
> *** 221,226 ****
>  		if (proxy != null) {
>  			return proxy.getServices();
>  		}
> - 		return null;
>  	}
> 
> --- 221,230 ----
>  		if (proxy != null) {
>  			return proxy.getServices();
> + 		} else {
> + 			// initialization might have failed for that set of services previously... try to load it again
> + 			retrieveRemoteServices(id);
> + 			proxy = allRemoteServicesById.get(id);
> + 			return proxy.getServices();
>  		}
>  	}
> 
> ***************
> *** 291,293 ****
> --- 295,325 ----
>  		}
>  	}
> + 	
> + 	/**
> + 	 * Attempts to load the remote services with a given ID.  If no services are loaded, it
> + 	 * loads them all.
> + 	 * 
> + 	 * @param id
> + 	 */
> + 	private void retrieveRemoteServices(String id) {
> + 		if (allRemoteServicesById == null) {
> + 			retrieveRemoteServices();
> + 		} else {
> + 			IExtensionRegistry registry = Platform.getExtensionRegistry();
> + 			IExtensionPoint extensionPoint = registry.getExtensionPoint(PLUGIN_ID, REMOTE_SERVICES_EXTENSION_POINT_ID);
> + 			final IExtension[] extensions = extensionPoint.getExtensions();
> + 
> + 			for (IExtension ext : extensions) {
> + 				final IConfigurationElement[] elements = ext.getConfigurationElements();
> + 
> + 				for (IConfigurationElement ce : elements) {
> + 					RemoteServicesProxy proxy = new RemoteServicesProxy(ce);
> + 					if (proxy.getId().equals(id)) {
> + 						allRemoteServicesById.put(proxy.getId(), proxy);
> + 						allRemoteServicesByScheme.put(proxy.getScheme(), proxy);					
> + 					}
> + 				}
> + 			}
> + 		}
> + 	}
>  }
> 
> Index: IRemoteProcessBuilder.java
> ===================================================================
> RCS file: /cvsroot/tools/org.eclipse.ptp/core/org.eclipse.ptp.remote.core/src/org/eclipse/ptp/remote/core/IRemoteProcessBuilder.java,v
> retrieving revision 1.2
> retrieving revision 1.3
> diff -C2 -d -r1.2 -r1.3
> *** IRemoteProcessBuilder.java	2 Nov 2009 23:27:22 -0000	1.2
> --- IRemoteProcessBuilder.java	11 May 2010 22:50:48 -0000	1.3
> ***************
> *** 1,4 ****
>  /*******************************************************************************
> !  * Copyright (c) 2007 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
> --- 1,4 ----
>  /*******************************************************************************
> !  * Copyright (c) 2007, 2010 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
> ***************
> *** 63,66 ****
> --- 63,73 ----
>  	 */
>  	public IFileStore directory();
> + 	
> + 	/**
> + 	 * Returns the user's home directory on the target system.
> + 	 * 
> + 	 * @return IFileStore corresponding to the location, or <code>null</code> if the home directory cannot be determined.
> + 	 */
> + 	public IFileStore getHomeDirectory();
> 
>  	/**
> 
> _______________________________________________
> ptp-cvs-commit mailing list
> ptp-cvs-commit@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ptp-cvs-commit



Back to the top