pax_global_header00006660000000000000000000000064127211400170014505gustar00rootroot0000000000000052 comment=ba3f1c00abe7e609f16bb5d50648015372ab3d05 org.eclipse.remote-R2_1_0/000077500000000000000000000000001272114001700154755ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/.gitignore000066400000000000000000000000101272114001700174540ustar00rootroot00000000000000target/ org.eclipse.remote-R2_1_0/bundles/000077500000000000000000000000001272114001700171315ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/.gitignore000066400000000000000000000000061272114001700211150ustar00rootroot00000000000000/bin/ org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/000077500000000000000000000000001272114001700242765ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/.classpath000066400000000000000000000005611272114001700262630ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/.gitignore000066400000000000000000000000061272114001700262620ustar00rootroot00000000000000/bin/ org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/.project000066400000000000000000000015211272114001700257440ustar00rootroot00000000000000 org.eclipse.remote.console org.eclipse.jdt.core.javabuilder org.eclipse.pde.ManifestBuilder org.eclipse.pde.SchemaBuilder org.eclipse.pde.api.tools.apiAnalysisBuilder org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.pde.api.tools.apiAnalysisNature org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/.settings/000077500000000000000000000000001272114001700262145ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/.settings/org.eclipse.jdt.core.prefs000066400000000000000000000005451272114001700332020ustar00rootroot00000000000000eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/META-INF/000077500000000000000000000000001272114001700254365ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/META-INF/MANIFEST.MF000066400000000000000000000022461272114001700270740ustar00rootroot00000000000000Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.remote.console;singleton:=true Bundle-Version: 1.1.0.qualifier Bundle-Activator: org.eclipse.remote.internal.console.Activator Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Bundle-Vendor: %pluginProvider Export-Package: org.eclipse.remote.console, org.eclipse.remote.console.actions Import-Package: org.eclipse.core.commands, org.eclipse.core.runtime, org.eclipse.core.runtime.jobs, org.eclipse.jface.action, org.eclipse.jface.dialogs, org.eclipse.jface.resource, org.eclipse.jface.viewers, org.eclipse.jface.window, org.eclipse.osgi.util, org.eclipse.remote.core, org.eclipse.remote.core.exception, org.eclipse.remote.ui.widgets, org.eclipse.swt, org.eclipse.swt.events, org.eclipse.swt.layout, org.eclipse.swt.widgets, org.eclipse.tm.internal.terminal.control, org.eclipse.tm.internal.terminal.provisional.api, org.eclipse.ui, org.eclipse.ui.console, org.eclipse.ui.console.actions, org.eclipse.ui.handlers, org.eclipse.ui.part, org.eclipse.ui.plugin, org.eclipse.ui.progress, org.osgi.framework org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/about.html000066400000000000000000000024471272114001700263050ustar00rootroot00000000000000 About

About This Content

May 2, 2006

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/about.ini000066400000000000000000000016471272114001700261210ustar00rootroot00000000000000# about.ini # contains information about a feature # java.io.Properties file (ISO 8859-1 with "\" escapes) # "%key" are externalized strings defined in about.properties # This file does not need to be translated. # Property "aboutText" contains blurb for "About" dialog (translated) aboutText=%blurb # Property "windowImage" contains path to window icon (16x16) # needed for primary features only # Property "featureImage" contains path to feature image (32x32) featureImage=ptp_logo_icon32.png # Property "aboutImage" contains path to product image (500x330 or 115x164) # needed for primary features only # Property "appName" contains name of the application (not translated) # needed for primary features only # Property "welcomePage" contains path to welcome page (special XML-based format) # optional # Property "welcomePerspective" contains the id of the perspective in which the # welcome page is to be opened. # optional org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/about.mappings000066400000000000000000000002501272114001700271450ustar00rootroot00000000000000# about.mappings # contains fill-ins for about.properties # java.io.Properties file (ISO 8859-1 with "\" escapes) # This file does not need to be translated. 0=@build@org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/about.properties000066400000000000000000000013761272114001700275350ustar00rootroot00000000000000############################################################################### # Copyright (c) 2005, 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 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # IBM Corporation - initial API and implementation ############################################################################### # NLS_MESSAGEFORMAT_NONE # NLS_ENCODING=UTF-8 blurb=Remote Services\n\ \n\ Version: {featureVersion}\n\ Build id: {0}\n\ \n\ Copyright (c) 2008 IBM Corporation, and others. All rights reserved.\n\ Visit http://www.eclipse.org/ptp\n org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/build.properties000066400000000000000000000005011272114001700275070ustar00rootroot00000000000000source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ plugin.xml,\ plugin.properties,\ icons/,\ about.html,\ about.ini,\ about.mappings,\ about.properties,\ ptp_logo_icon32.png org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/000077500000000000000000000000001272114001700254115ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/clcl16/000077500000000000000000000000001272114001700264755ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/clcl16/command_input_field.gif000066400000000000000000000006011272114001700331610ustar00rootroot00000000000000GIF89aºߩƚˢKndʩzǵqijtv!?,_Fd~Ȥ2y\:ϥmZozep'{y2gRP/Je>n^+%%;;,/.->?::BDF?8$ 8O4 4O5 " "5A;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/clcl16/connect_co.gif000066400000000000000000000002131272114001700312720ustar00rootroot00000000000000GIF89a /0Oɟcc!,8IbElB8A]`KN.;n=Ud͓Z;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/clcl16/disconnect_co.gif000066400000000000000000000002221272114001700317720ustar00rootroot00000000000000GIF89a?__??__??ߟ߿! ,?pIآơN9e! *%"M6P(`2V(,2z;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/clcl16/lock_co.gif000066400000000000000000000011621272114001700305750ustar00rootroot00000000000000GIF89ahv^xc|jj~ǭҺb|r{|Knr{|lvzĻlphjuζ$ڈϱ!#88ǤEDؽm׎ćѕϬx[~Ű}ªsɶ˲м!f,πf<=3<<93##>3 >:3$$23)2;3++84&&%  7aPP_,,- -`RddR^..'*"fbFXeecFM/(!3f]Za]]aZ]10"y ?<C$f eJ&N83[\ɒ劒-6l<၀3\$B%. $(<-@v1d&;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/clcl16/newterminal.gif000066400000000000000000000005371272114001700315160ustar00rootroot00000000000000GIF89a NEyyTGJNPQRSUbceghhpplwyyz{~!?,|pH!ŤCШȤ 1}ճrx=j&4\>=,C  -o)*% O$"!!#  Wm o o RPJA;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/clcl16/properties_tsk.gif000066400000000000000000000001661272114001700322440ustar00rootroot00000000000000GIF89a___俿!,;x-I @fSFé p,-+P97Qf$- @;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/cview16/000077500000000000000000000000001272114001700266755ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/cview16/terminal_view.gif000066400000000000000000000016521272114001700322350ustar00rootroot00000000000000GIF89afff33324ff3ffMMM!,@H @! p E#pЁ(d@$YqKLtB‘2  8%Jt*yb/ lP"0W洩ׯсȑ3'8a,@pg@;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/dlcl16/000077500000000000000000000000001272114001700264765ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/dlcl16/command_input_field.gif000066400000000000000000000003571272114001700331720ustar00rootroot00000000000000GIF89a!,l`vcfy,4-F|^A$&_x8)(ta( fP X M&3z xT ~zi?6~.*5$!;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/dlcl16/connect_co.gif000066400000000000000000000015521272114001700313020ustar00rootroot00000000000000GIF89a!,@GH ",`‡:h $8bCND8ɓ(K\q$ŕ.;b2&ˈ=fDɳ`@;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/dlcl16/disconnect_co.gif000066400000000000000000000001321272114001700317730ustar00rootroot00000000000000GIF89a!,+  {=v>m$rJK;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/dlcl16/lock_co.gif000066400000000000000000000011141272114001700305730ustar00rootroot00000000000000GIF89aձçʰҾ᷶诫!D,D@@@/ D,!!; Ʃ%??%+ ҕ@ =4,::,4:#.*0C6785-)bӧPr0C !B \"D 1cPA ;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/dlcl16/newterminal.gif000066400000000000000000000005371272114001700315170ustar00rootroot00000000000000GIF89a NEyyTGJNPQRSUbceghhpplwyyz{~!?,|pH!ŤCШȤ 1}ճrx=j&4\>=,C  -o)*% O$"!!#  Wm o o RPJA;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/dlcl16/properties_tsk.gif000066400000000000000000000001321272114001700322360ustar00rootroot00000000000000GIF89a!,+ .0 b7*`ޕc+ (LZ;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/dlcl16/rem_co.gif000066400000000000000000000002371272114001700304330ustar00rootroot00000000000000GIF89a! ,LPI-(&F!FZ pq݄D(01Cph4!|Ff-P5P/{z<rͦD;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/elcl16/000077500000000000000000000000001272114001700264775ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/elcl16/command_input_field.gif000066400000000000000000000003571272114001700331730ustar00rootroot00000000000000GIF89a!,l`vcfy,4-F|^A$&_x8)(ta( fP X M&3z xT ~zi?6~.*5$!;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/elcl16/connect_co.gif000066400000000000000000000015721272114001700313050ustar00rootroot00000000000000GIF89a___!,@W H A",(`8@D30`Q/ ˗ aU\Ǝyڄ(͑@a*;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/elcl16/disconnect_co.gif000066400000000000000000000001661272114001700320030ustar00rootroot00000000000000GIF89a___!,;X1` (yK*@ rq%OE4 .D*'T^dJ&;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/elcl16/lock_co.gif000066400000000000000000000011621272114001700305770ustar00rootroot00000000000000GIF89ahv^xc|jj~ǭҺb|r{|Knr{|lvzĻlphjuζ$ڈϱ!#88ǤEDؽm׎ćѕϬx[~Ű}ªsɶ˲м!f,πf<=3<<93##>3 >:3$$23)2;3++84&&%  7aPP_,,- -`RddR^..'*"fbFXeecFM/(!3f]Za]]aZ]10"y ?<C$f eJ&N83[\ɒ劒-6l<၀3\$B%. $(<-@v1d&;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/elcl16/newterminal.gif000066400000000000000000000005371272114001700315200ustar00rootroot00000000000000GIF89a NEyyTGJNPQRSUbceghhpplwyyz{~!?,|pH!ŤCШȤ 1}ճrx=j&4\>=,C  -o)*% O$"!!#  Wm o o RPJA;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/elcl16/properties_tsk.gif000066400000000000000000000001661272114001700322460ustar00rootroot00000000000000GIF89a___俿!,;x-I @fSFé p,-+P97Qf$- @;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/elcl16/rem_co.gif000066400000000000000000000002431272114001700304310ustar00rootroot00000000000000GIF89axxxppphhh```! ,PPI؈*56u!Aajpqla  "Q<&0Da:CPNX)+ lւDx%;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/eview16/000077500000000000000000000000001272114001700266775ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/icons/eview16/terminal_view.gif000066400000000000000000000016521272114001700322370ustar00rootroot00000000000000GIF89afff33324ff3ffMMM!,@H @! p E#pЁ(d@$YqKLtB‘2  8%Jt*yb/ lP"0W洩ׯсȑ3'8a,@pg@;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/plugin.properties000066400000000000000000000011211272114001700277050ustar00rootroot00000000000000########################################################################## # Copyright (c) 2015 QNX Software 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 ########################################################################## pluginName=Remote Console pluginProvider=Eclipse PTP terminal.console.name=Command Shell Console OpenTerminalCommand.name=Open Command Shell org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/plugin.xml000066400000000000000000000032521272114001700263200ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/pom.xml000066400000000000000000000012131272114001700256100ustar00rootroot00000000000000 4.0.0 org.eclipse.remote remote-parent 2.1.0-SNAPSHOT ../../releng/org.eclipse.remote.build/pom.xml org.eclipse.remote.console eclipse-plugin 1.1.0-SNAPSHOT org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/ptp_logo_icon32.png000066400000000000000000001476271272114001700300250ustar00rootroot00000000000000PNG  IHDR VόsBIT|d pHYs  ~tEXtSoftwareAdobe Fireworks CS3F:prVWxn18cw^ mL@ApD{E**Ur ^GGo#T G6^7gfq*ND׼iu3&obkfJ꺪ouU8>iU*Vot*aYkUσaaaaRD2{ϡ㌑ @ rcR Zu-P2/ L# .nI>sN;3#7r;J-Ʒ֍,6h> j[jI4IfZ) a\4->Dg9HR]kz :! Euan+cQ0 0 ,S!UOaaɀnu鯋X﯏b3*wo6ԣjvNN^?-OQ%1 Z&&gǻUυaU~5ɟfFHmkBF)37!mkTSx}[sƲ.vVlG|KVe?U}<% 7EQSCPvdKxOw .HʁYH |MwO}}zܴ'7ƴ;؊lܘ7qo˿ѧo^ǿp49:\~w}ß卶4O{vN><3(1_D 8:#]ylMvgއlANʜ]ڴ{6[]=A6hsv:}@>mY]}Jfo[yҧC /9hӅ&lLp3-6M{ouK(/3㖘wَv|>Bٕ6fL2ѕx^ =ɰ6e &iN;e4uj5v/|AFP-PQ0„YB-iYhJηwBf%F!CڦxyPA7|ƹV7cu4l~+SH::ad ly[9CHPzHw(RC2 #sEȘ;J/(uHF0fU\6ծr<3VTc0 &00Àv>pG3A3htΠ4z,Ӭg)=F-}CZm~\߆_BAWœL,%DTFFd?rfuFɠ2T6fP3V[!vf1 c.P]- "p 0:̇ UsŐlMhZsY?/c6X7]4DJ=tD{"#DdnC 3d6B̅ړdy l*fʟÈ_/&f^"Fe v3H$>6/!~m` N80Ŧ p5'o8jd;ZM)FZ W~̰yzi;Q8E@d)I3˃5ɴƤtaW[4d|%c7>d i&(YyXlU"7{%#|֍zd\ g[GcjJ ,mJ6C)jE0)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[m\G~oH]QbV6Z&PCAp 8#q {ԩ_`a]kGTԮ~͜ҒߔG/ɨb}߯ p-\_4˳.o/̰W_|=R*!;bQ{/Şr.xޝJ᳾rg㢁B C0Kɬz ǒِn;DN1,'sbl+֯>Nx0#+-A!`hm W`A^ztayzO^ihvGt~5gGׯBm,4;CQ+nKuuk̯=_EQo),@T|,Wka!'&WT a?|ED> me(F*B{.vS}@DNs')?"HyIENDB`org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/schema/000077500000000000000000000000001272114001700255365ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/schema/consoleToolbar.exsd000066400000000000000000000110211272114001700314030ustar00rootroot00000000000000 This extension point allows contributions to the TerminalConsole for various types of connections. It associates an action id with a connection type and factory. Identifier for this action The connection type this Action applies to A class implementing IConsoleActionFactory to be called to create the Action <extension point="org.eclipse.remote.console.toolbar"> <action actionFactory="com.example.actions.MyActionFactory" connectionType="org.eclipse.remote.serial.core.connectionType" id="com.example.actions.MyAction"> </action> </extension> The value of the actionFactory attribute must implement the abstract class <code>org.eclipse.remote.console.ConsoleAction</code> The value of the connectionType attribute should reference the id of a connectionType under the org.eclipse.remote.core.remoteServices extension point. The package itself does not have any predefined toolbar contributions. /******************************************************************************* * Copyright (c) 2016 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/000077500000000000000000000000001272114001700250655ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/000077500000000000000000000000001272114001700256545ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/000077500000000000000000000000001272114001700273005ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/000077500000000000000000000000001272114001700305735ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/console/000077500000000000000000000000001272114001700322355ustar00rootroot00000000000000TerminalConsoleUtility.java000066400000000000000000000031351272114001700375050ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/console/******************************************************************************* * Copyright (c) 2015 Red Hat Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Red Hat Inc. - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.console; import java.util.List; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.internal.console.TerminalConsoleFactory; import org.eclipse.ui.console.IConsole; /** * A collection of public API utility methods to open consoles to * IRemoteConnection objects * * @since 1.1 */ public class TerminalConsoleUtility { /** * Opens a dialog to allow selection of an IRemoteConnection, encoding, etc. * and then open a console to it. */ public void openConsole() { new TerminalConsoleFactory().openConsole(); } /** * Open a specific IRemoteConnection and encoding combination. * * @param connection * @param encoding */ public static void openConsole(final IRemoteConnection connection, final String encoding) { TerminalConsoleFactory.openConsole(connection, encoding); } /** * Find an existing console for the given IRemoteConnection * * @param connection * @return */ public static List findConsole(IRemoteConnection connection) { return TerminalConsoleFactory.findConsole(connection); } } org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/console/actions/000077500000000000000000000000001272114001700336755ustar00rootroot00000000000000ConsoleAction.java000066400000000000000000000071121272114001700372220ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/console/actions/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.console.actions; import org.eclipse.jface.action.Action; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageRegistry; import org.eclipse.remote.internal.console.Activator; /** * An abstract class to implement basic functionality common to terminal console actions * @since 1.1 */ public abstract class ConsoleAction extends Action { /** * @param id * The action id */ public ConsoleAction(String id) { this(id, 0); } /** * @param id * The action id * @param style * one of AS_PUSH_BUTTON, AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_RADIO_BUTTON, * and AS_UNSPECIFIED */ public ConsoleAction(String id, int style) { super("", style); //$NON-NLS-1$ setId(id); } /** * @param text * the text for this action * @param tooltip * the tooltip for this action * @param image * the image key for this action * @param enabledImage * the enabled image key for this action * @param disabledImage * the disabled image key for this action * @param enabled * the enabled state for this action */ protected void setupAction(String text, String tooltip, String image, String enabledImage, String disabledImage, boolean enabled) { ImageRegistry imageRegistry = Activator.getDefault().getImageRegistry(); setupAction(text, tooltip, image, enabledImage, disabledImage, enabled, imageRegistry); } /** * @param text * the text for this action * @param tooltip * the tooltip for this action * @param hoverImage * the hover image key for this action * @param enabledImage * the enabled image key for this action * @param disabledImage * the disabled image key for this action * @param enabled * the enabled state for this action * @param imageRegistry * the ImageRegistry to retrieve ImageDescriptor for the keys provided */ protected void setupAction(String text, String tooltip, String hoverImage, String enabledImage, String disabledImage, boolean enabled, ImageRegistry imageRegistry) { setupAction(text, tooltip, imageRegistry.getDescriptor(hoverImage), imageRegistry.getDescriptor(enabledImage), imageRegistry.getDescriptor(disabledImage), enabled); } /** * @param text * the text for this action * @param tooltip * the tooltip for this action * @param hoverImage * the hover image for this action * @param enabledImage * the enabled image for this action * @param disabledImage * the disabled image for this action * @param enabled * the enabled state for this action */ protected void setupAction(String text, String tooltip, ImageDescriptor hoverImage, ImageDescriptor enabledImage, ImageDescriptor disabledImage, boolean enabled) { setText(text); setToolTipText(tooltip); setEnabled(enabled); if (enabledImage != null) { setImageDescriptor(enabledImage); } if (disabledImage != null) { setDisabledImageDescriptor(disabledImage); } if (hoverImage != null) { setHoverImageDescriptor(hoverImage); } } } IConsoleActionFactory.java000066400000000000000000000022301272114001700406570ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/console/actions/******************************************************************************* * Copyright (c) 2016 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.console.actions; import org.eclipse.core.runtime.IAdaptable; /** * @since 1.1 */ public interface IConsoleActionFactory { /** * Returns an implementation of ConsoleAction * * @param actionId * The id of the action being requested * @param connectionType * The connection type of the terminal console * @param adapter * An adapter to get relevant objects for use by the ConsoleAction being created (eg. IRemoteConnection) * @return an implementation of ConsoleAction */ public ConsoleAction createAction(String actionId, String connectionType, IAdaptable adapter); } org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/000077500000000000000000000000001272114001700324075ustar00rootroot00000000000000console/000077500000000000000000000000001272114001700337725ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internalActivator.java000066400000000000000000000114651272114001700366000ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/consolepackage org.eclipse.remote.internal.console; import java.net.MalformedURLException; import java.net.URL; import java.util.HashMap; import java.util.Map.Entry; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageRegistry; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; /** * The activator class controls the plug-in life cycle */ public class Activator extends AbstractUIPlugin { // The plug-in ID public static final String PLUGIN_ID = "org.eclipse.remote.console"; //$NON-NLS-1$ // The shared instance private static Activator plugin; public void start(BundleContext context) throws Exception { super.start(context); plugin = this; } public void stop(BundleContext context) throws Exception { plugin = null; super.stop(context); } public static Activator getDefault() { return plugin; } @Override protected void initializeImageRegistry(ImageRegistry imageRegistry) { HashMap map = new HashMap<>(); try { // Local toolbars map.put(ImageConsts.IMAGE_NEW_TERMINAL, "newterminal.gif"); //$NON-NLS-1$ map.put(ImageConsts.IMAGE_CLCL_CONNECT, "connect_co.gif"); //$NON-NLS-1$ map.put(ImageConsts.IMAGE_CLCL_DISCONNECT, "disconnect_co.gif"); //$NON-NLS-1$ map.put(ImageConsts.IMAGE_CLCL_SETTINGS, "properties_tsk.gif"); //$NON-NLS-1$ map.put(ImageConsts.IMAGE_CLCL_COMMAND_INPUT_FIELD, "command_input_field.gif"); //$NON-NLS-1$ map.put(ImageConsts.IMAGE_CLCL_SCROLL_LOCK, "lock_co.gif"); //$NON-NLS-1$ loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_LOCALTOOL, map); map.clear(); // Enabled local toolbars map.put(ImageConsts.IMAGE_NEW_TERMINAL, "newterminal.gif"); //$NON-NLS-1$ map.put(ImageConsts.IMAGE_ELCL_CONNECT, "connect_co.gif"); //$NON-NLS-1$ map.put(ImageConsts.IMAGE_ELCL_DISCONNECT, "disconnect_co.gif"); //$NON-NLS-1$ map.put(ImageConsts.IMAGE_ELCL_SETTINGS, "properties_tsk.gif"); //$NON-NLS-1$ map.put(ImageConsts.IMAGE_ELCL_COMMAND_INPUT_FIELD, "command_input_field.gif"); //$NON-NLS-1$ map.put(ImageConsts.IMAGE_ELCL_SCROLL_LOCK, "lock_co.gif"); //$NON-NLS-1$ map.put(ImageConsts.IMAGE_ELCL_REMOVE, "rem_co.gif"); //$NON-NLS-1$ loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_ELCL, map); map.clear(); // Disabled local toolbars map.put(ImageConsts.IMAGE_NEW_TERMINAL, "newterminal.gif"); //$NON-NLS-1$ map.put(ImageConsts.IMAGE_DLCL_CONNECT, "connect_co.gif"); //$NON-NLS-1$ map.put(ImageConsts.IMAGE_DLCL_DISCONNECT, "disconnect_co.gif"); //$NON-NLS-1$ map.put(ImageConsts.IMAGE_DLCL_SETTINGS, "properties_tsk.gif"); //$NON-NLS-1$ map.put(ImageConsts.IMAGE_DLCL_COMMAND_INPUT_FIELD, "command_input_field.gif"); //$NON-NLS-1$ map.put(ImageConsts.IMAGE_DLCL_SCROLL_LOCK, "lock_co.gif"); //$NON-NLS-1$ map.put(ImageConsts.IMAGE_DLCL_REMOVE, "rem_co.gif"); //$NON-NLS-1$ loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_DLCL, map); map.clear(); map.put(ImageConsts.IMAGE_TERMINAL_VIEW, "terminal_view.gif"); //$NON-NLS-1$ loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_EVIEW, map); map.clear(); } catch (MalformedURLException malformedURLException) { malformedURLException.printStackTrace(); } } protected void loadImageRegistry(ImageRegistry imageRegistry, String strDir, HashMap map) throws MalformedURLException { ImageDescriptor imageDescriptor; for (Entry entry : map.entrySet()) { URL url = plugin.getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + strDir + entry.getValue()); imageDescriptor = ImageDescriptor.createFromURL(url); imageRegistry.put(entry.getKey(), imageDescriptor); } } /** * Create log entry from an IStatus * * @param status * status to log */ public static void log(IStatus status) { getDefault().getLog().log(status); } /** * Create log entry from a string * * @param msg * message to log */ public static void log(String msg) { log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, msg, null)); } /** * Create log entry from a Throwable * * @param e * throwable to log */ public static void log(Throwable e) { log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, e.getMessage(), e)); } /** * Return the OSGi service with the given service interface. * * @param service * service interface * @return the specified service or null if it's not registered */ public static T getService(Class service) { final BundleContext context = plugin.getBundle().getBundleContext(); final ServiceReference ref = context.getServiceReference(service); return ref != null ? context.getService(ref) : null; } } ConsoleMessages.java000066400000000000000000000024041272114001700377270ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.console; import org.eclipse.osgi.util.NLS; public class ConsoleMessages extends NLS { static { NLS.initializeMessages(ConsoleMessages.class.getName(), ConsoleMessages.class); } public static String SELECT_CONNECTION; public static String ENCODING_UNAVAILABLE_0; public static String ENCODING_UNAVAILABLE_1; public static String ENCODING; public static String OPEN_CONSOLE_ERROR; public static String STATUS; public static String STATUS_CONNECTED; public static String STATUS_CONNECTING; public static String STATUS_CLOSED; public static String CONNECTING_TO_TERMINAL; public static String OPENNING_TERMINAL; public static String MAKING_CONNECTION; public static String DISCONNECTING; } ConsoleMessages.properties000066400000000000000000000021171272114001700412030ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console################################################################################ # Copyright (c) 2015 QNX Software Systems and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # QNX Software Systems - Initial API and implementation ################################################################################ SELECT_CONNECTION = Select Remote Connection ENCODING_UNAVAILABLE_0 = Unable to set Encoding ENCODING_UNAVAILABLE_1 = Encoding {0} is unavailable! ENCODING = Encoding: OPEN_CONSOLE_ERROR = Error Opening Command Shell Console STATUS = Status: STATUS_CONNECTED = CONNECTED STATUS_CONNECTING = CONNECTING... STATUS_CLOSED = CLOSED CONNECTING_TO_TERMINAL = Connecting to Command Shell OPENNING_TERMINAL = Openning Command Shell MAKING_CONNECTION = Making Connection DISCONNECTING = Disconnecting ImageConsts.java000066400000000000000000000072551272114001700370620ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/******************************************************************************* * Copyright (c) 2003, 2015 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 * * Initial Contributors: * The following Wind River employees contributed to the Terminal component * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, * Helmut Haigermoser and Ted Williams. * * Contributors: * Michael Scharf (Wind River) - extracted from TerminalConsts * Martin Oberhuber (Wind River) - fixed copyright headers and beautified * Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin * Michael Scharf (Wind River) - [172483] added some more icons * Michael Scharf (Wind River) - [240023] Get rid of the terminal's "Pin" button *******************************************************************************/ package org.eclipse.remote.internal.console; public interface ImageConsts { public final static String IMAGE_DIR_ROOT = "icons/"; //$NON-NLS-1$ public final static String IMAGE_DIR_LOCALTOOL = "clcl16/"; // basic colors - size 16x16 //$NON-NLS-1$ public final static String IMAGE_DIR_DLCL = "dlcl16/"; // disabled - size 16x16 //$NON-NLS-1$ public final static String IMAGE_DIR_ELCL = "elcl16/"; // enabled - size 16x16 //$NON-NLS-1$ public final static String IMAGE_DIR_VIEW = "cview16/"; // views //$NON-NLS-1$ public final static String IMAGE_DIR_EVIEW = "eview16/"; // views //$NON-NLS-1$ public static final String IMAGE_NEW_TERMINAL = "TerminalViewNewTerminal"; //$NON-NLS-1$ public static final String IMAGE_TERMINAL_VIEW = "TerminalView"; //$NON-NLS-1$ public static final String IMAGE_CLCL_CONNECT = "ImageClclConnect"; //$NON-NLS-1$ public static final String IMAGE_CLCL_DISCONNECT = "ImageClclDisconnect"; //$NON-NLS-1$ public static final String IMAGE_CLCL_SETTINGS = "ImageClclSettings"; //$NON-NLS-1$ public static final String IMAGE_CLCL_SCROLL_LOCK = "ImageClclScrollLock"; //$NON-NLS-1$ public static final String IMAGE_DLCL_CONNECT = "ImageDlclConnect"; //$NON-NLS-1$ public static final String IMAGE_DLCL_DISCONNECT = "ImageDlclDisconnect"; //$NON-NLS-1$ public static final String IMAGE_DLCL_SETTINGS = "ImageDlclSettings"; //$NON-NLS-1$ public static final String IMAGE_DLCL_SCROLL_LOCK = "ImageDlclScrollLock"; //$NON-NLS-1$ public static final String IMAGE_DLCL_REMOVE = "ImageDlclRemove"; //$NON-NLS-1$ public static final String IMAGE_ELCL_CONNECT = "ImageElclConnect"; //$NON-NLS-1$ public static final String IMAGE_ELCL_DISCONNECT = "ImageElclDisconnect"; //$NON-NLS-1$ public static final String IMAGE_ELCL_SETTINGS = "ImageElclSettings"; //$NON-NLS-1$ public static final String IMAGE_ELCL_SCROLL_LOCK = "ImageElclScrollLock"; //$NON-NLS-1$ public static final String IMAGE_ELCL_REMOVE = "ImageElclRemove"; //$NON-NLS-1$ public static final String IMAGE_CLCL_COMMAND_INPUT_FIELD = "ImageClclCommandInputField";//$NON-NLS-1$ public static final String IMAGE_ELCL_COMMAND_INPUT_FIELD = "ImageDlclCommandInputField";//$NON-NLS-1$ public static final String IMAGE_DLCL_COMMAND_INPUT_FIELD = "ImageDlclCommandInputField";//$NON-NLS-1$ } TerminalConsole.java000066400000000000000000000054251272114001700377410ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.console; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; import org.eclipse.ui.console.AbstractConsole; import org.eclipse.ui.console.IConsoleView; import org.eclipse.ui.part.IPageBookViewPage; import org.eclipse.ui.progress.UIJob; public class TerminalConsole extends AbstractConsole { private final String encoding; private final TerminalConsoleConnector terminalConnector; private final int index; public TerminalConsole(IRemoteConnection connection, int index, String encoding) { super(connection.getName(), Activator.getDefault().getImageRegistry().getDescriptor(ImageConsts.IMAGE_TERMINAL_VIEW)); this.encoding = encoding; this.terminalConnector = new TerminalConsoleConnector(connection); this.index = index; } public TerminalConsoleConnector getTerminalConnector() { return terminalConnector; } public IRemoteConnection getConnection() { return terminalConnector.getConnection(); } public int getIndex() { return index; } public synchronized void setState(TerminalState terminalState) { StringBuffer nameBuff = new StringBuffer(getConnection().getName()); if (index > 0) { nameBuff.append(' '); nameBuff.append(String.valueOf(index)); } nameBuff.append(" ("); //$NON-NLS-1$ if (terminalState == TerminalState.CLOSED) { nameBuff.append(ConsoleMessages.STATUS_CLOSED); } else if (terminalState == TerminalState.CONNECTED) { nameBuff.append(ConsoleMessages.STATUS_CONNECTED); } else if (terminalState == TerminalState.CONNECTING) { nameBuff.append(ConsoleMessages.STATUS_CONNECTING); } nameBuff.append(")"); //$NON-NLS-1$ final String name = nameBuff.toString(); if (!name.equals(getName())) { UIJob job = new UIJob("updating name") { //$NON-NLS-1$ public IStatus runInUIThread(IProgressMonitor monitor) { TerminalConsole.this.setName(name); return Status.OK_STATUS; } }; job.setSystem(true); job.schedule(); } } public IPageBookViewPage createPage(IConsoleView view) { view.setFocus(); return new TerminalConsolePage(this, encoding); } } TerminalConsoleConnector.java000066400000000000000000000176301272114001700416150ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.console; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.PlatformObject; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.remote.core.IRemoteCommandShellService; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteProcess; import org.eclipse.remote.core.IRemoteProcessBuilder; import org.eclipse.remote.core.IRemoteProcessTerminalService; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; public class TerminalConsoleConnector { private final IRemoteConnection connection; private IRemoteProcess remoteProcess; private PageConnector[] pageConnectors = new PageConnector[0]; private int width, height; private TerminalState state = TerminalState.CLOSED; private class OutThread extends Thread { public OutThread() { super("Terminal Output"); //$NON-NLS-1$ } @Override public void run() { try { byte[] buff = new byte[1024]; if (remoteProcess != null) { InputStream in = remoteProcess.getInputStream(); for (int n = in.read(buff); n >= 0; n = in.read(buff)) { for (PageConnector connector : pageConnectors) { ITerminalControl control = connector.control; if (control != null) { control.getRemoteToTerminalOutputStream().write(buff, 0, n); } } } } setState(TerminalState.CLOSED); synchronized (TerminalConsoleConnector.this) { outThread = null; } } catch (IOException e) { Activator.log(e); } } } private OutThread outThread; public TerminalConsoleConnector(IRemoteConnection connection) { this.connection = connection; } public IRemoteConnection getConnection() { return connection; } public ITerminalConnector newPageConnector() { PageConnector connector = new PageConnector(); List list = new ArrayList<>(Arrays.asList(pageConnectors)); list.add(connector); pageConnectors = list.toArray(new PageConnector[list.size()]); return connector; } private void disposePageConnector(PageConnector connector) { List list = new ArrayList<>(Arrays.asList(pageConnectors)); list.remove(connector); pageConnectors = list.toArray(new PageConnector[list.size()]); if (list.isEmpty()) { // All gone, disconnect disconnect(); } } private synchronized void setState(TerminalState state) { this.state = state; for (PageConnector connector : pageConnectors) { ITerminalControl control = connector.control; if (control != null) { connector.control.setState(state); } } } public synchronized void connect() { if (state != TerminalState.CLOSED) { return; } new Job(ConsoleMessages.MAKING_CONNECTION) { @Override protected IStatus run(IProgressMonitor monitor) { // make sure we're only doing this one at a time // second and further controls will inherit much of this synchronized (TerminalConsoleConnector.this) { setState(TerminalState.CONNECTING); if (remoteProcess == null || remoteProcess.isCompleted()) { try { // We'll need a new one if (!connection.isOpen()) { try { connection.open(monitor); } catch (RemoteConnectionException e) { return e.getStatus(); } } remoteProcess = connection.getService(IRemoteCommandShellService.class) .getCommandShell(IRemoteProcessBuilder.ALLOCATE_PTY); } catch (IOException e) { Activator.log(e); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getLocalizedMessage(), e); } } if (width > 0 || height > 0) { IRemoteProcessTerminalService termService = remoteProcess.getService(IRemoteProcessTerminalService.class); if (termService != null) { termService.setTerminalSize(width, height, 8 * width, 8 * height); } } if (outThread == null) { outThread = new OutThread(); outThread.start(); } setState(TerminalState.CONNECTED); return Status.OK_STATUS; } } }.schedule(); } public void disconnect() { if (remoteProcess != null && !remoteProcess.isCompleted()) { new Job(ConsoleMessages.DISCONNECTING) { @Override protected IStatus run(IProgressMonitor monitor) { remoteProcess.destroy(); return Status.OK_STATUS; } }.schedule(); } } private void setTerminalSize() { int minWidth = Integer.MAX_VALUE; int minHeight = Integer.MAX_VALUE; for (PageConnector connector : pageConnectors) { if (connector.myWidth < minWidth) { minWidth = connector.myWidth; } if (connector.myHeight < minHeight) { minHeight = connector.myHeight; } } // Weird but the terminal has wrapping issues at this width, need to reduce it by 4. minWidth -= 4; if (minWidth != width || minHeight != height) { width = minWidth; height = minHeight; synchronized (this) { if (remoteProcess != null) { IRemoteProcessTerminalService termService = remoteProcess.getService(IRemoteProcessTerminalService.class); if (termService != null) { termService.setTerminalSize(width, height, 8 * width, 8 * height); } } } } } private class PageConnector extends PlatformObject implements ITerminalConnector { private int myWidth, myHeight; private ITerminalControl control; @Override public OutputStream getTerminalToRemoteStream() { return remoteProcess != null ? remoteProcess.getOutputStream() : null; } @Override public void connect(final ITerminalControl control) { this.control = control; control.setVT100LineWrapping(true); TerminalConsoleConnector.this.connect(); if (!control.getState().equals(state)) { control.setState(state); } } @Override public synchronized void disconnect() { disposePageConnector(this); } @Override public void setTerminalSize(int newWidth, int newHeight) { if (newWidth != myWidth || newHeight != myHeight) { myWidth = newWidth; myHeight = newHeight; TerminalConsoleConnector.this.setTerminalSize(); } } @Override public String getId() { // No id, we're magic return null; } @Override public String getName() { // No name return null; } @Override public boolean isHidden() { // in case we do leak into the TM world, we shouldn't be visible return true; } @Override public boolean isInitialized() { return true; } @Override public String getInitializationErrorMessage() { return null; } @Override public boolean isLocalEcho() { // TODO should the be a property of the connection? return false; } @Override public void setDefaultSettings() { // we don't do settings } @Override public String getSettingsSummary() { // we don't do settings return null; } @Override public void load(ISettingsStore arg0) { // we don't do settings } @Override public void save(ISettingsStore arg0) { // we don't do settings } } } TerminalConsoleExtensionManager.java000066400000000000000000000057741272114001700431400ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/******************************************************************************* * Copyright (c) 2016 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.console; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtension; import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.Platform; import org.eclipse.remote.console.actions.IConsoleActionFactory; public class TerminalConsoleExtensionManager { private static TerminalConsoleExtensionManager instance; private Map> actions; private Map factories; private Map elements; private TerminalConsoleExtensionManager() { } public static TerminalConsoleExtensionManager getInstance() { if (instance == null) { instance = new TerminalConsoleExtensionManager(); } return instance; } public List getActionsForType(String id) { initialize(); List list = actions.get(id); return list == null ? new ArrayList() : list; } public IConsoleActionFactory getFactory(String id) { return factories.get(id); } private void initialize() { if (actions == null) { actions = new LinkedHashMap<>(); elements = new LinkedHashMap<>(); factories = new HashMap<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint point = registry .getExtensionPoint(Activator.getDefault().getBundle().getSymbolicName() + ".toolbar"); for (IExtension extension : point.getExtensions()) { for (IConfigurationElement element : extension.getConfigurationElements()) { String id = element.getAttribute("id"); //$NON-NLS-1$ if (id != null) { elements.put(id, element); IConsoleActionFactory factory = null; try { factory = (IConsoleActionFactory) element.createExecutableExtension("actionFactory"); } catch (CoreException e) { Activator.log(e); } if (factory != null) { String connectionType = element.getAttribute("connectionType"); if (connectionType != null) { List actionList = actions.get(connectionType); if (actionList == null) { actionList = new ArrayList<>(); } actionList.add(id); actions.put(connectionType, actionList); factories.put(id, factory); } } } } } } } } TerminalConsoleFactory.java000066400000000000000000000103511272114001700412630ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.console; import java.util.ArrayList; import java.util.List; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.window.Window; import org.eclipse.remote.core.IRemoteCommandShellService; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.console.ConsolePlugin; import org.eclipse.ui.console.IConsole; import org.eclipse.ui.console.IConsoleFactory; import org.eclipse.ui.console.IConsoleManager; public class TerminalConsoleFactory implements IConsoleFactory { @Override public void openConsole() { final TerminalConsoleSettingsDialog settingsDialog = new TerminalConsoleSettingsDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); if (settingsDialog.open() == Window.OK) { openConsole(settingsDialog.getRemoteConnection(), settingsDialog.getEncoding()); } } public static void openConsole(final IRemoteConnection connection, final String encoding) { Job j = new Job(ConsoleMessages.OPENNING_TERMINAL) { @Override public IStatus run(IProgressMonitor monitor) { return openConsoleImplementation(connection, encoding, monitor); } }; j.schedule(); } private static IStatus openConsoleImplementation(final IRemoteConnection connection, final String encoding, IProgressMonitor monitor) { IRemoteCommandShellService commandShellService = connection.getService(IRemoteCommandShellService.class); if (commandShellService == null) { return Status.CANCEL_STATUS; } try { createConsole(connection, encoding, commandShellService, monitor); return Status.OK_STATUS; } catch (RemoteConnectionException rce) { return rce.getStatus(); } } private static IConsole createConsole(final IRemoteConnection connection, final String encoding, IRemoteCommandShellService service, IProgressMonitor monitor) throws RemoteConnectionException { if (!connection.isOpen()) { connection.open(monitor); } // TODO, how to handle command shells that are singletons, like serial ports IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager(); // Find the next index; int index = findNextIndex(consoleManager, connection); TerminalConsole terminalConsole = new TerminalConsole(connection, index, encoding); consoleManager.addConsoles(new IConsole[] { terminalConsole }); consoleManager.showConsoleView(terminalConsole); return terminalConsole; } private static int findNextIndex(IConsoleManager consoleManager, IRemoteConnection connection) { IConsole[] consoles = consoleManager.getConsoles(); boolean[] indices = new boolean[consoles.length]; for (IConsole console : consoles) { if (console instanceof TerminalConsole) { TerminalConsole terminalConsole = (TerminalConsole) console; if (terminalConsole.getConnection().equals(connection)) { indices[terminalConsole.getIndex()] = true; } } } int index = 0; while (index < indices.length && indices[index]) { index++; } return index; } public static List findConsole(IRemoteConnection connection) { ArrayList ret = new ArrayList(); IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager(); IConsole[] consoles = consoleManager.getConsoles(); for (IConsole console : consoles) { if (console instanceof TerminalConsole) { TerminalConsole terminalConsole = (TerminalConsole) console; if (terminalConsole.getConnection().equals(connection)) { ret.add(terminalConsole); } } } return ret; } }TerminalConsolePage.java000066400000000000000000000165531272114001700405420ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.console; import java.io.UnsupportedEncodingException; import java.util.List; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.action.GroupMarker; import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.osgi.util.NLS; import org.eclipse.remote.console.actions.ConsoleAction; import org.eclipse.remote.console.actions.IConsoleActionFactory; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.internal.console.actions.ConsoleActionConnect; import org.eclipse.remote.internal.console.actions.ConsoleActionDisconnect; import org.eclipse.remote.internal.console.actions.ConsoleActionScrollLock; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.tm.internal.terminal.control.ITerminalListener; import org.eclipse.tm.internal.terminal.control.ITerminalViewControl; import org.eclipse.tm.internal.terminal.control.TerminalViewControlFactory; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector; import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.console.IConsoleConstants; import org.eclipse.ui.console.actions.CloseConsoleAction; import org.eclipse.ui.part.IPageSite; import org.eclipse.ui.part.Page; import org.eclipse.ui.progress.UIJob; public class TerminalConsolePage extends Page implements IAdaptable { public static final String TOOLBAR_GROUP_ID = "org.eclipse.remote.internal.terminal.console.Toolbar"; //$NON-NLS-1$ public static final String CONTRIBUTIONS_GROUP_ID = "org.eclipse.remote.internal.terminal.console.Toolbar.contributions"; //$NON-NLS-1$ private final ConsoleActionConnect connectAction; private final ConsoleActionDisconnect disconnectAction; private final TerminalConsole terminalConsole; private final String encoding; private Composite mainComposite; private ITerminalViewControl tViewCtrl; private Job connectTerminalJob = new ConnectTerminalJob(); private final ITerminalListener listener = new ITerminalListener() { @Override public void setState(TerminalState state) { if (state == TerminalState.CONNECTING || state == TerminalState.CONNECTED) { disconnectAction.setEnabled(true); connectAction.setEnabled(false); } else if (state == TerminalState.CLOSED) { disconnectAction.setEnabled(false); connectAction.setEnabled(true); } terminalConsole.setState(state); } @Override public void setTerminalTitle(final String title) { // ignore titles coming from the widget } }; public TerminalConsolePage(TerminalConsole console, String encoding) { terminalConsole = console; this.encoding = encoding; connectAction = new ConsoleActionConnect(console); disconnectAction = new ConsoleActionDisconnect(console); } public TerminalConsole getConsole() { return terminalConsole; } @Override public void init(IPageSite pageSite) { super.init(pageSite); IToolBarManager toolBarManager = pageSite.getActionBars().getToolBarManager(); toolBarManager.insertBefore(IConsoleConstants.OUTPUT_GROUP, new GroupMarker(TOOLBAR_GROUP_ID)); toolBarManager.appendToGroup(TOOLBAR_GROUP_ID, connectAction); toolBarManager.appendToGroup(TOOLBAR_GROUP_ID, disconnectAction); toolBarManager.appendToGroup(TOOLBAR_GROUP_ID, new ConsoleActionScrollLock(this)); toolBarManager.appendToGroup(TOOLBAR_GROUP_ID, new CloseConsoleAction(terminalConsole)); toolBarManager.insertAfter(TOOLBAR_GROUP_ID, new GroupMarker(CONTRIBUTIONS_GROUP_ID)); addToolbarContributions(toolBarManager); } private void addToolbarContributions(IToolBarManager toolBarManager) { String connectionType = terminalConsole.getConnection().getConnectionType().getId(); List actions = TerminalConsoleExtensionManager.getInstance().getActionsForType(connectionType); for (String id : actions) { IConsoleActionFactory factory = TerminalConsoleExtensionManager.getInstance().getFactory(id); if (factory != null) { ConsoleAction action = factory.createAction(id, connectionType, this); if (action != null) { toolBarManager.appendToGroup(CONTRIBUTIONS_GROUP_ID, action); } } } } @Override public void createControl(Composite parent) { mainComposite = new Composite(parent, SWT.NONE); mainComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); mainComposite.setLayout(new FillLayout()); tViewCtrl = TerminalViewControlFactory.makeControl(listener, mainComposite, new ITerminalConnector[] {}); tViewCtrl.setConnector(terminalConsole.getTerminalConnector().newPageConnector()); try { tViewCtrl.setEncoding(encoding); } catch (UnsupportedEncodingException e) { IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, NLS.bind(ConsoleMessages.ENCODING_UNAVAILABLE_1, encoding)); Activator.log(status); ErrorDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(), ConsoleMessages.OPEN_CONSOLE_ERROR, ConsoleMessages.ENCODING_UNAVAILABLE_0, status); } connectTerminalJob.schedule(); } @Override public Control getControl() { return mainComposite; } @Override public void setFocus() { tViewCtrl.setFocus(); } @Override public void dispose() { tViewCtrl.disposeTerminal(); super.dispose(); } public TerminalState getTerminalState() { return tViewCtrl.getState(); } public void connectTerminal() { if (!tViewCtrl.isConnected()) { connectTerminalJob.schedule(); } } public void disconnectTerminal() { if (tViewCtrl.getState() != TerminalState.CLOSED) { tViewCtrl.disconnectTerminal(); } } public void setScrollLock(boolean enabled) { tViewCtrl.setScrollLock(enabled); } public boolean getScrollLock() { return tViewCtrl.isScrollLock(); } class ConnectTerminalJob extends UIJob { public ConnectTerminalJob() { super(ConsoleMessages.CONNECTING_TO_TERMINAL); setSystem(true); } @Override public IStatus runInUIThread(IProgressMonitor monitor) { if (tViewCtrl != null && !tViewCtrl.isDisposed()) { tViewCtrl.clearTerminal(); tViewCtrl.connectTerminal(); } return Status.OK_STATUS; } } /* (non-Javadoc) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ @SuppressWarnings("unchecked") @Override public T getAdapter(Class adapter) { if (adapter.equals(IRemoteConnection.class)) { return (T) terminalConsole.getConnection(); } if (adapter.equals(TerminalConsole.class)) { return (T) terminalConsole; } if (adapter.equals(TerminalConsolePage.class)) { return (T) this; } return null; } } TerminalConsoleSettingsDialog.java000066400000000000000000000141251272114001700425770ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.console; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.List; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.window.IShellProvider; import org.eclipse.jface.window.Window; import org.eclipse.remote.core.IRemoteCommandShellService; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteProcessService; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.ui.widgets.RemoteConnectionWidget; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; public class TerminalConsoleSettingsDialog extends Dialog { private static final String CONNECTION_TYPE = "connectionType"; //$NON-NLS-1$ private static final String CONNECTION_NAME = "connectionName"; //$NON-NLS-1$ private static final String ENCODING = "encoding"; //$NON-NLS-1$ private RemoteConnectionWidget remoteConnWidget; private Combo encodingCombo; private String selectedEncoding; public TerminalConsoleSettingsDialog(IShellProvider parentShell) { this(parentShell.getShell()); } public TerminalConsoleSettingsDialog(Shell parentShell) { super(parentShell); } @Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); composite.setLayout(new GridLayout(2, false)); IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class); // TODO remove the remote process service once we get command shell available with ssh and local @SuppressWarnings("unchecked") List connTypes = manager.getConnectionTypesSupporting( IRemoteCommandShellService.class, IRemoteProcessService.class); remoteConnWidget = new RemoteConnectionWidget(composite, SWT.NONE, null, 0, connTypes); IDialogSettings settings = getDialogSettings(); String initialId = settings.get(CONNECTION_TYPE); String initialName = settings.get(CONNECTION_NAME); if (initialId != null && initialName != null) { remoteConnWidget.setConnection(initialId, initialName); } GridData gd = new GridData(); gd.horizontalSpan = 2; remoteConnWidget.setLayoutData(gd); remoteConnWidget.addSelectionListener(new ValidationSelectionListener()); Label encodingLabel = new Label(composite, SWT.NONE); encodingLabel.setLayoutData(new GridData()); encodingLabel.setText(ConsoleMessages.ENCODING); encodingCombo = new Combo(composite, SWT.READ_ONLY); encodingCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); int i = 0; String initialEncoding = settings.get(ENCODING); if (initialEncoding == null) { initialEncoding = Charset.defaultCharset().name(); } for (String encoding : getEncodings()) { encodingCombo.add(encoding); if (encoding.equals(initialEncoding)) { selectedEncoding = encoding; encodingCombo.select(i); } i++; } encodingCombo.addSelectionListener(new ValidationSelectionListener()); return composite; } private List getEncodings(){ List encodings = new ArrayList<>(2); encodings.add("ISO-8859-1"); //$NON-NLS-1$ encodings.add("UTF-8"); //$NON-NLS-1$ String hostEncoding = Charset.defaultCharset().name(); if (!encodings.contains(hostEncoding)) { encodings.add(hostEncoding); } return encodings; } @Override protected void createButtonsForButtonBar(Composite parent) { super.createButtonsForButtonBar(parent); validateDialog(); } @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); newShell.setText(ConsoleMessages.SELECT_CONNECTION); } private void validateDialog() { IRemoteConnection connection = remoteConnWidget.getConnection(); selectedEncoding = encodingCombo.getItem(encodingCombo.getSelectionIndex()); if (connection != null && selectedEncoding != null) { getButton(OK).setEnabled(true); } else { getButton(OK).setEnabled(false); } } /** * Get the remote connection selected in the dialog. */ public IRemoteConnection getRemoteConnection() { return remoteConnWidget.getConnection(); } /** * Get the encoding selected in the dialog. */ public String getEncoding() { return selectedEncoding; } class ValidationSelectionListener implements SelectionListener { @Override public void widgetSelected(SelectionEvent e) { validateDialog(); } @Override public void widgetDefaultSelected(SelectionEvent e) { validateDialog(); } } private IDialogSettings getDialogSettings() { IDialogSettings result = Activator.getDefault().getDialogSettings().getSection(TerminalConsoleSettingsDialog.class.getName()); if (result == null) { result = Activator.getDefault().getDialogSettings().addNewSection(TerminalConsoleSettingsDialog.class.getName()); } return result; } @Override public int open() { int rc = super.open(); if (rc == Window.OK) { // save the settings IDialogSettings settings = getDialogSettings(); IRemoteConnection connection = getRemoteConnection(); settings.put(CONNECTION_TYPE, connection.getConnectionType().getId()); settings.put(CONNECTION_NAME, connection.getName()); settings.put(ENCODING, getEncoding()); } return rc; } } actions/000077500000000000000000000000001272114001700354325ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/consoleActionMessages.java000066400000000000000000000015461272114001700412100ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.console.actions; import org.eclipse.osgi.util.NLS; public class ActionMessages extends NLS { static { NLS.initializeMessages(ActionMessages.class.getName(), ActionMessages.class); } public static String CONNECT; public static String DISCONNECT; public static String SCROLL_LOCK; } ActionMessages.properties000066400000000000000000000011421272114001700424530ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions################################################################################ # Copyright (c) 2015 QNX Software Systems and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # QNX Software Systems - Initial API and implementation ################################################################################ CONNECT = Connect DISCONNECT = Disconnect SCROLL_LOCK = Scroll LockConsoleActionConnect.java000066400000000000000000000023651272114001700423550ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.console.actions; import org.eclipse.remote.console.actions.ConsoleAction; import org.eclipse.remote.internal.console.ImageConsts; import org.eclipse.remote.internal.console.TerminalConsole; public class ConsoleActionConnect extends ConsoleAction { private final TerminalConsole console; public ConsoleActionConnect(TerminalConsole console) { super(ConsoleActionConnect.class.getName()); this.console = console; setupAction(ActionMessages.CONNECT, ActionMessages.CONNECT, ImageConsts.IMAGE_CLCL_CONNECT, ImageConsts.IMAGE_ELCL_CONNECT, ImageConsts.IMAGE_DLCL_CONNECT, true); } @Override public void run() { console.getTerminalConnector().connect(); } } ConsoleActionDisconnect.java000066400000000000000000000024251272114001700430520ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.console.actions; import org.eclipse.remote.console.actions.ConsoleAction; import org.eclipse.remote.internal.console.ImageConsts; import org.eclipse.remote.internal.console.TerminalConsole; public class ConsoleActionDisconnect extends ConsoleAction { private final TerminalConsole console; public ConsoleActionDisconnect(TerminalConsole console) { super(ConsoleActionDisconnect.class.getName()); this.console = console; setupAction(ActionMessages.DISCONNECT, ActionMessages.DISCONNECT, ImageConsts.IMAGE_CLCL_DISCONNECT, ImageConsts.IMAGE_ELCL_DISCONNECT, ImageConsts.IMAGE_DLCL_DISCONNECT, false); } @Override public void run() { console.getTerminalConnector().disconnect(); } } ConsoleActionScrollLock.java000066400000000000000000000025721272114001700430330ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.console.actions; import org.eclipse.jface.action.IAction; import org.eclipse.remote.console.actions.ConsoleAction; import org.eclipse.remote.internal.console.ImageConsts; import org.eclipse.remote.internal.console.TerminalConsolePage; public class ConsoleActionScrollLock extends ConsoleAction { private final TerminalConsolePage page; public ConsoleActionScrollLock(TerminalConsolePage page) { super(ConsoleActionScrollLock.class.getName(), IAction.AS_RADIO_BUTTON); this.page = page; setupAction(ActionMessages.SCROLL_LOCK, ActionMessages.SCROLL_LOCK, ImageConsts.IMAGE_CLCL_SCROLL_LOCK, ImageConsts.IMAGE_ELCL_SCROLL_LOCK, ImageConsts.IMAGE_DLCL_SCROLL_LOCK, true); } @Override public void run() { page.setScrollLock(!page.getScrollLock()); setChecked(page.getScrollLock()); } } OpenCommandShellHandler.java000066400000000000000000000021041272114001700427600ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actionspackage org.eclipse.remote.internal.console.actions; import java.nio.charset.Charset; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.internal.console.TerminalConsoleFactory; import org.eclipse.ui.handlers.HandlerUtil; public class OpenCommandShellHandler extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection(); if (selection != null && selection instanceof IStructuredSelection) { IRemoteConnection connection = (IRemoteConnection) ((IStructuredSelection) selection).iterator().next(); TerminalConsoleFactory.openConsole(connection, Charset.defaultCharset().name()); } return Status.OK_STATUS; } } org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/000077500000000000000000000000001272114001700235645ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/.classpath000066400000000000000000000005611272114001700255510ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/.gitignore000066400000000000000000000000051272114001700255470ustar00rootroot00000000000000/bin org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/.options000066400000000000000000000001211272114001700252520ustar00rootroot00000000000000org.eclipse.remote.core/debug=false org.eclipse.remote.core/debug/commands=false org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/.project000066400000000000000000000015161272114001700252360ustar00rootroot00000000000000 org.eclipse.remote.core org.eclipse.jdt.core.javabuilder org.eclipse.pde.ManifestBuilder org.eclipse.pde.SchemaBuilder org.eclipse.pde.api.tools.apiAnalysisBuilder org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.pde.api.tools.apiAnalysisNature org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/.settings/000077500000000000000000000000001272114001700255025ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/.settings/org.eclipse.jdt.core.prefs000066400000000000000000000011131272114001700324600ustar00rootroot00000000000000eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/META-INF/000077500000000000000000000000001272114001700247245ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/META-INF/MANIFEST.MF000066400000000000000000000020421272114001700263540ustar00rootroot00000000000000Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.remote.core;singleton:=true Bundle-Version: 2.1.0.qualifier Bundle-Activator: org.eclipse.remote.internal.core.RemoteCorePlugin Bundle-Vendor: %pluginProvider Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.remote.core, org.eclipse.remote.core.exception, org.eclipse.remote.core.launch, org.eclipse.remote.internal.core;x-friends:="org.eclipse.remote.ui,org.eclipse.remote.jsch.core", org.eclipse.remote.internal.core.preferences;x-friends:="org.eclipse.remote.ui" Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Import-Package: org.eclipse.cdt.utils.pty, org.eclipse.cdt.utils.spawner, org.eclipse.core.expressions, org.eclipse.core.filesystem, org.eclipse.core.resources, org.eclipse.core.runtime, org.eclipse.core.runtime.preferences, org.eclipse.debug.core, org.eclipse.equinox.security.storage, org.eclipse.osgi.service.debug, org.eclipse.osgi.util, org.osgi.framework, org.osgi.service.prefs org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/about.html000066400000000000000000000024471272114001700255730ustar00rootroot00000000000000 About

About This Content

May 2, 2006

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/about.ini000066400000000000000000000016471272114001700254070ustar00rootroot00000000000000# about.ini # contains information about a feature # java.io.Properties file (ISO 8859-1 with "\" escapes) # "%key" are externalized strings defined in about.properties # This file does not need to be translated. # Property "aboutText" contains blurb for "About" dialog (translated) aboutText=%blurb # Property "windowImage" contains path to window icon (16x16) # needed for primary features only # Property "featureImage" contains path to feature image (32x32) featureImage=ptp_logo_icon32.png # Property "aboutImage" contains path to product image (500x330 or 115x164) # needed for primary features only # Property "appName" contains name of the application (not translated) # needed for primary features only # Property "welcomePage" contains path to welcome page (special XML-based format) # optional # Property "welcomePerspective" contains the id of the perspective in which the # welcome page is to be opened. # optional org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/about.mappings000066400000000000000000000002501272114001700264330ustar00rootroot00000000000000# about.mappings # contains fill-ins for about.properties # java.io.Properties file (ISO 8859-1 with "\" escapes) # This file does not need to be translated. 0=@build@org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/about.properties000066400000000000000000000013761272114001700270230ustar00rootroot00000000000000############################################################################### # Copyright (c) 2005, 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 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # IBM Corporation - initial API and implementation ############################################################################### # NLS_MESSAGEFORMAT_NONE # NLS_ENCODING=UTF-8 blurb=Remote Services\n\ \n\ Version: {featureVersion}\n\ Build id: {0}\n\ \n\ Copyright (c) 2008 IBM Corporation, and others. All rights reserved.\n\ Visit http://www.eclipse.org/ptp\n org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/build.properties000066400000000000000000000004511272114001700270010ustar00rootroot00000000000000source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ plugin.xml,\ about.html,\ plugin.properties,\ about.ini,\ about.mappings,\ about.properties,\ ptp_logo_icon32.png org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/plugin.properties000066400000000000000000000007661272114001700272110ustar00rootroot00000000000000############################################################################### # Copyright (c) 2013 IBM Corporation. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # ############################################################################### pluginName=Remote Services Core pluginProvider=Eclipse PTP org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/plugin.xml000066400000000000000000000105131272114001700256040ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/pom.xml000066400000000000000000000012121272114001700250750ustar00rootroot00000000000000 4.0.0 org.eclipse.remote remote-parent 2.1.0-SNAPSHOT ../../releng/org.eclipse.remote.build/pom.xml org.eclipse.remote.core 2.1.0-SNAPSHOT eclipse-plugin org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/ptp_logo_icon32.png000066400000000000000000001476271272114001700273130ustar00rootroot00000000000000PNG  IHDR VόsBIT|d pHYs  ~tEXtSoftwareAdobe Fireworks CS3F:prVWxn18cw^ mL@ApD{E**Ur ^GGo#T G6^7gfq*ND׼iu3&obkfJ꺪ouU8>iU*Vot*aYkUσaaaaRD2{ϡ㌑ @ rcR Zu-P2/ L# .nI>sN;3#7r;J-Ʒ֍,6h> j[jI4IfZ) a\4->Dg9HR]kz :! Euan+cQ0 0 ,S!UOaaɀnu鯋X﯏b3*wo6ԣjvNN^?-OQ%1 Z&&gǻUυaU~5ɟfFHmkBF)37!mkTSx}[sƲ.vVlG|KVe?U}<% 7EQSCPvdKxOw .HʁYH |MwO}}zܴ'7ƴ;؊lܘ7qo˿ѧo^ǿp49:\~w}ß卶4O{vN><3(1_D 8:#]ylMvgއlANʜ]ڴ{6[]=A6hsv:}@>mY]}Jfo[yҧC /9hӅ&lLp3-6M{ouK(/3㖘wَv|>Bٕ6fL2ѕx^ =ɰ6e &iN;e4uj5v/|AFP-PQ0„YB-iYhJηwBf%F!CڦxyPA7|ƹV7cu4l~+SH::ad ly[9CHPzHw(RC2 #sEȘ;J/(uHF0fU\6ծr<3VTc0 &00Àv>pG3A3htΠ4z,Ӭg)=F-}CZm~\߆_BAWœL,%DTFFd?rfuFɠ2T6fP3V[!vf1 c.P]- "p 0:̇ UsŐlMhZsY?/c6X7]4DJ=tD{"#DdnC 3d6B̅ړdy l*fʟÈ_/&f^"Fe v3H$>6/!~m` N80Ŧ p5'o8jd;ZM)FZ W~̰yzi;Q8E@d)I3˃5ɴƤtaW[4d|%c7>d i&(YyXlU"7{%#|֍zd\ g[GcjJ ,mJ6C)jE0)#8;xh < h1H:QeX`(]zv9&3fLv941;E)Cv)=?R>1)vyha, Μzb>ሃ҈Ӝ3C LeԨMDe g[er6vb| $ǔ*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{/Şr.xޝJ᳾rg㢁B C0Kɬz ǒِn;DN1,'sbl+֯>Nx0#+-A!`hm W`A^ztayzO^ihvGt~5gGׯBm,4;CQ+nKuuk̯=_EQo),@T|,Wka!'&WT a?|ED> me(F*B{.vS}@DNs')?"HyIENDB`org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/schema/000077500000000000000000000000001272114001700250245ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/schema/authenticator.exsd000066400000000000000000000056101272114001700305650ustar00rootroot00000000000000 [Enter description of this extension point.] The ID of the remote services that this authenticator should be used for. An implementation of the IUserAuthenticator interface. The numerical value of the priority of the authenticator. The highest priority authenticator will be preferred over lower priority authenticators. [Enter the first release in which this extension point appears.] [Enter extension point usage example here.] [Enter API information here.] [Enter information about supplied implementation of this extension point.] org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/schema/processFactory.exsd000066400000000000000000000063221272114001700307220ustar00rootroot00000000000000 This extension point allows an alternate implementation of the java.lang.Runtime#exec() methods to be supplied. This is useful because the Java runtime provides limited support for controlling external processes. the fully qualified name of a class that implements <code>org.eclipse.remote.core.IProcessFactory</code> <pre> <extension point="org.eclipse.remote.core.processFactory"> <processFactory class="MyProcessFactoryClass"/> </extension> </pre> The value of the class attribute must implement the interface <code>org.eclipse.remote.core.IProcessFactory</code> Copyright (c) 2013 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 available at http://www.eclipse.org/legal/epl-v10.html org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/schema/remoteResources.exsd000066400000000000000000000076531272114001700311120ustar00rootroot00000000000000 This extension point allows remote implementations to provide additional operations on a resource. The extension associates a project nature with the resource extension. Resources contained within a particular project can be adapted to obtain the additional operations. the fully qualified name of a class that implements <code>org.eclipse.remote.core.IRemoteResource</code> a project nature. Resources contained within a project with this nature can be adapted to obtain the <code>org.eclipse.remote.core.IRemoteResource</code> interface. <pre> <extension point="org.eclipse.remote.core.remoteResource"> <remoteResource class="MyRemoteResourceClass" nature="MyProjectNature"/> </extension> </pre> The value of the class attribute must implement the interface <code>org.eclipse.remote.core.IRemoteResource</code> The remote package itself does not have any predefined remote resources. Copyright (c) 2013 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 available at http://www.eclipse.org/legal/epl-v10.html org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/schema/remoteServices.exsd000066400000000000000000000242131272114001700307120ustar00rootroot00000000000000 This extension point is used to add a remote services provider. A connection type. A unique identifier for this remote service A human readable name for the remote service An EFS scheme name for this service Can you add connections using the API. Default is true. Can a connection be changed using the API. Default is true. Can a connection be removed using the API. This is a service that implements the given service interface for a given connection type. The remote services that this service applies to. The interface class that this service implements. The service is found by calling the getService() method on the IRemoteServices object with this interface class as the parameter. The factory class used to instantiate the service. This is a service that implements the given service interface for connections of a given connection type. The connection type for the connections that this service applies to. The interface class that this service implements. The service is found by calling the getService() method on the IRemoteConnection object with this interface class as the parameter. The factory class used to instantiate the service. This is a service that implements the given service interface for processes of a given connection type. The connection type for the connections that this service applies to. The interface class that this service implements. The service is found by calling the getService() method on the IRemoteProcess object with this interface class as the parameter. The factory class used to instantiate the service. <pre> <extension point="org.eclipse.remote.core.remoteServices"> <remoteServices class="org.eclipse.remote.internal.core.services.local.LocalServicesFactory" id="org.eclipse.ptp.remote.LocalServices" name="Local" scheme="file"> </remoteServices> </extension> </pre> The value of the class attribute must implement <samp>org.eclipse.remote.core.IRemoteServicesFactory</samp>. The remote package provides a remote services implementation for local services. Copyright (c) 2013 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 available at http://www.eclipse.org/legal/epl-v10.html org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/000077500000000000000000000000001272114001700243535ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/000077500000000000000000000000001272114001700251425ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/000077500000000000000000000000001272114001700265665ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/000077500000000000000000000000001272114001700300615ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/000077500000000000000000000000001272114001700310115ustar00rootroot00000000000000AbstractRemoteProcessBuilder.java000066400000000000000000000102711272114001700373630ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.Map; import org.eclipse.core.filesystem.IFileStore; /** * Abstract base class for remote process builders. Implementors can use this class to provide a default implementation of a remote * process builder. * * @since 5.0 */ public abstract class AbstractRemoteProcessBuilder implements IRemoteProcessBuilder { private List fCommandArgs; private IFileStore fRemoteDir; private boolean fRedirectErrorStream; private final IRemoteConnection fConnection; /** * @since 2.0 */ public AbstractRemoteProcessBuilder(IRemoteConnection connection, List command) { fCommandArgs = command; fConnection = connection; } /** * @since 2.0 */ public AbstractRemoteProcessBuilder(IRemoteConnection connection, String... command) { this(connection, Arrays.asList(command)); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcessBuilder#command() */ @Override public List command() { return fCommandArgs; } /* * (non-Javadoc) * * @see * org.eclipse.remote.core.IRemoteProcessBuilder#command(java.util.List) */ @Override public IRemoteProcessBuilder command(List command) { fCommandArgs = command; return this; } /* * (non-Javadoc) * * @see * org.eclipse.remote.core.IRemoteProcessBuilder#command(java.lang.String * ) */ @Override public IRemoteProcessBuilder command(String... command) { fCommandArgs = Arrays.asList(command); return this; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcessBuilder#directory() */ @Override public IFileStore directory() { return fRemoteDir; } /* * (non-Javadoc) * * @see * org.eclipse.remote.core.IRemoteProcessBuilder#directory(org.eclipse * .core.filesystem.IFileStore) */ @Override public IRemoteProcessBuilder directory(IFileStore directory) { fRemoteDir = directory; return this; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcessBuilder#environment() */ @Override public abstract Map environment(); /* * (non-Javadoc) * * @see * org.eclipse.remote.core.IRemoteProcessBuilder#getSupportedFlags() */ /** * @since 5.0 */ @Override public abstract int getSupportedFlags(); /* * (non-Javadoc) * * @see * org.eclipse.remote.core.IRemoteProcessBuilder#redirectErrorStream() */ @Override public boolean redirectErrorStream() { return fRedirectErrorStream; } /* * (non-Javadoc) * * @see * org.eclipse.remote.core.IRemoteProcessBuilder#redirectErrorStream * (boolean) */ @Override public IRemoteProcessBuilder redirectErrorStream(boolean redirectErrorStream) { this.fRedirectErrorStream = redirectErrorStream; return this; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcessBuilder#start() */ @Override public IRemoteProcess start() throws IOException { return start(NONE); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcessBuilder#start(int) */ /** * @since 5.0 */ @Override public abstract IRemoteProcess start(int flags) throws IOException; /* * (non-Javadoc) * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder res = new StringBuilder(); for (String arg : command()) { res.append(arg); res.append(" "); //$NON-NLS-1$ } return res.toString(); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcessBuilder#getRemoteConnection() */ /** * @since 2.0 */ @Override public IRemoteConnection getRemoteConnection() { return fConnection; } } IProcessFactory.java000066400000000000000000000022371272114001700346600ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2013 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import java.io.File; import java.io.IOException; /** * Abstraction of the java.lang.Runtime exec() methods to allow different implementations to be supplied. */ public interface IProcessFactory { public Process exec(String cmd) throws IOException; public Process exec(String[] cmdarray) throws IOException; public Process exec(String[] cmdarray, String[] envp) throws IOException; public Process exec(String cmd, String[] envp) throws IOException; public Process exec(String cmd, String[] envp, File dir) throws IOException; public Process exec(String cmdarray[], String[] envp, File dir) throws IOException; } IRemoteCommandShellService.java000066400000000000000000000033211272114001700367500ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import java.io.IOException; /** * A service that provides a command shell on a remote. This is mainly used by * Terminal views. * * @since 2.0 */ public interface IRemoteCommandShellService extends IRemoteConnection.Service { /** * Get a remote process that runs a command shell on the remote system. The shell will be the user's default shell on the remote * system. The flags may be used to modify behavior of the remote process. These flags may only be supported by specific types * of remote service providers. Clients can use {@link IRemoteProcessBuilder#getSupportedFlags()} to find out the flags * supported by the service provider. * *
	 * Current flags are:
	 *   {@link IRemoteProcessBuilder#NONE}			- disable any flags
	 *   {@link IRemoteProcessBuilder#ALLOCATE_PTY}	- allocate a pseudo-terminal for the process (RFC-4254 Sec. 6.2)
	 *   {@link IRemoteProcessBuilder#FORWARD_X11}	- enable X11 forwarding (RFC-4254 Sec. 6.3)
	 * 
* * @param flags * bitwise-or of flags * @return remote process object * @throws IOException * @since 7.0 */ public IRemoteProcess getCommandShell(int flags) throws IOException; } IRemoteConnection.java000066400000000000000000000126621272114001700351700ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.remote.core.exception.RemoteConnectionException; /** * Represents a connection to a remote system. Use the getService method to get at connection * specific services. Connections have state, open or closed. Some connection types are always * open in which case the close does nothing. Connections have properties which are values that * describe the connection and are discovered. Connections also have attributes which are * client specified values that control the connection. * * @noimplement This interface is not intended to be implemented by clients. */ public interface IRemoteConnection { /** * The interface that is extend by services provided for this remote connection. * * @since 2.0 */ interface Service { IRemoteConnection getRemoteConnection(); interface Factory { T getService(IRemoteConnection remoteConnection, Class service); } } // Common properties final static String OS_NAME_PROPERTY = "os.name"; //$NON-NLS-1$ final static String OS_VERSION_PROPERTY = "os.version"; //$NON-NLS-1$ final static String OS_ARCH_PROPERTY = "os.arch"; //$NON-NLS-1$ final static String FILE_SEPARATOR_PROPERTY = "file.separator"; //$NON-NLS-1$ final static String PATH_SEPARATOR_PROPERTY = "path.separator"; //$NON-NLS-1$ final static String LINE_SEPARATOR_PROPERTY = "line.separator"; //$NON-NLS-1$ final static String USER_HOME_PROPERTY = "user.home"; //$NON-NLS-1$ /** * @since 2.0 */ final static String LOCALE_CHARMAP_PROPERTY = "locale.charmap"; //$NON-NLS-1$ /** * Get the connection type of this connection * * @return connection type * @since 2.0 */ public IRemoteConnectionType getConnectionType(); /** * Get unique name for this connection. * * @return connection name */ public String getName(); /** * Get the service for this remote connection that implements the given interface. * * @param service * the interface the required service must implements * @return the desired service or null if there is no such service available * @throws CoreException * @since 2.0 */ T getService(Class service); /** * Does this connection support the given service. * * @param service * The service to be tested * @return true if this connection supports the service * @since 2.0 */ boolean hasService(Class service); /** * Open the connection. Must be called before the connection can be used. * * @param monitor * the progress monitor to use for reporting progress to the user. It is the caller's responsibility to call done() * on the given monitor. Accepts null, indicating that no progress should be reported and that the operation cannot * be cancelled. * @throws RemoteConnectionException */ public void open(IProgressMonitor monitor) throws RemoteConnectionException; /** * Close the connection. Must be called to terminate the connection. */ public void close(); /** * Test if the connection is open. * * @return true if connection is open. */ public boolean isOpen(); /** * Gets the remote system property indicated by the specified key. The connection must be open prior to calling this method. * * @param key * the name of the property * @return the string value of the property, or null if no property has that key */ public String getProperty(String key); /** * Get an attribute for a connection. * * NOTE: the attributes do not include any security related information (e.g. passwords, keys, etc.) * * @param key * @return the attribute value, or empty string if not defined. * @since 2.0 */ public String getAttribute(String key); /** * Get an attribute that is stored in secure storage, such as passwords. * * @param key * @return the attribute value, or empty string if not defined. * @since 2.0 */ public String getSecureAttribute(String key); /** * Return a working copy to allow setting and changing of attributes. * * @return working copy of remote */ public IRemoteConnectionWorkingCopy getWorkingCopy(); /** * Register a listener that will be notified when this connection's status changes. * * @param listener */ public void addConnectionChangeListener(IRemoteConnectionChangeListener listener); /** * Remove a listener that will be notified when this connection's status changes. * * @param listener */ public void removeConnectionChangeListener(IRemoteConnectionChangeListener listener); /** * Notify all listeners when this connection's status changes. See {{@link RemoteConnectionChangeEvent} for a list of event * types. * * @param event * event type indicating the nature of the event */ public void fireConnectionChangeEvent(int type); } IRemoteConnectionChangeListener.java000066400000000000000000000024061272114001700377770ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import java.util.EventListener; /** * Listener used to register for notification of connection status changes. * Listeners can be registered on individual connections using * {@link IRemoteConnection#addConnectionChangeListener(IRemoteConnectionChangeListener)}, * or globally for all connections using * {@link IRemoteServicesManager#addRemoteConnectionChangeListener(IRemoteConnectionChangeListener)}. */ public interface IRemoteConnectionChangeListener extends EventListener { /** * Notifies this listener that the status of a connection has changed. * * @param event * the connection change event * @since 2.0 */ public void connectionChanged(RemoteConnectionChangeEvent event); } IRemoteConnectionControlService.java000066400000000000000000000032311272114001700400420ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.remote.core.exception.RemoteConnectionException; /** * A service to control and report on the state of a connection, open or closed. * Connections that do not provide this service are always assumed to be opened. * * @since 2.0 */ public interface IRemoteConnectionControlService extends IRemoteConnection.Service { /** * Open the connection. Must be called before the connection can be used. * * @param monitor * the progress monitor to use for reporting progress to the user. It is the caller's responsibility to call done() * on the given monitor. Accepts null, indicating that no progress should be reported and that the operation cannot * be cancelled. * @throws RemoteConnectionException */ public void open(IProgressMonitor monitor) throws RemoteConnectionException; /** * Close the connection. Must be called to terminate the connection. */ public void close(); /** * Test if the connection is open. * * @return true if connection is open. */ public boolean isOpen(); } IRemoteConnectionHostService.java000066400000000000000000000070061272114001700373430ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; /** * A service to obtain host specific information. * * @since 2.0 */ public interface IRemoteConnectionHostService extends IRemoteConnection.Service { /** * Obtain the hostname associated with this connection. * * @return hostname */ String getHostname(); /** * Obtain the port associated with this connection * * @return port */ int getPort(); /** * Obtain the timeout used when establishing the connection. * * @return timeout */ int getTimeout(); /** * Obtain the flag that indicates a login shell should be started once the connection is established * * @return login shell flag */ boolean useLoginShell(); /** * Obtain the username associated with this connection. * * @return */ String getUsername(); /** * Set the hostname associated with this connection. Note, this method can only be used for an * IRemoteConnectionWorkingCopy and will have no effect otherwise. * * @param hostname * new hostname for connection */ void setHostname(String hostname); /** * Set the pass phrase associated with this connection. Note, this method can only be used for an * IRemoteConnectionWorkingCopy and will have no effect otherwise. * * @param passphrase */ void setPassphrase(String passphrase); /** * Set the password associated with this connection. Note, this method can only be used for an * IRemoteConnectionWorkingCopy and will have no effect otherwise. * * @param password * new password for connection */ void setPassword(String password); /** * Set the port used for the connection. Note, this method can only be used forh an * IRemoteConnectionWorkingCopy and will have no effect otherwise. * * @param port * new port for connection */ void setPort(int port); /** * Set the timeout used when establishing the connection. A timeout of 0 means infinite. Note, this method can only be used * for an IRemoteConnectionWorkingCopy and will have no effect otherwise. * * @param timeout * new timeout value */ void setTimeout(int timeout); /** * Set the flag indicating a login shell should be stated for this connection. Note, this method can only be used * for an IRemoteConnectionWorkingCopy and will have no effect otherwise. * * @param useLogingShell * true to start a login shell */ void setUseLoginShell(boolean useLogingShell); /** * Set the connection to try password authentication first. Note, this method can only be used for an * IRemoteConnectionWorkingCopy and will have no effect otherwise. * * @param usePassword * use password authentication */ void setUsePassword(boolean usePassword); /** * Set the username associated with this connection. Note, this method can only be used for an * IRemoteConnectionWorkingCopy and will have no effect otherwise. * * @param username * new username for connection */ void setUsername(String username); } IRemoteConnectionPropertyService.java000066400000000000000000000027161272114001700402550ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; /** * A connection property is some descriptive information that's discovered about the connection. * This service provides property values for a connection. * * Examples include: *
 * os.name			Operating system name 
 * os.arch			Operating system architecture
 * os.version		Operating system version
 * file.separator	File separator ("/" on UNIX)
 * path.separator	Path separator (":" on UNIX)
 * line.separator	Line separator ("\n" on UNIX)
 * user.home		Home directory
 * 
* * @since 2.0 */ public interface IRemoteConnectionPropertyService extends IRemoteConnection.Service { /** * Gets the remote system property indicated by the specified key. The connection must be open prior to calling this method. * * @param key * the name of the property * @return the string value of the property, or null if no property has that key */ public String getProperty(String key); } IRemoteConnectionProviderService.java000066400000000000000000000023551272114001700402220ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; /** * A connection type service for connection types that have automatic means of adding * and removing services. For example, the Local connection type needs to be able * to ensure the Local connection is created, or adapters to other target management * systems may prefer to let those systems manage the connections. * * @since 2.0 */ public interface IRemoteConnectionProviderService extends IRemoteConnectionType.Service { /** * Initialize the service. Called after all existing connections are loaded. * This method typically will add the initial connections or start up a job to do it. * This method is called on startup, it's important that it be fast. */ void init(); } IRemoteConnectionType.java000066400000000000000000000132231272114001700360240ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2013 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import java.net.URI; import java.util.List; import org.eclipse.core.runtime.CoreException; import org.eclipse.remote.core.exception.RemoteConnectionException; /** * A remote connection type manages a list of connections that implement the same services. * Services may be registered on the individual connections, or at the connection type level * for service that apply to all connections of this type. * * @noimplement This interface is not intended to be implemented by clients. * @since 2.0 */ public interface IRemoteConnectionType { /** * The interface that is extend by services provided for this remote services implementation. * * @since 2.0 */ interface Service { IRemoteConnectionType getConnectionType(); interface Factory { T getService(IRemoteConnectionType connectionType, Class service); } } /** * Get the remote services manager. This is a convenient way to get back * to the root. * * @return remote services manager */ IRemoteServicesManager getRemoteServicesManager(); /** * Get unique ID of this service. Can be used as a lookup key. * * @return unique ID */ String getId(); /** * Get display name of this service. * * @return display name */ String getName(); /** * Get the EFS scheme provided by this service. * * @return display name */ String getScheme(); /** * Can you add new connections of this type using the API. * * @return can add */ boolean canAdd(); /** * Can you edit connections of this type, i.e. create working copies. * * @return can edit */ boolean canEdit(); /** * Can you remove connections of this type using the API. * * @return can remove */ boolean canRemove(); /** * Get the service for this remote services implementation that implements the given interface. * * @param service * the interface the required service must implements * @return the desired service or null if there is no such service available * @throws CoreException * @since 2.0 */ T getService(Class service); /** * Does this connection type support the given service. * * @param service * the service to be tested * @return true if this connection type supports this service */ boolean hasService(Class service); /** * Return the list of connection type services supported by this type. * * @return connection type services */ List getServices(); /** * Do connections created by this connection type support the given service. * * @param service * the service to be tested * @return true if connections created by this connection type support this service */ boolean hasConnectionService(Class service); /** * Return the list of connection services supported by connections of this type. * * @return connection services */ List getConnectionServices(); /** * Do processes created by this connection type support the given service. * * @param service * the service to be tested * @return true if processes created by this connection type support this service */ boolean hasProcessService(Class service); /** * Return the list of process services supported by connections of this type. * * @return process services */ List getProcessServices(); /** * Gets the remote connection corresponding to the supplied name. * * @param name * name of the connection (as returned by {@link IRemoteConnection#getName()}) * @return remote connection or null if no connection exists */ IRemoteConnection getConnection(String name); /** * Gets the remote connection corresponding to the supplied URI. * * @param uri * URI containing a schema for this remote connection * @return remote connection or null if no connection exists or the schema * is incorrect * @since 4.0 */ IRemoteConnection getConnection(URI uri); /** * Get all the connections for this service provider. * * @return connections that we know about */ List getConnections(); /** * Creates a new remote connection named with supplied name. The connection attributes will be the default for the * implementation. * * Returns a working copy of the remote connection. Callers must call {@link IRemoteConnectionWorkingCopy#save()} before the * connection can be used. * * @param name * name of the connection * @return a new connection working copy with the supplied name * @throws RemoteConnectionException * if connection creation failed * @since 5.0 */ IRemoteConnectionWorkingCopy newConnection(String name) throws RemoteConnectionException; /** * Remove a connection and all resources associated with it. * * @param connection * connection to remove * @throws RemoteConnectionException * if the connection could not be removed */ void removeConnection(IRemoteConnection connection) throws RemoteConnectionException; } IRemoteConnectionWorkingCopy.java000066400000000000000000000043301272114001700373550ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import org.eclipse.remote.core.exception.RemoteConnectionException; /** * A working copy of a remote connection used to change the name and/or * attributes of the connection. It is also used when creating a new * connection */ public interface IRemoteConnectionWorkingCopy extends IRemoteConnection { /** * Returns the original connection this working copy was created from. * Returns null if this is a new connection. * * @return original connection */ public IRemoteConnection getOriginal(); /** * Returns whether this connection has been modified since it was last saved or created. * * @return true if the connection has been modified */ public boolean isDirty(); /** * Saves this working copy to its original connection and returns a handle to the resulting connection. Has no effect if this * connection does not need saving. * * @return saved connection * @throws RemoteConnectionException */ public IRemoteConnection save() throws RemoteConnectionException; /** * Set the name for this connection * * @param name */ public void setName(String name); /** * Set an implementation dependent attribute for the connection. Attributes keys supported by the connection can be obtained * using {@link #getAttributes()}. Attributes are persisted along with connection information. * * @param key * attribute key * @param value * attribute value */ public void setAttribute(String key, String value); /** * Set an attribute such as a password that's stored in secure storage. * * @param key * @param value * @since 2.0 */ public void setSecureAttribute(String key, String value); } IRemoteFileService.java000066400000000000000000000053241272114001700352660ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import java.net.URI; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.runtime.IPath; /** * Interface for managing files on a remote system. * * @since 2.0 */ public interface IRemoteFileService extends IRemoteConnection.Service { /** * Get the resource associated with path. IFileStore can then be used to * perform operations on the file. * * The remote connection does not need to be open to use this method, but * subsequent operations on the IFileStore that access the underlying remote * filesystem may require the connection to be open. * * @param path * path to resource * @return the file store representing the remote path */ IFileStore getResource(String path); /** * Get the base directory to be used for relative paths. * * @return base directory */ String getBaseDirectory(); /** * Set the base directory to be used for relative paths.. * * @param path new base directory */ void setBaseDirectory(String path); /** * Gets the directory separator on the target system. * * @return String */ String getDirectorySeparator(); /** * Convert URI to a remote path. This path is suitable for direct file * operations on the remote system. * * The remote connection does not need to be open to use this method. * * @return IPath representing the remote path */ String toPath(URI uri); /** * Convert remote path to equivalent URI. This URI is suitable for EFS * operations on the local system. * * The remote connection does not need to be open to use this method. * * @param path * path on remote system * @return URI representing path on remote system, or null if the path is * invalid */ URI toURI(IPath path); /** * Convert string representation of a remote path to equivalent URI. This * URI is suitable for EFS operations on the local system. * * The remote connection does not need to be open to use this method. * * @param path * path on remote system * @return URI representing path on remote system, or null if the path is * invalid */ URI toURI(String path); } IRemotePortForwardingService.java000066400000000000000000000074201272114001700373550ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.remote.core.exception.RemoteConnectionException; /** * A connection service for setting up port forwarding between the host and the remote. * This is a feature provided by SSH. * * @since 2.0 */ public interface IRemotePortForwardingService extends IRemoteConnection.Service { /** * Forward local port localPort to remote port fwdPort on remote machine fwdAddress. If this IRemoteConnection is not to * fwdAddress, the port will be routed via the connection machine to fwdAddress. * * @param localPort * local port to forward * @param fwdAddress * address of remote machine * @param fwdPort * remote port on remote machine * @throws RemoteConnectionException */ public void forwardLocalPort(int localPort, String fwdAddress, int fwdPort) throws RemoteConnectionException; /** * Forward a local port to remote port fwdPort on remote machine fwdAddress. The local port is chosen dynamically and returned * by the method. If this IRemoteConnection is not to fwdAddress, the port will be routed via the connection machine to * fwdAddress. * * @param fwdAddress * @param fwdPort * @param monitor * @return local port number * @throws RemoteConnectionException */ public int forwardLocalPort(String fwdAddress, int fwdPort, IProgressMonitor monitor) throws RemoteConnectionException; /** * Forward remote port remotePort to port fwdPort on machine fwdAddress. When a connection is made to remotePort on the remote * machine, it is forwarded via this IRemoteConnection to fwdPort on machine fwdAddress. * * @param remotePort * remote port to forward * @param fwdAddress * address of recipient machine * @param fwdPort * port on recipient machine * @throws RemoteConnectionException */ public void forwardRemotePort(int remotePort, String fwdAddress, int fwdPort) throws RemoteConnectionException; /** * Forward a remote port to port fwdPort on remote machine fwdAddress. The remote port is chosen dynamically and returned by the * method. When a connection is made to this port on the remote machine, it is forwarded via this IRemoteConnection to fwdPort * on machine fwdAddress. * * If fwdAddress is the empty string ("") then the fwdPort will be bound to any address on all interfaces. Note that this * requires enabling the GatewayPort sshd option on some systems. * * @param fwdAddress * @param fwdPort * @param monitor * @return remote port number * @throws RemoteConnectionException */ public int forwardRemotePort(String fwdAddress, int fwdPort, IProgressMonitor monitor) throws RemoteConnectionException; /** * Remove the local port forwarding associated with the given port. * * @param port * forwarded port * @throws RemoteConnectionException * @since 7.0 */ public void removeLocalPortForwarding(int port) throws RemoteConnectionException; /** * Remove the remote port forwarding associated with the given port. * * @param port * forwarded port * @throws RemoteConnectionException * @since 7.0 */ public void removeRemotePortForwarding(int port) throws RemoteConnectionException; } IRemotePreferenceConstants.java000066400000000000000000000020041272114001700370310ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2011 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; /** * Preference constants that can be used to check the default remote service provider preference. * * @since 6.0 */ public interface IRemotePreferenceConstants { /** * Preference setting for the default connection type. Clients can check this preference to see if a default provider * has been set, and if so, what the provider ID is. * * @since 2.0 */ public static final String PREF_CONNECTION_TYPE_ID = "connectionTypeId"; //$NON-NLS-1$ } IRemoteProcess.java000066400000000000000000000077461272114001700345160ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import java.io.InputStream; import java.io.OutputStream; /** * Represents a process running on a remote system. Remote process are created using the {@link IRemoteProcessBuilder} interface. */ public interface IRemoteProcess { /** * The interface that is extend by services provided for this remote connection. * * @since 2.0 */ interface Service { IRemoteProcess getRemoteProcess(); interface Factory { T getService(IRemoteProcess remoteProcess, Class service); } } /** * Terminate the process */ void destroy(); /** * Returns the exit value for the process * * @return the exit value */ int exitValue(); /** * Gets the error output stream of the process * * Note: some implementations (e.g. JSch) will not work correctly if the remote process generates stdout or stderr but the * calling thread does not read the corresponding output or error streams. * * @return the output stream connected to the standard * error of the process */ InputStream getErrorStream(); /** * Gets an InputStream which can be used to read the standard output stream of the process * * Note: some implementations (e.g. JSch) will not work correctly if the remote process generates stdout or stderr but the * calling thread does not read the corresponding input or error streams. * * @return the input stream connected to the standard * output of the process */ InputStream getInputStream(); /** * Gets an output stream which can be used to write to the standard input stream of the process * * @return the output stream connected to the standard * input of the process */ OutputStream getOutputStream(); /** * Get the service for this remote process that implements the given interface. * * @param service * the interface the required service must implements * @return the desired service or null if there is no such service available * @since 2.0 */ T getService(Class service); /** * Does this remote process support the given service. * * @param service * The service to be tested * @return true if this connection supports the service * @since 2.0 */ boolean hasService(Class service); /** * Wait until the process has terminated * * Note: some implementations (e.g. JSch) will not work correctly if the remote process generates stdout or stderr but the * calling thread does not read the corresponding input or error streams. * * @return the exit value of the process * @throws InterruptedException * if the current thread is * interrupted by another thread while it is waiting */ int waitFor() throws InterruptedException; /** * Check if the remote process has completed. * * Note: some implementations (e.g. JSch) will not work correctly if the remote process generates stdout or stderr but the * calling thread does not read the corresponding input or error streams. * * @return true if remote process has completed */ boolean isCompleted(); /** * Get the connection that is used by this process * * @return connection used by this process * @since 2.0 */ IRemoteConnection getRemoteConnection(); /** * Get the process builder used to create this process * * @return process builder used to create this process * @since 2.0 */ IRemoteProcessBuilder getProcessBuilder(); } IRemoteProcessBuilder.java000066400000000000000000000101201272114001700360010ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import java.io.IOException; import java.util.List; import java.util.Map; import org.eclipse.core.filesystem.IFileStore; /** * Abstraction of a process builder for remote processes. This interface behaves in the same manner as * {@link java.lang.ProcessBuilder}. */ public interface IRemoteProcessBuilder { /** * @since 5.0 */ public static int NONE = 0x00; /** * Flag to request allocation of a pseudo-terminal for the process (RFC-4254 * Sec. 6.2) * * @since 5.0 */ public static int ALLOCATE_PTY = 0x01; /** * Flag to request X11 forwarding (RFC-4254 Sec. 6.3) * * @since 5.0 */ public static int FORWARD_X11 = 0x02; /** * Returns this process builder's operating system program and arguments. * * @return a list containing the program and arguments */ List command(); /** * Sets this process builder's operating system program and arguments. * * @param command * @return This process builder */ IRemoteProcessBuilder command(List command); /** * Sets this process builder's operating system program and arguments. * * @param command * @return this process builder */ IRemoteProcessBuilder command(String... command); /** * Returns this process builder's working directory. * * @return an IFileStore reference to the working directory */ IFileStore directory(); /** * Sets this process builder's working directory. * * @param directory * @return This process builder */ IRemoteProcessBuilder directory(IFileStore directory); /** * Returns a string map view of this process builder's environment. The * returned map behaves in the same manner as described in {@link java.lang.ProcessBuilder#environment()}. * * @return the process builder's environment */ Map environment(); /** * Get the flags that are supported by this process builder. * * @return bitwise-or of the supported flags * @since 5.0 */ int getSupportedFlags(); /** * Tells whether this process builder merges standard error and standard * output. * * @return true if standard error and standard output will be merged */ boolean redirectErrorStream(); /** * Sets this process builder's redirectErrorStream property. * * @param redirectErrorStream * @return This process builder */ IRemoteProcessBuilder redirectErrorStream(boolean redirectErrorStream); /** * Starts a new process using the attributes of this process builder. * * @return remote process object * @throws IOException */ IRemoteProcess start() throws IOException; /** * Starts a new process using the attributes of this process builder. The * flags may be used to modify behavior of the remote process. These flags * may only be supported by specific types of remote service providers. * Clients can use {@link #getSupportedFlags()} to find out the flags * supported by the service provider. * *
	 * Current flags are:
	 *   NONE			- disable any flags
	 *   ALLOCATE_PTY	- allocate a pseudo-terminal for the process (RFC-4254 Sec. 6.2)
	 *   FORWARD_X11	- enable X11 forwarding (RFC-4254 Sec. 6.3)
	 * 
* * @param flags * bitwise-or of flags to use when starting process * @return remote process object * @throws IOException * @since 5.0 */ IRemoteProcess start(int flags) throws IOException; /** * Get the connection that will be used by this process builder to create remote processes. * * @return connection used to create remote processes * @since 2.0 */ IRemoteConnection getRemoteConnection(); }IRemoteProcessControlService.java000066400000000000000000000040151272114001700373620ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import java.io.InputStream; import java.io.OutputStream; /** * A service to control and report on the state of a process. * * @since 2.0 */ public interface IRemoteProcessControlService extends IRemoteProcess.Service { /** * Terminate the process */ public void destroy(); /** * Returns the exit value for the process * * @return the exit value */ public int exitValue(); /** * Gets the error output stream of the process * * @return the output stream connected to the standard * error of the process */ public InputStream getErrorStream(); /** * Gets an InputStream which can be used to read the standard output stream of the process * * @return the input stream connected to the standard * output of the process */ public InputStream getInputStream(); /** * Gets an output stream which can be used to write to the standard input stream of the process * * @return the output stream connected to the standard * input of the process */ public OutputStream getOutputStream(); /** * Wait until the process has terminated * * @return the exit value of the process * @throws InterruptedException * if the current thread is * interrupted by another thread while it is waiting */ public int waitFor() throws InterruptedException; /** * Check if the remote process has completed * * @return true if remote process has completed */ public boolean isCompleted(); } IRemoteProcessService.java000066400000000000000000000047571272114001700360360ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import java.util.List; import java.util.Map; /** * A connection service for starting up processes on a remote. * * @since 2.0 */ public interface IRemoteProcessService extends IRemoteConnection.Service { /** * Returns an unmodifiable string map view of the remote environment. The connection must be open prior to calling this method. * * @return the remote environment */ public Map getEnv(); /** * Returns the value of an environment variable. The connection must be open prior to calling this method. * * @param name * name of the environment variable * @return value of the environment variable or null if the variable is not defined */ public String getEnv(String name); /** * Get a process builder for creating remote processes * * @return process builder or null if connection is not open */ public IRemoteProcessBuilder getProcessBuilder(List command); /** * Get a process builder for creating remote processes * * @return process builder or null if connection is not open */ public IRemoteProcessBuilder getProcessBuilder(String... command); /** * Get the working directory. Relative paths will be resolved using this path. * * The remote connection does not need to be open to use this method, however a default directory path, rather than the actual * working directory, may be returned in this case. * * @return String representing the current working directory */ public String getWorkingDirectory(); /** * Set the working directory while the connection is open. The working directory will revert to the default when the connection * is closed then subsequently reopened. * * Relative paths will be resolved using this path. The path must be valid and absolute for any changes to be made. * * @param path * String representing the current working directory * @since 4.0 */ public void setWorkingDirectory(String path); } IRemoteProcessSignalService.java000066400000000000000000000031201272114001700371530ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import org.eclipse.remote.core.exception.RemoteConnectionException; /** * A service abstraction for signals. * * @since 2.0 */ public interface IRemoteProcessSignalService extends IRemoteProcess.Service { public static final int HUP = 1; public static final int INT = 2; public static final int QUIT = 3; public static final int ILL = 4; public static final int ABRT = 6; public static final int FPE = 8; public static final int KILL = 9; public static final int SEGV = 11; public static final int PIPE = 13; public static final int ALRM = 14; public static final int TERM = 15; public static final int STOP = 17; public static final int TSTP = 18; public static final int CONT = 19; public static final int USR1 = 30; public static final int USR2 = 31; /** * Send a signal to the remote process. * * @param signal * signal to send. * @throws RemoteConnectionException * if the underlying connection fails * @since 2.0 */ void sendSignal(int signal) throws RemoteConnectionException; } IRemoteProcessTerminalService.java000066400000000000000000000024101272114001700375120ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; /** * A service abstraction for remote terminals. * * @since 2.0 */ public interface IRemoteProcessTerminalService extends IRemoteProcess.Service { /** * Change the terminal window dimension interactively. Refer to RFC 4254 6.7. Window Dimension Change Message. The character/row * dimensions override the pixel dimensions (when nonzero). Pixel dimensions refer to the drawable area of the window. * * @param cols * terminal width in characters * @param rows * terminal height in characters * @param width * terminal width in pixels * @param height * terminal height in pixels */ void setTerminalSize(int cols, int rows, int width, int height); } IRemoteResource.java000066400000000000000000000050231272114001700346510ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2011 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import java.net.URI; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; /** * Abstraction of a remote resource. There are currently two types of remote resources: fully remote and synchronized. This * interface provides a common mechanism for accessing resource information from either type. * * Usage: * * * IRemoteResource remoteRes = (IRemoteResource)resource.getAdapter(IRemoteResource.class); * if (remoteRes != null) { * URI location = remoteRes.getDefaultLocationURI(); * ... * } * * * @author greg * @since 6.0 * */ public interface IRemoteResource { /** * Get the active location URI of the resource in the remote project. Returns null if the URI can't be obtained (@see * {@link IResource#getLocationURI()}). * * For fully remote projects, this is just the URI of the remote resource. For synchronized projects, this is the URI of the * resource from the active synchronization target. * * @return URI or null if URI can't be obtained */ public URI getActiveLocationURI(); /** * Get the platform resource corresponding to the remote resource * * @return IResource */ public IResource getResource(); /** * Synchronize the resource with the underlying filesystem. Performs a refresh for local and remote projects, but causes * synchronized projects to attempt to synchronize with their remote files. May synchronize more than just the single resource. * Blocks until the refresh has completed, so callers should use a job if necessary. * * @param monitor * progress monitor to cancel refresh * @throws CoreException * if the underlying synchronization fails */ public void refresh(IProgressMonitor monitor) throws CoreException; /** * Set the platform resource * * @param resource * platform resource corresponding to this remote resource */ public void setResource(IResource resource); }IRemoteServicesManager.java000066400000000000000000000100161272114001700361360ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import java.net.URI; import java.util.List; /** * The main entry point into the remote services system. The remote services manager * is an OSGi service. It provides a list of connection types and the global * list of all connections. * * @noimplement This interface is not intended to be implemented by clients. * @since 2.0 */ public interface IRemoteServicesManager { /** * Get the connection type identified by the id * * @param id * id of the connection type * @return connection type or null if the service can not be found */ IRemoteConnectionType getConnectionType(String id); /** * Get the connection type that provides connections to locations identified by * the URI. * * @param uri * uri of locations to be accessed * @return the connection type that can be used to access the locations * or null if no connection type is available for the uri. */ IRemoteConnectionType getConnectionType(URI uri); /** * Return the connection type used to access local resources. * * @return the local services */ IRemoteConnectionType getLocalConnectionType(); /** * Returns the list of all connection types including the local services. * * @return all connection types */ List getAllConnectionTypes(); /** * Returns the list of all connection types that support connections that provide specific services. The connections * can provide additional services that are not included in the list, so this just guarantees the minimum set of services that * will be supported. * * @param services * services provided by connections supported by this connection type * @return compatible connection types */ @SuppressWarnings("unchecked") List getConnectionTypesSupporting(Class... services); /** * Returns the list of all connection types that provide specific services. The connection types can provide additional services * that are not included in the list, so this just guarantees the minimum set of services that will be supported. * * @param services * services provided by this connection type * @return compatible connection types */ @SuppressWarnings("unchecked") List getConnectionTypesByService(Class... services); /** * Returns the list of connection types except for the local connection type. * * @return all connection types that are really remote */ List getRemoteConnectionTypes(); /** * Returns the list of all known remote connections. * * @return all remote connections */ List getAllRemoteConnections(); /** * Add a global connection change listener that receives events for all connections. * * @param listener * global connection change listener to be added */ void addRemoteConnectionChangeListener(IRemoteConnectionChangeListener listener); /** * Remove the global connection change listener. * * @param listener * global connection change listener to be removed */ void removeRemoteConnectionChangeListener(IRemoteConnectionChangeListener listener); /** * Used by connections and other components to notify the global connection * change listeners of events. * * @param event * connection change event */ void fireRemoteConnectionChangeEvent(RemoteConnectionChangeEvent event); } IUserAuthenticatorService.java000066400000000000000000000104741272114001700367060ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2000, 2007, 2013 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * Atsuhiko Yamanaka, JCraft,Inc. - adding promptForKeyboradInteractive method * - copying this class from cvs.core plug-in. * Greg Watson, IBM - modified for use with PTP *******************************************************************************/ package org.eclipse.remote.core; import java.net.PasswordAuthentication; /** * Allow clients to provide their own user interface for connection authentication. * * @since 2.0 */ public interface IUserAuthenticatorService extends IRemoteConnection.Service { /** * ID for an "Ok" response (value 0). */ public final static int OK = 0; /** * ID for a "Cancel" response (value 1). */ public final static int CANCEL = 1; /** * ID for a "Yes" response (value 2). */ public final static int YES = 2; /** * ID for a "No" response (value 3). */ public final static int NO = 3; /** * Constant for a prompt with no type (value 0). */ public final static int NONE = 0; /** * Constant for an error prompt (value 1). */ public final static int ERROR = 1; /** * Constant for an information prompt (value 2). */ public final static int INFORMATION = 2; /** * Constant for a question prompt (value 3). */ public final static int QUESTION = 3; /** * Constant for a warning dialog (value 4). */ public final static int WARNING = 4; /** * Authenticates the user for access. * The obtained values for user name and password will be placed * into returned object. Implementors are allowed to * save user names and passwords. The user should be prompted for * user name and password if there is no saved one. * * @param username * The initial username, or null if there is no initial username * @param message * An optional message to display if, e.g., previous authentication failed. */ public PasswordAuthentication prompt(String username, String message); /** * Prompts the user for a number values using text fields. The labels are provided in * the prompt array. Implementors will return the entered values, or null if * the user cancels the prompt. * * @param destination * the destination in the format like username@hostname:port * @param name * a name for this dialog * @param message * the message to be displayed to the user * @param prompt * labels for each of the text fields. * @param echo * an array to show which fields are secret * @return the entered values, or null if the user canceled. */ public String[] prompt(String destination, String name, String message, String[] prompt, boolean[] echo); /** * Prompts for additional information regarding this authentication * request. A default implementation of this method should return the defaultResponse, * whereas alternate implementations could prompt the user with a dialog. * * @param promptType * one of the following values: *
    *
  • NONE for a unspecified prompt type
  • *
  • ERROR for an error prompt
  • *
  • INFORMATION for an information prompt
  • *
  • QUESTION for a question prompt
  • *
  • WARNING for a warning prompt
  • *
* @param title * the prompt title that could be displayed to the user * @param message * the message to display to the user * @param promptResponses * the possible responses to the prompt (e.g. corresponding to buttons on a dialog) * @param defaultResponseIndex * the default response to the prompt * @return the response to the prompt */ public int prompt(int promptType, String title, String message, int[] promptResponses, int defaultResponseIndex); } RemoteConnectionChangeEvent.java000066400000000000000000000045631272114001700371700ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; /** * Event representing a change in connection status. The {@link #getType()} method can be used to obtain information about the type * of event that occurred. * * @since 2.0 */ public class RemoteConnectionChangeEvent { /** * Event indicating that the connection was closed. */ public static final int CONNECTION_CLOSED = 1 << 0; /** * Event indicating that the connection was opened. */ public static final int CONNECTION_OPENED = 1 << 1; /** * Event indicating that the connection was closed abnormally. */ public static final int CONNECTION_ABORTED = 1 << 2; /** * Event indicating that the connection name will be changed. It is sent prior to the name change taking place. * The event passes an IRemoteConnectionWorkingCopy so that the original and new name can be used by the listener. */ public static final int CONNECTION_RENAMED = 1 << 3; /** * Event indicating the connection was added. * @since 2.0 */ public static final int CONNECTION_ADDED = 1 << 4; /** * Event indicating the connection is about to be removed. * @since 2.0 */ public static final int CONNECTION_REMOVED = 1 << 5; private final IRemoteConnection connection; private final int type; public RemoteConnectionChangeEvent(IRemoteConnection connection, int type) { this.connection = connection; this.type = type; } /** * Get the connection that has changed. * * @return IRemoteConnection */ public IRemoteConnection getConnection() { return connection; } /** * Returns the type of event being reported. This type * is obtained by bitwise OR'ing the event types together. * * {@link #CONNECTION_CLOSED} {@link #CONNECTION_OPENED} {@link #CONNECTION_ABORTED} {@link #CONNECTION_RENAMED} * * @return a bitwise OR of event type constants */ public int getType() { return type; } } RemoteConnectionPropertyTester.java000066400000000000000000000021141272114001700400020ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2016 QNX Software Systems, and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - initial contribution *******************************************************************************/ package org.eclipse.remote.core; import org.eclipse.core.expressions.PropertyTester; /** * @since 2.1 */ public class RemoteConnectionPropertyTester extends PropertyTester { @Override public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { if (receiver instanceof IRemoteConnection) { if (property.equals("isConnectionType")) { IRemoteConnection connection = (IRemoteConnection) receiver; if (connection.getConnectionType().getId().equals(expectedValue)) { return true; } } } return false; } } RemoteProcessAdapter.java000066400000000000000000000034731272114001700356770ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2009 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.remote.core; import java.io.InputStream; import java.io.OutputStream; /** * Utility class to adapt an IRemoteProcess to a java.lang.Process * * @author crecoskie * */ public class RemoteProcessAdapter extends Process { private final IRemoteProcess fProcess; public RemoteProcessAdapter(IRemoteProcess process) { fProcess = process; } /* * (non-Javadoc) * * @see java.lang.Process#destroy() */ @Override public void destroy() { fProcess.destroy(); } /* * (non-Javadoc) * * @see java.lang.Process#exitValue() */ @Override public int exitValue() { return fProcess.exitValue(); } /* * (non-Javadoc) * * @see java.lang.Process#getErrorStream() */ @Override public InputStream getErrorStream() { return fProcess.getErrorStream(); } /* * (non-Javadoc) * * @see java.lang.Process#getInputStream() */ @Override public InputStream getInputStream() { return fProcess.getInputStream(); } /* * (non-Javadoc) * * @see java.lang.Process#getOutputStream() */ @Override public OutputStream getOutputStream() { return fProcess.getOutputStream(); } /* * (non-Javadoc) * * @see java.lang.Process#waitFor() */ @Override public int waitFor() throws InterruptedException { return fProcess.waitFor(); } } RemoteServicesUtils.java000066400000000000000000000077441272114001700355710ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/******************************************************************************* * Copyright (c) 2013, 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation * Martin Oberhuber - [468889] Support Eclipse older than Mars *******************************************************************************/ package org.eclipse.remote.core; import java.net.URI; import java.net.URISyntaxException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.remote.internal.core.RemoteCorePlugin; import org.eclipse.remote.internal.core.RemotePath; import org.eclipse.remote.internal.core.preferences.Preferences; /** * Remote services utility methods. */ public class RemoteServicesUtils { /** * Constructs a new POSIX path from the given string path. The string path * must represent a valid file system path on a POSIX file system. The path * is canonicalized and double slashes are removed except at the beginning * (to handle UNC paths). All forward slashes ('/') are treated as segment * delimiters. This factory method should be used if the string path is for * a POSIX file system. * * @param path the string path * @see org.eclipse.core.runtime.Path#forPosix(String) * @since 2.0 */ public static IPath posixPath(String path) { try { //Use the Mars implementation of Path, see bug 454959 return Path.forPosix(path); } catch (NoSuchMethodError e) { //TODO For older Eclipse, use the fallback below. That code should be //removed when support for Eclipse older than Mars is no longer needed. return RemotePath.forPosix(path); } } /** * Convert a UNC path to a URI * * Maps the UNC server component to a connection known by one of the remote service implementations. It is assumed that the * server component is of the form "[connection_type_id:]connection_name". If the "connection_type_id:" part is omitted then the * current connection type preference is used by default. If no preference is set, then each implementation is tried until * a matching connection name is found. * * @param path * UNC path * @return corresponding URI or null if not a valid path */ public static URI toURI(IPath path) { if (path.isUNC()) { IRemoteServicesManager manager = RemoteCorePlugin.getService(IRemoteServicesManager.class); /* * Split the server component if possible. */ String[] parts = path.segment(0).split(":"); //$NON-NLS-1$ IRemoteConnectionType services = null; String connName = null; if (parts.length == 2) { services = manager.getConnectionType(parts[0]); connName = parts[1]; } else if (parts.length == 1) { String id = Preferences.getString(IRemotePreferenceConstants.PREF_CONNECTION_TYPE_ID); if (id != null) { services = manager.getConnectionType(id); } connName = parts[0]; } /* * If we've found the remote services then look up the connection, otherwise iterate through all available services * checking for the connection name. */ IRemoteConnection conn = null; if (services != null) { conn = services.getConnection(connName); } else if (connName != null) { for (IRemoteConnectionType s : manager.getAllConnectionTypes()) { if (s != null) { conn = s.getConnection(connName); if (conn != null) { break; } } } } /* * If a connection was found then convert it to a URI. */ if (conn != null) { String scheme = conn.getConnectionType().getScheme(); String filePath = path.removeFirstSegments(1).makeAbsolute().toString(); try { return new URI(scheme, connName, filePath, null, null); } catch (URISyntaxException e) { // Ignore } } } return null; } } org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/exception/000077500000000000000000000000001272114001700330075ustar00rootroot00000000000000AddressInUseException.java000066400000000000000000000021521272114001700400030ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/exception/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core.exception; /** * Exception thrown when a connection address is already in use. * */ public class AddressInUseException extends RemoteConnectionException { private static final long serialVersionUID = 1771839754428411610L; /** * @param message * @param cause */ public AddressInUseException(String message, Throwable cause) { super(message, cause); } /** * @param message */ public AddressInUseException(String message) { super(message); } /** * @param cause */ public AddressInUseException(Throwable cause) { super(cause); } } ConnectionExistsException.java000066400000000000000000000017441272114001700407570ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/exception/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.core.exception; /** * Thrown when trying to add a connection with the same name as an existing * connection, or when trying to rename a connection to the same name as an * existing connection. * * @since 2.0 */ public class ConnectionExistsException extends RemoteConnectionException { private static final long serialVersionUID = -1591235868439783613L; public ConnectionExistsException(String message) { super(message); } } PrivilegedPortException.java000066400000000000000000000021641272114001700404140ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/exception/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core.exception; /** * Exception thrown when an attempt is made to use a privileged port. */ public class PrivilegedPortException extends RemoteConnectionException { private static final long serialVersionUID = -7794871221470179956L; /** * @param message * @param cause */ public PrivilegedPortException(String message, Throwable cause) { super(message, cause); } /** * @param message */ public PrivilegedPortException(String message) { super(message); } /** * @param cause */ public PrivilegedPortException(Throwable cause) { super(cause); } } RemoteConnectionException.java000066400000000000000000000025721272114001700407330ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/exception/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core.exception; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.remote.internal.core.RemoteCorePlugin; /** * Exception thrown when a remote connection error occurs. */ public class RemoteConnectionException extends CoreException { private static final long serialVersionUID = -7794871221470179956L; /** * @param message * @param cause */ public RemoteConnectionException(String message, Throwable cause) { super(new Status(IStatus.ERROR, RemoteCorePlugin.getUniqueIdentifier(), message, cause)); } /** * @param message */ public RemoteConnectionException(String message) { this(message, null); } /** * @param cause */ public RemoteConnectionException(Throwable cause) { this(cause.getMessage(), cause); } } UnableToForwardPortException.java000066400000000000000000000022141272114001700413540ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/exception/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.core.exception; /** * Exception thrown when a port is unable to be forwarded. */ public class UnableToForwardPortException extends RemoteConnectionException { /** * */ private static final long serialVersionUID = -5814772755700213717L; /** * @param message * @param cause */ public UnableToForwardPortException(String message, Throwable cause) { super(message, cause); } /** * @param message */ public UnableToForwardPortException(String message) { super(message); } /** * @param cause */ public UnableToForwardPortException(Throwable cause) { super(cause); } } org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/launch/000077500000000000000000000000001272114001700322635ustar00rootroot00000000000000IRemoteLaunchConfigService.java000066400000000000000000000036501272114001700402210ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/core/launch/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.core.launch; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.remote.core.IRemoteConnection; /** * Manages and persists the mapping between launch configurations and * remote connections that they run on. Each launch configuration has an * active remote connection. * * @since 2.0 */ public interface IRemoteLaunchConfigService { /** * Sets the active remote connection for the given launch configuration. * * @param launchConfig launch configuration * @param connection active remote connection */ void setActiveConnection(ILaunchConfiguration launchConfig, IRemoteConnection connection); /** * Gets the active remote connection for the given launch configuration * @param launchConfig launch configuration * @return active remote connection */ IRemoteConnection getActiveConnection(ILaunchConfiguration launchConfig); /** * For a given launch configuration type, get the remote connection that was last * used by a launch configuration of that type. * * This is used for new launch configurations with the assumption that the user * will want to use the same remote connection. * * @param launchConfigType launch configuration type * @return last active remote configuration */ IRemoteConnection getLastActiveConnection(ILaunchConfigurationType launchConfigType); } org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/000077500000000000000000000000001272114001700316755ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/000077500000000000000000000000001272114001700326255ustar00rootroot00000000000000RemoteConnection.java000066400000000000000000000176561272114001700367030ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.HashMap; import java.util.Map; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.ListenerList; import org.eclipse.equinox.security.storage.ISecurePreferences; import org.eclipse.equinox.security.storage.StorageException; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionChangeListener; import org.eclipse.remote.core.IRemoteConnectionControlService; import org.eclipse.remote.core.IRemoteConnectionPropertyService; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.RemoteConnectionChangeEvent; import org.eclipse.remote.core.exception.ConnectionExistsException; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.Preferences; /** * The standard root class for remote connections. Implements common hook up * with the remote services and the remote services manager as well as handling * for services. */ public class RemoteConnection implements IRemoteConnection { private final RemoteConnectionType connectionType; private String name; private final Map, Service> servicesMap = new HashMap<>(); private final ListenerList fListeners = new ListenerList(); final static String EMPTY_STRING = ""; //$NON-NLS-1$ public RemoteConnection(RemoteConnectionType connectionType, String name) { this.connectionType = connectionType; this.name = name; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#getConnectionType() */ @Override public IRemoteConnectionType getConnectionType() { return connectionType; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#getService(java.lang.Class) */ @SuppressWarnings("unchecked") @Override public T getService(Class service) { T obj = (T) servicesMap.get(service); if (obj == null) { obj = connectionType.getConnectionService(this, service); if (obj != null) { servicesMap.put(service, obj); } } return obj; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#hasService(java.lang.Class) */ @Override public boolean hasService(Class service) { return servicesMap.get(service.getName()) != null || connectionType.hasConnectionService(service); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#getName() */ @Override public String getName() { return name; } /** * Called from working copy when name has changed. * * @param name * the new name */ void rename(String newName) throws ConnectionExistsException { try { // Copy the old preferences over and remove the old node if (connectionType.getPreferenceNode().nodeExists(newName)) { throw new ConnectionExistsException(newName); } Preferences newPrefs = connectionType.getPreferenceNode().node(URLEncoder.encode(newName, "UTF-8")); Preferences oldPrefs = getPreferences(); for (String key : oldPrefs.keys()) { newPrefs.put(key, oldPrefs.get(key, null)); } oldPrefs.removeNode(); } catch (BackingStoreException | UnsupportedEncodingException e) { RemoteCorePlugin.log(e); } this.name = newName; } Preferences getPreferences() { try { return connectionType.getPreferenceNode().node(URLEncoder.encode(name, "UTF-8")); //$NON-NLS-1$ } catch (UnsupportedEncodingException e) { // Should not happen! throw new RuntimeException(e); } } ISecurePreferences getSecurePreferences() { try { return connectionType.getSecurePreferencesNode().node(URLEncoder.encode(name, "UTF-8")); //$NON-NLS-1$ } catch (UnsupportedEncodingException e) { // Should not happen! throw new RuntimeException(e); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#getAttribute(java.lang.String) */ @Override public String getAttribute(String key) { return getPreferences().get(key, EMPTY_STRING); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#getSecureAttribute(java.lang.String) */ @Override public String getSecureAttribute(String key) { try { return getSecurePreferences().get(key, EMPTY_STRING); } catch (StorageException e) { RemoteCorePlugin.log(e); return EMPTY_STRING; } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#getWorkingCopy() */ @Override public IRemoteConnectionWorkingCopy getWorkingCopy() { return new RemoteConnectionWorkingCopy(this); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#getProperty(java.lang.String) */ @Override public String getProperty(String key) { IRemoteConnectionPropertyService propertyService = getService(IRemoteConnectionPropertyService.class); if (propertyService != null) { return propertyService.getProperty(key); } else { return null; } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#open(org.eclipse.core.runtime.IProgressMonitor) */ @Override public void open(IProgressMonitor monitor) throws RemoteConnectionException { IRemoteConnectionControlService controlService = getService(IRemoteConnectionControlService.class); if (controlService != null) { controlService.open(monitor); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#close() */ @Override public void close() { IRemoteConnectionControlService controlService = getService(IRemoteConnectionControlService.class); if (controlService != null) { controlService.close(); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#isOpen() */ @Override public boolean isOpen() { IRemoteConnectionControlService controlService = getService(IRemoteConnectionControlService.class); if (controlService != null) { return controlService.isOpen(); } else { // default is always open return true; } } /* * (non-Javadoc) * * @see * org.eclipse.remote.core.IRemoteConnection#addConnectionChangeListener(org.eclipse.remote.core.IRemoteConnectionChangeListener * ) */ @Override public void addConnectionChangeListener(IRemoteConnectionChangeListener listener) { fListeners.add(listener); } /* * (non-Javadoc) * * @see * org.eclipse.remote.core.IRemoteConnection#removeConnectionChangeListener(org.eclipse.remote.core. * IRemoteConnectionChangeListener * ) */ @Override public void removeConnectionChangeListener(IRemoteConnectionChangeListener listener) { fListeners.remove(listener); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#fireConnectionChangeEvent(int) */ @Override public void fireConnectionChangeEvent(final int type) { RemoteConnectionChangeEvent event = new RemoteConnectionChangeEvent(this, type); for (Object listener : fListeners.getListeners()) { ((IRemoteConnectionChangeListener) listener).connectionChanged(event); } // fire to the global listeners too connectionType.getRemoteServicesManager().fireRemoteConnectionChangeEvent(event); } /* * (non-Javadoc) * * @see java.lang.Object#toString() */ @Override public String toString() { return name + " - " + connectionType.getName(); //$NON-NLS-1$ } } RemoteConnectionType.java000066400000000000000000000276321272114001700375400ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core; import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URLDecoder; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.equinox.security.storage.ISecurePreferences; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.IRemoteProcess; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.core.RemoteConnectionChangeEvent; import org.eclipse.remote.core.exception.ConnectionExistsException; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.Preferences; /** * The implementation for a given remote services collection.n */ public class RemoteConnectionType implements IRemoteConnectionType { private final RemoteServicesManager remoteServicesManager; private final String id; private final String name; private final String scheme; private final boolean canAdd; private final boolean canEdit; private final boolean canRemove; private final Map, Object> serviceMap = new HashMap<>(); private final Map serviceDefinitionMap = new HashMap<>(); private final Map connectionServiceDefinitionMap = new HashMap<>(); private final Map processServiceDefinitionMap = new HashMap<>(); private final Map connections = new HashMap<>(); public RemoteConnectionType(IConfigurationElement ce, RemoteServicesManager manager) { this.remoteServicesManager = manager; id = ce.getAttribute("id"); //$NON-NLS-1$ name = ce.getAttribute("name"); //$NON-NLS-1$ scheme = ce.getAttribute("scheme"); //$NON-NLS-1$ // capabilities, default is true for all of these String canAddStr = ce.getAttribute("canAdd"); //$NON-NLS-1$ canAdd = canAddStr != null ? Boolean.parseBoolean(canAddStr) : true; String canEditStr = ce.getAttribute("canEdit"); //$NON-NLS-1$ canEdit = canEditStr != null ? Boolean.parseBoolean(canEditStr) : true; String canRemoveStr = ce.getAttribute("canRemove"); //$NON-NLS-1$ canRemove = canRemoveStr != null ? Boolean.parseBoolean(canRemoveStr) : true; // load up existing connections try { for (String nodeName : getPreferenceNode().childrenNames()) { String connectionName = URLDecoder.decode(nodeName, "UTF-8"); connections.put(connectionName, new RemoteConnection(this, connectionName)); } } catch (BackingStoreException | UnsupportedEncodingException e) { RemoteCorePlugin.log(e); } } Preferences getPreferenceNode() { return remoteServicesManager.getPreferenceNode().node(id); } ISecurePreferences getSecurePreferencesNode() { return remoteServicesManager.getSecurePreferenceNode().node(id); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionType#getRemoteServicesManager() */ @Override public IRemoteServicesManager getRemoteServicesManager() { return remoteServicesManager; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionType#getId() */ @Override public String getId() { return id; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionType#getName() */ @Override public String getName() { return name; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionType#getScheme() */ @Override public String getScheme() { return scheme; } @Override public boolean canAdd() { return canAdd; } @Override public boolean canEdit() { return canEdit; } @Override public boolean canRemove() { return canRemove; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionType#getService(java.lang.Class) */ @Override public T getService(Class service) { @SuppressWarnings("unchecked") T obj = (T) serviceMap.get(service); if (obj == null) { IConfigurationElement ce = serviceDefinitionMap.get(service.getName()); if (ce != null) { try { Service.Factory factory = (Service.Factory) ce.createExecutableExtension("factory"); //$NON-NLS-1$ if (factory != null) { obj = factory.getService(this, service); serviceMap.put(service, obj); } } catch (CoreException e) { RemoteCorePlugin.log(e.getStatus()); } } } return obj; } @Override public List getServices() { return new ArrayList<>(serviceDefinitionMap.keySet()); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionType#hasService(java.lang.Class) */ @Override public boolean hasService(Class service) { return serviceDefinitionMap.get(service.getName()) != null; } /** * Called from the connection to get a service object for that connection. * * @param connection * the connection to which the service applies * @param service * the interface the service must implement * @return the service object * @throws CoreException */ public T getConnectionService(IRemoteConnection connection, Class service) { IConfigurationElement ce = connectionServiceDefinitionMap.get(service.getName()); if (ce != null) { try { IRemoteConnection.Service.Factory factory = (IRemoteConnection.Service.Factory) ce .createExecutableExtension("factory"); //$NON-NLS-1$ if (factory != null) { return factory.getService(connection, service); } } catch (CoreException e) { RemoteCorePlugin.log(e.getStatus()); } } return null; } @Override public List getConnectionServices() { return new ArrayList<>(connectionServiceDefinitionMap.keySet()); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionType#hasConnectionService(java.lang.Class) */ @Override public boolean hasConnectionService(Class service) { return connectionServiceDefinitionMap.get(service.getName()) != null; } /** * Called from the remote process to get a service object for that process. * * @param process * the process to which the service applies * @param service * the interface the service must implement * @return the service object * @throws CoreException */ public T getProcessService(IRemoteProcess process, Class service) { IConfigurationElement ce = processServiceDefinitionMap.get(service.getName()); if (ce != null) { try { IRemoteProcess.Service.Factory factory = (IRemoteProcess.Service.Factory) ce.createExecutableExtension("factory"); //$NON-NLS-1$ if (factory != null) { return factory.getService(process, service); } } catch (CoreException e) { RemoteCorePlugin.log(e.getStatus()); } } return null; } @Override public List getProcessServices() { return new ArrayList<>(processServiceDefinitionMap.keySet()); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionType#hasProcessService(java.lang.Class) */ @Override public boolean hasProcessService(Class service) { return processServiceDefinitionMap.get(service.getName()) != null; } /** * Called from the remote service manager to register a service extension for * this remote services implementation * * @param ce * the extension element defining the service */ public void addService(IConfigurationElement ce) { String serviceName = ce.getAttribute("service"); //$NON-NLS-1$ String name = ce.getName(); switch (name) { case "connectionTypeService": //$NON-NLS-1$ serviceDefinitionMap.put(serviceName, ce); break; case "connectionService": //$NON-NLS-1$ connectionServiceDefinitionMap.put(serviceName, ce); break; case "processService": //$NON-NLS-1$ processServiceDefinitionMap.put(serviceName, ce); break; } } /** * Signal connection has been added. * * @since 2.0 */ protected void connectionAdded(final IRemoteConnection connection) { RemoteConnectionChangeEvent event = new RemoteConnectionChangeEvent(connection, RemoteConnectionChangeEvent.CONNECTION_ADDED); remoteServicesManager.fireRemoteConnectionChangeEvent(event); } /** * Signal a connnection is about to be removed. * * @since 2.0 */ protected void connectionRemoved(final IRemoteConnection connection) { RemoteConnectionChangeEvent event = new RemoteConnectionChangeEvent(connection, RemoteConnectionChangeEvent.CONNECTION_REMOVED); remoteServicesManager.fireRemoteConnectionChangeEvent(event); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionType#getConnection(java.lang.String) */ @Override public IRemoteConnection getConnection(String name) { synchronized (connections) { return connections.get(name); } } @Override public IRemoteConnection getConnection(URI uri) { synchronized (connections) { IRemoteConnection connection = connections.get(uri.getAuthority()); if (connection != null) { return connection; } // If it's a file: scheme we must be the local connection type, just return our // hopefully one connection, the Local connection. if (uri.getScheme().equals("file") && !connections.isEmpty()) { //$NON-NLS-1$ return connections.values().iterator().next(); } return null; } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionType#getConnections() */ @Override public List getConnections() { synchronized (connections) { return new ArrayList(connections.values()); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionType#newConnection(java.lang.String) */ @Override public IRemoteConnectionWorkingCopy newConnection(String name) throws RemoteConnectionException { synchronized (connections) { if (connections.containsKey(name)) { throw new ConnectionExistsException(name); } return new RemoteConnectionWorkingCopy(this, name); } } void addConnection(RemoteConnection remoteConnection) { synchronized (connections) { connections.put(remoteConnection.getName(), remoteConnection); } } void removeConnection(String name) { synchronized (connections) { connections.remove(name); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionType#removeConnection(org.eclipse.remote.core.IRemoteConnection) */ @Override public void removeConnection(IRemoteConnection connection) throws RemoteConnectionException { synchronized (connections) { if (connection instanceof RemoteConnection) { connection.close(); RemoteConnection conn = (RemoteConnection) connection; try { conn.getPreferences().removeNode(); } catch (BackingStoreException e) { throw new RemoteConnectionException(e); } conn.getSecurePreferences().removeNode(); connections.remove(conn.getName()); connection.fireConnectionChangeEvent(RemoteConnectionChangeEvent.CONNECTION_REMOVED); } else { RemoteCorePlugin.log("Wrong class for " + connection.getName() + ", was " + connection.getClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$ } } } } RemoteConnectionWorkingCopy.java000066400000000000000000000247771272114001700411010ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.equinox.security.storage.ISecurePreferences; import org.eclipse.equinox.security.storage.StorageException; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionChangeListener; import org.eclipse.remote.core.IRemoteConnectionControlService; import org.eclipse.remote.core.IRemoteConnectionPropertyService; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.RemoteConnectionChangeEvent; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.Preferences; public class RemoteConnectionWorkingCopy implements IRemoteConnectionWorkingCopy { private RemoteConnection original; private final RemoteConnectionType connectionType; private String newName; private final Map newAttributes = new HashMap<>(); private final Map newSecureAttributes = new HashMap<>(); private final List newListeners = new ArrayList<>(); /** * New Connection. */ public RemoteConnectionWorkingCopy(RemoteConnectionType connectionType, String name) { this.connectionType = connectionType; this.newName = name; } /** * Edit Connection */ public RemoteConnectionWorkingCopy(RemoteConnection original) { this.original = original; this.connectionType = (RemoteConnectionType) original.getConnectionType(); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#getName() */ @Override public String getName() { if (newName != null) { return newName; } if (original != null) { return original.getName(); } return null; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionWorkingCopy#setName(java.lang.String) */ @Override public void setName(String name) { // set it only if it's changed if (original == null || !name.equals(original.getName())) { newName = name; } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#getAttribute(java.lang.String) */ @Override public String getAttribute(String key) { String value = newAttributes.get(key); if (value != null) { return value; } if (original != null) { return original.getAttribute(key); } return RemoteConnection.EMPTY_STRING; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionWorkingCopy#setAttribute(java.lang.String, java.lang.String) */ @Override public void setAttribute(String key, String value) { // set only if it's changed or value is null if (original == null || value == null || !value.equals(original.getAttribute(key))) { newAttributes.put(key, value); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#getSecureAttribute(java.lang.String) */ @Override public String getSecureAttribute(String key) { String value = newSecureAttributes.get(key); if (value != null) { return value; } if (original != null) { return original.getSecureAttribute(key); } return RemoteConnection.EMPTY_STRING; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionWorkingCopy#setSecureAttribute(java.lang.String, java.lang.String) */ @Override public void setSecureAttribute(String key, String value) { // set only if it's changed or value is null if (original == null || value == null || !value.equals(original.getSecureAttribute(key))) { newSecureAttributes.put(key, value); } } /* * (non-Javadoc) * * @see * org.eclipse.remote.core.IRemoteConnection#addConnectionChangeListener(org.eclipse.remote.core.IRemoteConnectionChangeListener * ) */ @Override public void addConnectionChangeListener(IRemoteConnectionChangeListener listener) { if (original != null) { original.addConnectionChangeListener(listener); } else { newListeners.add(listener); } } /* * (non-Javadoc) * * @see * org.eclipse.remote.core.IRemoteConnection#removeConnectionChangeListener(org.eclipse.remote.core.IRemoteConnectionChangeListener * ) */ @Override public void removeConnectionChangeListener(IRemoteConnectionChangeListener listener) { if (original != null) { original.removeConnectionChangeListener(listener); } else { newListeners.remove(listener); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#fireConnectionChangeEvent(int) */ @Override public void fireConnectionChangeEvent(int type) { if (original != null && type != RemoteConnectionChangeEvent.CONNECTION_RENAMED) { original.fireConnectionChangeEvent(type); } else { RemoteConnectionChangeEvent event = new RemoteConnectionChangeEvent(this, type); for (IRemoteConnectionChangeListener listener : newListeners) { listener.connectionChanged(event); } connectionType.getRemoteServicesManager().fireRemoteConnectionChangeEvent(event); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#getConnectionType() */ @Override public IRemoteConnectionType getConnectionType() { return connectionType; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#getWorkingCopy() */ @Override public IRemoteConnectionWorkingCopy getWorkingCopy() { return this; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#getService(java.lang.Class) */ @Override public T getService(Class service) { return connectionType.getConnectionService(this, service); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#hasService(java.lang.Class) */ @Override public boolean hasService(Class service) { if (original != null) { return original.hasService(service); } else { return connectionType.hasConnectionService(service); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionWorkingCopy#getOriginal() */ @Override public IRemoteConnection getOriginal() { return original; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionWorkingCopy#isDirty() */ @Override public boolean isDirty() { return newName != null || !newAttributes.isEmpty() || !newSecureAttributes.isEmpty(); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionWorkingCopy#save() */ @Override public IRemoteConnection save() throws RemoteConnectionException { if (newName != null && original != null) { // rename, delete the old one fireConnectionChangeEvent(RemoteConnectionChangeEvent.CONNECTION_RENAMED); connectionType.removeConnection(original.getName()); original.rename(newName); } boolean added = false; if (original == null) { original = new RemoteConnection(connectionType, newName); added = true; } Preferences prefs = original.getPreferences(); for (Map.Entry entry : newAttributes.entrySet()) { String value = entry.getValue(); if (value != null && !value.isEmpty()) { prefs.put(entry.getKey(), value); } else { prefs.remove(entry.getKey()); } } try { prefs.flush(); } catch (BackingStoreException e1) { throw new RemoteConnectionException(e1); } ISecurePreferences securePrefs = original.getSecurePreferences(); for (Map.Entry entry : newSecureAttributes.entrySet()) { String value = entry.getValue(); if (value != null && !value.isEmpty()) { try { securePrefs.put(entry.getKey(), value, true); } catch (StorageException e) { throw new RemoteConnectionException(e); } } else { securePrefs.remove(entry.getKey()); } } try { securePrefs.flush(); } catch (IOException e) { throw new RemoteConnectionException(e); } /* * Reset state for isDirty() */ newAttributes.clear(); newSecureAttributes.clear(); newName = null; connectionType.addConnection(original); if (added) { original.fireConnectionChangeEvent(RemoteConnectionChangeEvent.CONNECTION_ADDED); } return original; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#open(org.eclipse.core.runtime.IProgressMonitor) */ @Override public void open(IProgressMonitor monitor) throws RemoteConnectionException { if (original != null) { original.open(monitor); } else { IRemoteConnectionControlService controlService = connectionType.getConnectionService(this, IRemoteConnectionControlService.class); if (controlService != null) { controlService.open(monitor); } } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#close() */ @Override public void close() { if (original != null) { original.close(); } else { IRemoteConnectionControlService controlService = connectionType.getConnectionService(this, IRemoteConnectionControlService.class); if (controlService != null) { controlService.close(); } } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#isOpen() */ @Override public boolean isOpen() { if (original != null) { return original.isOpen(); } IRemoteConnectionControlService controlService = connectionType.getConnectionService(this, IRemoteConnectionControlService.class); if (controlService != null) { return controlService.isOpen(); } return true; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection#getProperty(java.lang.String) */ @Override public String getProperty(String key) { if (original != null) { return original.getProperty(key); } IRemoteConnectionPropertyService propertyService = connectionType.getConnectionService(this, IRemoteConnectionPropertyService.class); if (propertyService != null) { return propertyService.getProperty(key); } return null; } } RemoteCorePlugin.java000066400000000000000000000103541272114001700366370ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core; import org.eclipse.core.resources.ISaveContext; import org.eclipse.core.resources.ISaveParticipant; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Status; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.core.launch.IRemoteLaunchConfigService; import org.eclipse.remote.internal.core.launch.RemoteLaunchConfigService; import org.eclipse.remote.internal.core.preferences.Preferences; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; /** * The activator class controls the plug-in life cycle */ public class RemoteCorePlugin extends Plugin { private static final String PLUGIN_ID = "org.eclipse.remote.core"; //$NON-NLS-1$ // The shared instance private static RemoteCorePlugin plugin; /** * Returns the shared instance * * @return the shared instance */ public static RemoteCorePlugin getDefault() { return plugin; } /** * Get unique identifier for this plugin */ public static String getUniqueIdentifier() { if (getDefault() == null) { return PLUGIN_ID; } return getDefault().getBundle().getSymbolicName(); } /** * Logs the specified status with this plug-in's log. * * @param status * status to log */ public static void log(IStatus status) { getDefault().getLog().log(status); } /** * Logs an internal error with the specified message. * * @param message * the error message to log */ public static void log(String message) { log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, message, null)); } /** * Logs an internal error with the specified throwable * * @param e * the exception to be logged */ public static void log(Throwable e) { log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, e.getMessage(), e)); } /** * Return the OSGi service with the given service interface. * * @param service service interface * @return the specified service or null if it's not registered */ public static T getService(Class service) { BundleContext context = plugin.getBundle().getBundleContext(); ServiceReference ref = context.getServiceReference(service); return ref != null ? context.getService(ref) : null; } /** * The constructor */ public RemoteCorePlugin() { } /* * (non-Javadoc) * * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext ) */ @Override public void start(BundleContext context) throws Exception { super.start(context); plugin = this; context.registerService(IRemoteServicesManager.class, new RemoteServicesManager(), null); context.registerService(IRemoteLaunchConfigService.class, new RemoteLaunchConfigService(), null); RemoteDebugOptions.configure(context); ResourcesPlugin.getWorkspace().addSaveParticipant(getUniqueIdentifier(), new ISaveParticipant() { @Override public void saving(ISaveContext saveContext) throws CoreException { Preferences.savePreferences(); } @Override public void rollback(ISaveContext saveContext) { // Do nothing } @Override public void prepareToSave(ISaveContext saveContext) throws CoreException { // Do nothing } @Override public void doneSaving(ISaveContext saveContext) { // Do nothing } }); } /* * (non-Javadoc) * * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext ) */ @Override public void stop(BundleContext context) throws Exception { Preferences.savePreferences(); plugin = null; super.stop(context); } } RemoteDebugOptions.java000066400000000000000000000077761272114001700372100ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/******************************************************************************* * Copyright (c) 2012 Sage Electronic Engineering, LLC. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Jason Litton (Sage Electronic Engineering, LLC) - initial API and implementation * Greg Watson (IBM) - adapted for remote core *******************************************************************************/ package org.eclipse.remote.internal.core; import java.util.Hashtable; import org.eclipse.osgi.service.debug.DebugOptions; import org.eclipse.osgi.service.debug.DebugOptionsListener; import org.eclipse.osgi.service.debug.DebugTrace; import org.eclipse.osgi.util.NLS; import org.osgi.framework.BundleContext; /** * Hooks our debug options to the Platform trace functonality. * In essence, we can open Window -> Preferences -> Tracing * and turn on debug options for this package. The debug output * will come out on the console and can be saved directly to * a file. Classes that need to be debugged can call into * RemoteDebugOptions to get debug flags. If new flags need to be * created, they will need to have a unique identifier and added to * the .options file in this plugin */ public class RemoteDebugOptions implements DebugOptionsListener { public static final String DEBUG_REMOTE_COMMANDS = "/debug/commands"; //$NON-NLS-1$ private static DebugTrace fDebugTrace; private static DebugOptions fDebugOptions; private static RemoteDebugOptions fRemoteDebugOptions; public static void configure(BundleContext context) { if (fRemoteDebugOptions == null) { fRemoteDebugOptions = new RemoteDebugOptions(context); } } private RemoteDebugOptions(BundleContext context) { Hashtable props = new Hashtable(2); props.put(DebugOptions.LISTENER_SYMBOLICNAME, RemoteCorePlugin.getUniqueIdentifier()); context.registerService(DebugOptionsListener.class.getName(), this, props); } /* * (non-Javadoc) * * @see org.eclipse.osgi.service.debug.DebugOptionsListener#optionsChanged(org.eclipse.osgi.service.debug.DebugOptions) */ @Override public void optionsChanged(DebugOptions options) { fDebugOptions = options; fDebugTrace = options.newDebugTrace(RemoteCorePlugin.getUniqueIdentifier()); } public static boolean isDebugging() { return RemoteCorePlugin.getDefault().isDebugging(); } public static boolean isDebugging(String option) { if (fDebugOptions == null) { return false; } return fDebugOptions.getBooleanOption(RemoteCorePlugin.getUniqueIdentifier() + option, false); } public static void setDebugging(String option, boolean value) { if (fDebugOptions != null) { if (value) { fDebugOptions.setDebugEnabled(true); } fDebugOptions.setOption(option, Boolean.toString(value)); } } /** * Prints the given message to System.out and to the OSGi tracing (if enabled) * * @param message * the message or null */ public static void trace(String message) { trace(null, message); } /** * Prints the given message to System.out and to the OSGi tracing (if enabled) * * @param option * the option to determine if tracing is displayed * @param message * the message or null * @param arguments * optional arguments for the message or null */ public static void trace(String option, String message, String... arguments) { String traceMsg = message; if (arguments.length > 0) { traceMsg = NLS.bind(message, arguments); } if ((option != null && isDebugging(option)) || isDebugging()) { System.out.println(traceMsg); if (fDebugTrace != null) { fDebugTrace.trace(option, traceMsg, null); } } } } RemotePath.java000066400000000000000000001137321272114001700354700ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/******************************************************************************* * Copyright (c) 2000, 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * Patrick Tasse - Add extra constructor to Path class (bug 454959) * Martin Oberhuber - [468889] Copy from equinox.common/org.eclipse.core.runtime *******************************************************************************/ package org.eclipse.remote.internal.core; import java.io.File; import java.util.Arrays; import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.IPath; /** * The Eclipse Mars implementation of org.eclipse.core.runtime.Path. * * Cloned from org.eclipse.equinox.common. This class should be removed when * Eclipse older than Mars no longer needs to be supported. * * @see org.eclipse.core.runtime.Path * @noextend This class is not intended to be subclassed by clients. */ public class RemotePath implements IPath, Cloneable { /** masks for flag values */ private static final int HAS_LEADING = 1; private static final int IS_UNC = 2; private static final int HAS_TRAILING = 4; private static final int IS_FOR_WINDOWS = 8; private static final int ALL_SEPARATORS = HAS_LEADING | IS_UNC | HAS_TRAILING; private static final int ALL_FLAGS = HAS_LEADING | IS_UNC | HAS_TRAILING | IS_FOR_WINDOWS; /** Constant value indicating if the current platform is Windows */ private static final boolean RUNNING_ON_WINDOWS = java.io.File.separatorChar == '\\'; /** Constant empty string value. */ private static final String EMPTY_STRING = ""; //$NON-NLS-1$ /** Constant value indicating no segments */ private static final String[] NO_SEGMENTS = new String[0]; /** Constant value containing the empty path with no device on the local file system. */ public static final RemotePath EMPTY = new RemotePath(EMPTY_STRING); /** Mask for all bits that are involved in the hash code */ private static final int HASH_MASK = ~(HAS_TRAILING | IS_FOR_WINDOWS); /** Constant root path string ("/"). */ private static final String ROOT_STRING = "/"; //$NON-NLS-1$ /** Constant value containing the root path with no device on the local file system. */ public static final RemotePath ROOT = new RemotePath(ROOT_STRING); /** The device id string. May be null if there is no device. */ private String device = null; //Private implementation note: the segments array and flag bitmap //are never modified, so that they can be shared between path instances /** The path segments */ private String[] segments; /** flags indicating separators (has leading, is UNC, has trailing, is for Windows) */ private int flags; /** * Constructs a new path from the given string path. * The string path must represent a valid file system path * on the local file system. * The path is canonicalized and double slashes are removed * except at the beginning. (to handle UNC paths). All forward * slashes ('/') are treated as segment delimiters, and any * segment and device delimiters for the local file system are * also respected. * * @param pathString the portable string path * @see IPath#toPortableString() * @since 3.1 */ public static IPath fromOSString(String pathString) { return new RemotePath(pathString); } /** * Constructs a new path from the given path string. * The path string must have been produced by a previous * call to IPath.toPortableString. * * @param pathString the portable path string * @see IPath#toPortableString() * @since 3.1 */ public static IPath fromPortableString(String pathString) { int firstMatch = pathString.indexOf(DEVICE_SEPARATOR) + 1; //no extra work required if no device characters if (firstMatch <= 0) return new RemotePath().initialize(null, pathString, RUNNING_ON_WINDOWS); //if we find a single colon, then the path has a device String devicePart = null; int pathLength = pathString.length(); if (firstMatch == pathLength || pathString.charAt(firstMatch) != DEVICE_SEPARATOR) { devicePart = pathString.substring(0, firstMatch); pathString = pathString.substring(firstMatch, pathLength); } //optimize for no colon literals if (pathString.indexOf(DEVICE_SEPARATOR) == -1) return new RemotePath().initialize(devicePart, pathString, RUNNING_ON_WINDOWS); //contract colon literals char[] chars = pathString.toCharArray(); int readOffset = 0, writeOffset = 0, length = chars.length; while (readOffset < length) { if (chars[readOffset] == DEVICE_SEPARATOR) if (++readOffset >= length) break; chars[writeOffset++] = chars[readOffset++]; } return new RemotePath().initialize(devicePart, new String(chars, 0, writeOffset), RUNNING_ON_WINDOWS); } /** * Constructs a new POSIX path from the given string path. The string path * must represent a valid file system path on a POSIX file system. The path * is canonicalized and double slashes are removed except at the beginning * (to handle UNC paths). All forward slashes ('/') are treated as segment * delimiters. This factory method should be used if the string path is for * a POSIX file system. * * @param fullPath the string path * @see #isValidPosixPath(String) * @since 3.7 */ public static RemotePath forPosix(String fullPath) { return new RemotePath(fullPath, false); } /** * Constructs a new Windows path from the given string path. The string path * must represent a valid file system path on the Windows file system. The * path is canonicalized and double slashes are removed except at the * beginning (to handle UNC paths). All forward slashes ('/') are treated as * segment delimiters, and any segment ('\') and device (':') delimiters for * the Windows file system are also respected. This factory method should be * used if the string path is for the Windows file system. * * @param fullPath the string path * @see #isValidWindowsPath(String) * @since 3.7 */ public static RemotePath forWindows(String fullPath) { return new RemotePath(fullPath, true); } /* (Intentionally not included in javadoc) * Private constructor. */ private RemotePath() { // not allowed } /** * Constructs a new path from the given string path. * The string path must represent a valid file system path * on the local file system. * The path is canonicalized and double slashes are removed * except at the beginning. (to handle UNC paths). All forward * slashes ('/') are treated as segment delimiters, and any * segment and device delimiters for the local file system are * also respected (such as colon (':') and backslash ('\') on some file systems). * This constructor should be used if the string path if for the local file system. * * @param fullPath the string path * @see #isValidPath(String) */ public RemotePath(String fullPath) { this(fullPath, RUNNING_ON_WINDOWS); } /** * Constructs a new path from the given device id and string path. * The given string path must be valid. * The path is canonicalized and double slashes are removed except * at the beginning (to handle UNC paths). All forward * slashes ('/') are treated as segment delimiters, and any * segment delimiters for the local file system are * also respected (such as backslash ('\') on some file systems). * * @param device the device id * @param path the string path * @see #isValidPath(String) * @see #setDevice(String) */ public RemotePath(String device, String path) { if (RUNNING_ON_WINDOWS) { //convert backslash to forward slash path = path.indexOf('\\') == -1 ? path : path.replace('\\', SEPARATOR); } initialize(device, path, RUNNING_ON_WINDOWS); } /** * Constructs a new path from the given string path. The string path must * represent a valid file system path on the specified file system. The path * is canonicalized and double slashes are removed except at the beginning * (to handle UNC paths). All forward slashes ('/') are treated as segment * delimiters, and any segment and device delimiters for the specified file * system are also respected (such as colon (':') and backslash ('\') on * Windows). * * @param fullPath the string path * @param forWindows true if the string path is for the Windows file system * @since 3.7 */ private RemotePath(String fullPath, boolean forWindows) { String devicePart = null; if (forWindows) { //convert backslash to forward slash fullPath = fullPath.indexOf('\\') == -1 ? fullPath : fullPath.replace('\\', SEPARATOR); //extract device int i = fullPath.indexOf(DEVICE_SEPARATOR); if (i != -1) { //remove leading slash from device part to handle output of URL.getFile() int start = fullPath.charAt(0) == SEPARATOR ? 1 : 0; devicePart = fullPath.substring(start, i + 1); fullPath = fullPath.substring(i + 1, fullPath.length()); } } initialize(devicePart, fullPath, forWindows); } /* (Intentionally not included in javadoc) * Private constructor. */ private RemotePath(String device, String[] segments, int flags) { // no segment validations are done for performance reasons this.segments = segments; this.device = device; //hash code is cached in all but the bottom four bits of the flags field this.flags = (computeHashCode() << 4) | (flags & ALL_FLAGS); } /* (Intentionally not included in javadoc) * @see IPath#addFileExtension */ @Override public IPath addFileExtension(String extension) { if (isRoot() || isEmpty() || hasTrailingSeparator()) return this; int len = segments.length; String[] newSegments = new String[len]; System.arraycopy(segments, 0, newSegments, 0, len - 1); newSegments[len - 1] = segments[len - 1] + '.' + extension; return new RemotePath(device, newSegments, flags); } /* (Intentionally not included in javadoc) * @see IPath#addTrailingSeparator */ @Override public IPath addTrailingSeparator() { if (hasTrailingSeparator() || isRoot()) { return this; } //XXX workaround, see 1GIGQ9V if (isEmpty()) { return new RemotePath(device, segments, (flags & IS_FOR_WINDOWS) | HAS_LEADING); } return new RemotePath(device, segments, flags | HAS_TRAILING); } /* (Intentionally not included in javadoc) * @see IPath#append(IPath) */ @Override public IPath append(IPath tail) { //optimize some easy cases if (tail == null || tail.segmentCount() == 0) return this; //these call chains look expensive, but in most cases they are no-ops //the tail must be for the same platform as this instance if (this.isEmpty() && ((flags & IS_FOR_WINDOWS) == 0) == tail.isValidSegment(":")) //$NON-NLS-1$ return tail.setDevice(device).makeRelative().makeUNC(isUNC()); if (this.isRoot() && ((flags & IS_FOR_WINDOWS) == 0) == tail.isValidSegment(":")) //$NON-NLS-1$ return tail.setDevice(device).makeAbsolute().makeUNC(isUNC()); //concatenate the two segment arrays int myLen = segments.length; int tailLen = tail.segmentCount(); String[] newSegments = new String[myLen + tailLen]; System.arraycopy(segments, 0, newSegments, 0, myLen); for (int i = 0; i < tailLen; i++) { newSegments[myLen + i] = tail.segment(i); } //use my leading separators and the tail's trailing separator RemotePath result = new RemotePath(device, newSegments, (flags & (HAS_LEADING | IS_UNC | IS_FOR_WINDOWS)) | (tail.hasTrailingSeparator() ? HAS_TRAILING : 0)); String tailFirstSegment = newSegments[myLen]; if (tailFirstSegment.equals("..") || tailFirstSegment.equals(".")) { //$NON-NLS-1$ //$NON-NLS-2$ result.canonicalize(); } return result; } /* (Intentionally not included in javadoc) * @see IPath#append(java.lang.String) */ @Override public IPath append(String tail) { //optimize addition of a single segment if (tail.indexOf(SEPARATOR) == -1 && tail.indexOf("\\") == -1 && tail.indexOf(DEVICE_SEPARATOR) == -1) { //$NON-NLS-1$ int tailLength = tail.length(); if (tailLength < 3) { //some special cases if (tailLength == 0 || ".".equals(tail)) { //$NON-NLS-1$ return this; } if ("..".equals(tail)) //$NON-NLS-1$ return removeLastSegments(1); } //just add the segment int myLen = segments.length; String[] newSegments = new String[myLen + 1]; System.arraycopy(segments, 0, newSegments, 0, myLen); newSegments[myLen] = tail; return new RemotePath(device, newSegments, flags & ~HAS_TRAILING); } //go with easy implementation return append(new RemotePath(tail, (flags & IS_FOR_WINDOWS) != 0)); } /** * Destructively converts this path to its canonical form. *

* In its canonical form, a path does not have any * "." segments, and parent references ("..") are collapsed * where possible. *

* @return true if the path was modified, and false otherwise. */ private boolean canonicalize() { //look for segments that need canonicalizing for (int i = 0, max = segments.length; i < max; i++) { String segment = segments[i]; if (segment.charAt(0) == '.' && (segment.equals("..") || segment.equals("."))) { //$NON-NLS-1$ //$NON-NLS-2$ //path needs to be canonicalized collapseParentReferences(); //paths of length 0 have no trailing separator if (segments.length == 0) flags &= (HAS_LEADING | IS_UNC); //recompute hash because canonicalize affects hash flags = (flags & ALL_FLAGS) | (computeHashCode() << 4); return true; } } return false; } /* (Intentionally not included in javadoc) * Clones this object. */ @Override public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException e) { return null; } } /** * Destructively removes all occurrences of ".." segments from this path. */ private void collapseParentReferences() { int segmentCount = segments.length; String[] stack = new String[segmentCount]; int stackPointer = 0; for (int i = 0; i < segmentCount; i++) { String segment = segments[i]; if (segment.equals("..")) { //$NON-NLS-1$ if (stackPointer == 0) { // if the stack is empty we are going out of our scope // so we need to accumulate segments. But only if the original // path is relative. If it is absolute then we can't go any higher than // root so simply toss the .. references. if (!isAbsolute()) stack[stackPointer++] = segment; //stack push } else { // if the top is '..' then we are accumulating segments so don't pop if ("..".equals(stack[stackPointer - 1])) //$NON-NLS-1$ stack[stackPointer++] = ".."; //$NON-NLS-1$ else stackPointer--; //stack pop } //collapse current references } else if (!segment.equals(".") || segmentCount == 1) //$NON-NLS-1$ stack[stackPointer++] = segment; //stack push } //if the number of segments hasn't changed, then no modification needed if (stackPointer == segmentCount) return; //build the new segment array backwards by popping the stack String[] newSegments = new String[stackPointer]; System.arraycopy(stack, 0, newSegments, 0, stackPointer); this.segments = newSegments; } /** * Removes duplicate slashes from the given path, with the exception * of leading double slash which represents a UNC path. */ private String collapseSlashes(String path) { int length = path.length(); // if the path is only 0, 1 or 2 chars long then it could not possibly have illegal // duplicate slashes. if (length < 3) return path; // check for an occurrence of // in the path. Start at index 1 to ensure we skip leading UNC // // If there are no // then there is nothing to collapse so just return. if (path.indexOf("//", 1) == -1) //$NON-NLS-1$ return path; // We found an occurrence of // in the path so do the slow collapse. char[] result = new char[path.length()]; int count = 0; boolean hasPrevious = false; char[] characters = path.toCharArray(); for (int index = 0; index < characters.length; index++) { char c = characters[index]; if (c == SEPARATOR) { if (hasPrevious) { // skip double slashes, except for beginning of UNC. // note that a UNC path can't have a device. if (device == null && index == 1) { result[count] = c; count++; } } else { hasPrevious = true; result[count] = c; count++; } } else { hasPrevious = false; result[count] = c; count++; } } return new String(result, 0, count); } /* (Intentionally not included in javadoc) * Computes the hash code for this object. */ private int computeHashCode() { int hash = device == null ? 17 : device.hashCode(); int segmentCount = segments.length; for (int i = 0; i < segmentCount; i++) { //this function tends to given a fairly even distribution hash = hash * 37 + segments[i].hashCode(); } return hash; } /* (Intentionally not included in javadoc) * Returns the size of the string that will be created by toString or toOSString. */ private int computeLength() { int length = 0; if (device != null) length += device.length(); if ((flags & HAS_LEADING) != 0) length++; if ((flags & IS_UNC) != 0) length++; //add the segment lengths int max = segments.length; if (max > 0) { for (int i = 0; i < max; i++) { length += segments[i].length(); } //add the separator lengths length += max - 1; } if ((flags & HAS_TRAILING) != 0) length++; return length; } /* (Intentionally not included in javadoc) * Returns the number of segments in the given path */ private int computeSegmentCount(String path) { int len = path.length(); if (len == 0 || (len == 1 && path.charAt(0) == SEPARATOR)) { return 0; } int count = 1; int prev = -1; int i; while ((i = path.indexOf(SEPARATOR, prev + 1)) != -1) { if (i != prev + 1 && i != len) { ++count; } prev = i; } if (path.charAt(len - 1) == SEPARATOR) { --count; } return count; } /** * Computes the segment array for the given canonicalized path. */ private String[] computeSegments(String path) { // performance sensitive --- avoid creating garbage int segmentCount = computeSegmentCount(path); if (segmentCount == 0) return NO_SEGMENTS; String[] newSegments = new String[segmentCount]; int len = path.length(); // check for initial slash int firstPosition = (path.charAt(0) == SEPARATOR) ? 1 : 0; // check for UNC if (firstPosition == 1 && len > 1 && (path.charAt(1) == SEPARATOR)) firstPosition = 2; int lastPosition = (path.charAt(len - 1) != SEPARATOR) ? len - 1 : len - 2; // for non-empty paths, the number of segments is // the number of slashes plus 1, ignoring any leading // and trailing slashes int next = firstPosition; for (int i = 0; i < segmentCount; i++) { int start = next; int end = path.indexOf(SEPARATOR, next); if (end == -1) { newSegments[i] = path.substring(start, lastPosition + 1); } else { newSegments[i] = path.substring(start, end); } next = end + 1; } return newSegments; } /** * Returns the platform-neutral encoding of the given segment onto * the given string buffer. This escapes literal colon characters with double colons. */ private void encodeSegment(String string, StringBuffer buf) { int len = string.length(); for (int i = 0; i < len; i++) { char c = string.charAt(i); buf.append(c); if (c == DEVICE_SEPARATOR) buf.append(DEVICE_SEPARATOR); } } /* (Intentionally not included in javadoc) * Compares objects for equality. */ @Override public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof RemotePath)) return false; RemotePath target = (RemotePath) obj; //check leading separators and hash code if ((flags & HASH_MASK) != (target.flags & HASH_MASK)) return false; String[] targetSegments = target.segments; int i = segments.length; //check segment count if (i != targetSegments.length) return false; //check segments in reverse order - later segments more likely to differ while (--i >= 0) if (!segments[i].equals(targetSegments[i])) return false; //check device last (least likely to differ) return device == target.device || (device != null && device.equals(target.device)); } /* (Intentionally not included in javadoc) * @see IPath#getDevice */ @Override public String getDevice() { return device; } /* (Intentionally not included in javadoc) * @see IPath#getFileExtension */ @Override public String getFileExtension() { if (hasTrailingSeparator()) { return null; } String lastSegment = lastSegment(); if (lastSegment == null) { return null; } int index = lastSegment.lastIndexOf('.'); if (index == -1) { return null; } return lastSegment.substring(index + 1); } /* (Intentionally not included in javadoc) * Computes the hash code for this object. */ @Override public int hashCode() { return flags & HASH_MASK; } /* (Intentionally not included in javadoc) * @see IPath#hasTrailingSeparator2 */ @Override public boolean hasTrailingSeparator() { return (flags & HAS_TRAILING) != 0; } /* * Initialize the current path with the given string. */ private IPath initialize(String deviceString, String path, boolean forWindows) { Assert.isNotNull(path); this.device = deviceString; path = collapseSlashes(path); int len = path.length(); //compute the flags bitmap if (len < 2) { if (len == 1 && path.charAt(0) == SEPARATOR) { this.flags = HAS_LEADING; } else { this.flags = 0; } } else { boolean hasLeading = path.charAt(0) == SEPARATOR; boolean isUNC = hasLeading && path.charAt(1) == SEPARATOR; //UNC path of length two has no trailing separator boolean hasTrailing = !(isUNC && len == 2) && path.charAt(len - 1) == SEPARATOR; flags = hasLeading ? HAS_LEADING : 0; if (isUNC) flags |= IS_UNC; if (hasTrailing) flags |= HAS_TRAILING; } if (forWindows) { flags |= IS_FOR_WINDOWS; } //compute segments and ensure canonical form segments = computeSegments(path); if (!canonicalize()) { //compute hash now because canonicalize didn't need to do it flags = (flags & ALL_FLAGS) | (computeHashCode() << 4); } return this; } /* (Intentionally not included in javadoc) * @see IPath#isAbsolute */ @Override public boolean isAbsolute() { //it's absolute if it has a leading separator return (flags & HAS_LEADING) != 0; } /* (Intentionally not included in javadoc) * @see IPath#isEmpty */ @Override public boolean isEmpty() { //true if no segments and no leading prefix return segments.length == 0 && ((flags & ALL_SEPARATORS) != HAS_LEADING); } /* (Intentionally not included in javadoc) * @see IPath#isPrefixOf */ @Override public boolean isPrefixOf(IPath anotherPath) { if (device == null) { if (anotherPath.getDevice() != null) { return false; } } else { if (!device.equalsIgnoreCase(anotherPath.getDevice())) { return false; } } if (isEmpty() || (isRoot() && anotherPath.isAbsolute())) { return true; } int len = segments.length; if (len > anotherPath.segmentCount()) { return false; } for (int i = 0; i < len; i++) { if (!segments[i].equals(anotherPath.segment(i))) return false; } return true; } /* (Intentionally not included in javadoc) * @see IPath#isRoot */ @Override public boolean isRoot() { //must have no segments, a leading separator, and not be a UNC path. return this == ROOT || (segments.length == 0 && ((flags & ALL_SEPARATORS) == HAS_LEADING)); } /* (Intentionally not included in javadoc) * @see IPath#isUNC */ @Override public boolean isUNC() { if (device != null) return false; return (flags & IS_UNC) != 0; } /* (Intentionally not included in javadoc) * @see IPath#isValidPath(String) */ @Override public boolean isValidPath(String path) { return isValidPath(path, (flags & IS_FOR_WINDOWS) != 0); } /** * Returns whether the given string is syntactically correct as a path on a * POSIX file system. The path is correct if each of the segments in its * canonicalized form is valid. * * @param path the path to check * @return true if the given string is a valid path, * and false otherwise * @see #isValidPosixSegment(String) * @since 3.7 */ public static boolean isValidPosixPath(String path) { return isValidPath(path, false); } /** * Returns whether the given string is syntactically correct as a path on * the Windows file system. The device id is the prefix up to and including * the device separator (':'); the path proper is everything to the right of * it, or the entire string if there is no device separator. The device id * is not checked for validity; the path proper is correct if each of the * segments in its canonicalized form is valid. * * @param path the path to check * @return true if the given string is a valid path, * and false otherwise * @see #isValidWindowsSegment(String) * @since 3.7 */ public static boolean isValidWindowsPath(String path) { return isValidPath(path, true); } /** * Returns whether the given string is syntactically correct as a path on * the specified file system. The device id is the prefix up to and * including the device separator for the specified file system; the path * proper is everything to the right of it, or the entire string if there is * no device separator. When the specified platform is a file system with no * meaningful device separator, the entire string is treated as the path * proper. The device id is not checked for validity; the path proper is * correct if each of the segments in its canonicalized form is valid. * * @param path the path to check * @param forWindows true if the path is for the Windows file system * @return true if the given string is a valid path, * and false otherwise * @see #isValidSegment(String, boolean) * @since 3.7 */ private static boolean isValidPath(String path, boolean forWindows) { RemotePath test = new RemotePath(path, forWindows); for (int i = 0, max = test.segmentCount(); i < max; i++) if (!RemotePath.isValidSegment(test.segment(i), forWindows)) return false; return true; } /* (Intentionally not included in javadoc) * @see IPath#isValidSegment(String) */ @Override public boolean isValidSegment(String segment) { return isValidSegment(segment, (flags & IS_FOR_WINDOWS) != 0); } /** * Returns whether the given string is valid as a segment in a path on a * POSIX file system. The rules for valid segments are as follows: *
    *
  • the empty string is not valid *
  • any string containing the slash character ('/') is not valid *
* * @param segment the path segment to check * @return true if the given path segment is valid, * and false otherwise * @since 3.7 */ public static boolean isValidPosixSegment(String segment) { return isValidSegment(segment, false); } /** * Returns whether the given string is valid as a segment in a path on the * Windows file system. The rules for valid segments are as follows: *
    *
  • the empty string is not valid *
  • any string containing the slash character ('/') is not valid *
  • any string containing segment ('\') or device (':') separator * characters is not valid *
* * @param segment the path segment to check * @return true if the given path segment is valid, * and false otherwise * @since 3.7 */ public static boolean isValidWindowsSegment(String segment) { return isValidSegment(segment, true); } /** * Returns whether the given string is valid as a segment in a path on the * specified file system. The rules for valid segments are as follows: *
    *
  • the empty string is not valid *
  • any string containing the slash character ('/') is not valid *
  • any string containing segment or device separator characters on the * specified file system, such as the backslash ('\') and colon (':') on * Windows, is not valid *
* * @param segment the path segment to check * @param forWindows true if the path is for the Windows file system * @return true if the given path segment is valid, * and false otherwise * @since 3.7 */ private static boolean isValidSegment(String segment, boolean forWindows) { int size = segment.length(); if (size == 0) return false; for (int i = 0; i < size; i++) { char c = segment.charAt(i); if (c == '/') return false; if (forWindows && (c == '\\' || c == ':')) return false; } return true; } /* (Intentionally not included in javadoc) * @see IPath#lastSegment() */ @Override public String lastSegment() { int len = segments.length; return len == 0 ? null : segments[len - 1]; } /* (Intentionally not included in javadoc) * @see IPath#makeAbsolute() */ @Override public IPath makeAbsolute() { if (isAbsolute()) { return this; } RemotePath result = new RemotePath(device, segments, flags | HAS_LEADING); //may need canonicalizing if it has leading ".." or "." segments if (result.segmentCount() > 0) { String first = result.segment(0); if (first.equals("..") || first.equals(".")) { //$NON-NLS-1$ //$NON-NLS-2$ result.canonicalize(); } } return result; } /* (Intentionally not included in javadoc) * @see IPath#makeRelative() */ @Override public IPath makeRelative() { if (!isAbsolute()) { return this; } return new RemotePath(device, segments, flags & (HAS_TRAILING | IS_FOR_WINDOWS)); } /** * {@inheritDoc} * @since org.eclipse.equinox.common 3.5 */ @Override public IPath makeRelativeTo(IPath base) { //can't make relative if devices are not equal if (device != base.getDevice() && (device == null || !device.equalsIgnoreCase(base.getDevice()))) return this; int commonLength = matchingFirstSegments(base); final int differenceLength = base.segmentCount() - commonLength; final int newSegmentLength = differenceLength + segmentCount() - commonLength; if (newSegmentLength == 0) return RemotePath.EMPTY; String[] newSegments = new String[newSegmentLength]; //add parent references for each segment different from the base Arrays.fill(newSegments, 0, differenceLength, ".."); //$NON-NLS-1$ //append the segments of this path not in common with the base System.arraycopy(segments, commonLength, newSegments, differenceLength, newSegmentLength - differenceLength); return new RemotePath(null, newSegments, flags & (HAS_TRAILING | IS_FOR_WINDOWS)); } /* (Intentionally not included in javadoc) * @see IPath#makeUNC(boolean) */ @Override public IPath makeUNC(boolean toUNC) { // if we are already in the right form then just return if (!(toUNC ^ isUNC())) return this; int newSeparators = this.flags; if (toUNC) { newSeparators |= HAS_LEADING | IS_UNC; } else { //mask out the UNC bit newSeparators &= HAS_LEADING | HAS_TRAILING | IS_FOR_WINDOWS; } return new RemotePath(toUNC ? null : device, segments, newSeparators); } /* (Intentionally not included in javadoc) * @see IPath#matchingFirstSegments(IPath) */ @Override public int matchingFirstSegments(IPath anotherPath) { Assert.isNotNull(anotherPath); int anotherPathLen = anotherPath.segmentCount(); int max = Math.min(segments.length, anotherPathLen); int count = 0; for (int i = 0; i < max; i++) { if (!segments[i].equals(anotherPath.segment(i))) { return count; } count++; } return count; } /* (Intentionally not included in javadoc) * @see IPath#removeFileExtension() */ @Override public IPath removeFileExtension() { String extension = getFileExtension(); if (extension == null || extension.equals("")) { //$NON-NLS-1$ return this; } String lastSegment = lastSegment(); int index = lastSegment.lastIndexOf(extension) - 1; return removeLastSegments(1).append(lastSegment.substring(0, index)); } /* (Intentionally not included in javadoc) * @see IPath#removeFirstSegments(int) */ @Override public IPath removeFirstSegments(int count) { if (count == 0) return this; if (count >= segments.length) { return new RemotePath(device, NO_SEGMENTS, flags & IS_FOR_WINDOWS); } Assert.isLegal(count > 0); int newSize = segments.length - count; String[] newSegments = new String[newSize]; System.arraycopy(this.segments, count, newSegments, 0, newSize); //result is always a relative path return new RemotePath(device, newSegments, flags & (HAS_TRAILING | IS_FOR_WINDOWS)); } /* (Intentionally not included in javadoc) * @see IPath#removeLastSegments(int) */ @Override public IPath removeLastSegments(int count) { if (count == 0) return this; if (count >= segments.length) { //result will have no trailing separator return new RemotePath(device, NO_SEGMENTS, flags & (HAS_LEADING | IS_UNC | IS_FOR_WINDOWS)); } Assert.isLegal(count > 0); int newSize = segments.length - count; String[] newSegments = new String[newSize]; System.arraycopy(this.segments, 0, newSegments, 0, newSize); return new RemotePath(device, newSegments, flags); } /* (Intentionally not included in javadoc) * @see IPath#removeTrailingSeparator() */ @Override public IPath removeTrailingSeparator() { if (!hasTrailingSeparator()) { return this; } return new RemotePath(device, segments, flags & (HAS_LEADING | IS_UNC | IS_FOR_WINDOWS)); } /* (Intentionally not included in javadoc) * @see IPath#segment(int) */ @Override public String segment(int index) { if (index >= segments.length) return null; return segments[index]; } /* (Intentionally not included in javadoc) * @see IPath#segmentCount() */ @Override public int segmentCount() { return segments.length; } /* (Intentionally not included in javadoc) * @see IPath#segments() */ @Override public String[] segments() { String[] segmentCopy = new String[segments.length]; System.arraycopy(segments, 0, segmentCopy, 0, segments.length); return segmentCopy; } /* (Intentionally not included in javadoc) * @see IPath#setDevice(String) */ @Override public IPath setDevice(String value) { if (value != null) { Assert.isTrue(value.indexOf(IPath.DEVICE_SEPARATOR) == (value.length() - 1), "Last character should be the device separator"); //$NON-NLS-1$ } //return the receiver if the device is the same if (value == device || (value != null && value.equals(device))) return this; return new RemotePath(value, segments, flags); } /* (Intentionally not included in javadoc) * @see IPath#toFile() */ @Override public File toFile() { return new File(toOSString()); } /* (Intentionally not included in javadoc) * @see IPath#toOSString() */ @Override public String toOSString() { //Note that this method is identical to toString except //it uses the OS file separator instead of the path separator int resultSize = computeLength(); if (resultSize <= 0) return EMPTY_STRING; char FILE_SEPARATOR = File.separatorChar; char[] result = new char[resultSize]; int offset = 0; if (device != null) { int size = device.length(); device.getChars(0, size, result, offset); offset += size; } if ((flags & HAS_LEADING) != 0) result[offset++] = FILE_SEPARATOR; if ((flags & IS_UNC) != 0) result[offset++] = FILE_SEPARATOR; int len = segments.length - 1; if (len >= 0) { //append all but the last segment, with file separators for (int i = 0; i < len; i++) { int size = segments[i].length(); segments[i].getChars(0, size, result, offset); offset += size; result[offset++] = FILE_SEPARATOR; } //append the last segment int size = segments[len].length(); segments[len].getChars(0, size, result, offset); offset += size; } if ((flags & HAS_TRAILING) != 0) result[offset++] = FILE_SEPARATOR; return new String(result); } /* (Intentionally not included in javadoc) * @see IPath#toPortableString() */ @Override public String toPortableString() { int resultSize = computeLength(); if (resultSize <= 0) return EMPTY_STRING; StringBuffer result = new StringBuffer(resultSize); if (device != null) result.append(device); if ((flags & HAS_LEADING) != 0) result.append(SEPARATOR); if ((flags & IS_UNC) != 0) result.append(SEPARATOR); int len = segments.length; //append all segments with separators for (int i = 0; i < len; i++) { if (segments[i].indexOf(DEVICE_SEPARATOR) >= 0) encodeSegment(segments[i], result); else result.append(segments[i]); if (i < len - 1 || (flags & HAS_TRAILING) != 0) result.append(SEPARATOR); } return result.toString(); } /* (Intentionally not included in javadoc) * @see IPath#toString() */ @Override public String toString() { int resultSize = computeLength(); if (resultSize <= 0) return EMPTY_STRING; char[] result = new char[resultSize]; int offset = 0; if (device != null) { int size = device.length(); device.getChars(0, size, result, offset); offset += size; } if ((flags & HAS_LEADING) != 0) result[offset++] = SEPARATOR; if ((flags & IS_UNC) != 0) result[offset++] = SEPARATOR; int len = segments.length - 1; if (len >= 0) { //append all but the last segment, with separators for (int i = 0; i < len; i++) { int size = segments[i].length(); segments[i].getChars(0, size, result, offset); offset += size; result[offset++] = SEPARATOR; } //append the last segment int size = segments[len].length(); segments[len].getChars(0, size, result, offset); offset += size; } if ((flags & HAS_TRAILING) != 0) result[offset++] = SEPARATOR; return new String(result); } /* (Intentionally not included in javadoc) * @see IPath#uptoSegment(int) */ @Override public IPath uptoSegment(int count) { if (count == 0) return new RemotePath(device, NO_SEGMENTS, flags & (HAS_LEADING | IS_UNC | IS_FOR_WINDOWS)); if (count >= segments.length) return this; Assert.isTrue(count > 0, "Invalid parameter to RemotePath.uptoSegment"); //$NON-NLS-1$ String[] newSegments = new String[count]; System.arraycopy(segments, 0, newSegments, 0, count); return new RemotePath(device, newSegments, flags); } } RemoteProcess.java000066400000000000000000000110101272114001700361740ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core; import java.io.InputStream; import java.io.OutputStream; import java.util.HashMap; import java.util.Map; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteProcess; import org.eclipse.remote.core.IRemoteProcessBuilder; import org.eclipse.remote.core.IRemoteProcessControlService; /** * Standard root class for remote processes. */ public class RemoteProcess extends Process implements IRemoteProcess { private final Map, Service> servicesMap = new HashMap<>(); private final IRemoteConnection connection; private final IRemoteProcessBuilder builder; /** * @since 2.0 */ public RemoteProcess(IRemoteConnection connection, IRemoteProcessBuilder builder) { this.connection = connection; this.builder = builder; } /* * (non-Javadoc) * * @see java.lang.Process#destroy() */ @Override public void destroy() { IRemoteProcessControlService controlService = getService(IRemoteProcessControlService.class); if (controlService != null) { controlService.destroy(); } } /* * (non-Javadoc) * * @see java.lang.Process#exitValue() */ @Override public int exitValue() { IRemoteProcessControlService controlService = getService(IRemoteProcessControlService.class); if (controlService != null) { return controlService.exitValue(); } return 0; } /* * (non-Javadoc) * * @see java.lang.Process#getErrorStream() */ @Override public InputStream getErrorStream() { IRemoteProcessControlService controlService = getService(IRemoteProcessControlService.class); if (controlService != null) { return controlService.getErrorStream(); } return null; } /* * (non-Javadoc) * * @see java.lang.Process#getInputStream() */ @Override public InputStream getInputStream() { IRemoteProcessControlService controlService = getService(IRemoteProcessControlService.class); if (controlService != null) { return controlService.getInputStream(); } return null; } /* * (non-Javadoc) * * @see java.lang.Process#getOutputStream() */ @Override public OutputStream getOutputStream() { IRemoteProcessControlService controlService = getService(IRemoteProcessControlService.class); if (controlService != null) { return controlService.getOutputStream(); } return null; } /** * @since 2.0 */ @SuppressWarnings("unchecked") @Override public T getService(Class service) { T obj = (T) servicesMap.get(service); if (obj == null) { obj = getConnectionType().getProcessService(this, service); if (obj != null) { servicesMap.put(service, obj); } } return obj; } /** * @since 2.0 */ @Override public boolean hasService(Class service) { return servicesMap.get(service.getName()) != null || getConnectionType().hasProcessService(service); } /* * (non-Javadoc) * * @see java.lang.Process#waitFor() */ @Override public int waitFor() throws InterruptedException { IRemoteProcessControlService controlService = getService(IRemoteProcessControlService.class); if (controlService != null) { return controlService.waitFor(); } return 0; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcess#isCompleted() */ @Override public boolean isCompleted() { IRemoteProcessControlService controlService = getService(IRemoteProcessControlService.class); if (controlService != null) { return controlService.isCompleted(); } return true; } /** * @since 2.0 */ /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcess#getRemoteConnection() */ @Override public IRemoteConnection getRemoteConnection() { return connection; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcess#getProcessBuilder() */ @Override public IRemoteProcessBuilder getProcessBuilder() { return builder; } private RemoteConnectionType getConnectionType() { return (RemoteConnectionType) getRemoteConnection().getConnectionType(); } } RemoteResourceAdapterFactory.java000066400000000000000000000056461272114001700412200ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/******************************************************************************* * Copyright (c) 2011 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core; import java.util.HashMap; import java.util.Map; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdapterFactory; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtension; import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.Platform; import org.eclipse.remote.core.IRemoteResource; import org.eclipse.remote.internal.core.services.local.LocalResource; public class RemoteResourceAdapterFactory implements IAdapterFactory { public static final String EXTENSION_POINT_ID = "remoteResources"; //$NON-NLS-1$ public static final String ATTR_NATURE = "nature"; //$NON-NLS-1$ public static final String ATTR_CLASS = "class"; //$NON-NLS-1$ private Map fResourceFactory; @SuppressWarnings("rawtypes") public Object getAdapter(Object adaptableObject, Class adapterType) { if (adapterType == IRemoteResource.class) { if (adaptableObject instanceof IResource) { loadExtensions(); IResource resource = (IResource) adaptableObject; for (String nature : fResourceFactory.keySet()) { try { if (resource.getProject().hasNature(nature)) { RemoteResourceFactory factory = fResourceFactory.get(nature); if (factory != null) { return factory.getRemoteResource(resource); } } } catch (CoreException e) { // Treat as failure } } return new LocalResource(resource); } } return null; } @SuppressWarnings("rawtypes") public Class[] getAdapterList() { return new Class[] { IRemoteResource.class }; } private synchronized void loadExtensions() { if (fResourceFactory == null) { fResourceFactory = new HashMap(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint extensionPoint = registry.getExtensionPoint(RemoteCorePlugin.getUniqueIdentifier(), EXTENSION_POINT_ID); for (IExtension ext : extensionPoint.getExtensions()) { final IConfigurationElement[] elements = ext.getConfigurationElements(); for (IConfigurationElement ce : elements) { String nature = ce.getAttribute(ATTR_NATURE); RemoteResourceFactory factory = new RemoteResourceFactory(ce); fResourceFactory.put(nature, factory); } } } } } RemoteResourceFactory.java000066400000000000000000000026611272114001700377110ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/******************************************************************************* * Copyright (c) 2011 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.remote.core.IRemoteResource; /** * Factory to create an IRemoteResource * * @author greg * */ public class RemoteResourceFactory { private final IConfigurationElement fConfigElement; public RemoteResourceFactory(IConfigurationElement ce) { fConfigElement = ce; } /** * Get the remote resource associated with the platform resource. * * @return IRemoteResource */ public IRemoteResource getRemoteResource(IResource resource) { try { IRemoteResource remoteRes = (IRemoteResource) fConfigElement .createExecutableExtension(RemoteResourceAdapterFactory.ATTR_CLASS); remoteRes.setResource(resource); return remoteRes; } catch (CoreException e) { RemoteCorePlugin.log(e); return null; } } }RemoteServicesManager.java000066400000000000000000000211461272114001700376470ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core; import java.net.URI; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtension; import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.equinox.security.storage.ISecurePreferences; import org.eclipse.equinox.security.storage.SecurePreferencesFactory; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionChangeListener; import org.eclipse.remote.core.IRemoteConnectionProviderService; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.core.RemoteConnectionChangeEvent; import org.osgi.service.prefs.Preferences; /** * The implementation for the remote services manager service. * */ public class RemoteServicesManager implements IRemoteServicesManager { private static final String LOCAL_SERVICES_ID = "org.eclipse.remote.LocalServices"; //$NON-NLS-1$ // Map from id to remote services private final Map connectionTypeMap = new HashMap<>(); // Map from URI scheme to remote services private final Map schemeMap = new HashMap<>(); private final List listeners = new LinkedList<>(); private boolean inited; /** * Loads up the services extensions and then loads up the persisted connections. * This stuff can't be done from the constructor for the manager since that's done * in the bundle activator which is way too early. It also gives us the ability * to override the initialization in tests */ protected void init() { if (inited) { return; } inited = true; IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint point = registry.getExtensionPoint(RemoteCorePlugin.getUniqueIdentifier(), "remoteServices"); //$NON-NLS-1$ // Load up the connection types for (IExtension ext : point.getExtensions()) { for (IConfigurationElement ce : ext.getConfigurationElements()) { if (ce.getName().equals("connectionType")) { //$NON-NLS-1$ RemoteConnectionType services = new RemoteConnectionType(ce, this); connectionTypeMap.put(services.getId(), services); String scheme = services.getScheme(); if (scheme != null) { schemeMap.put(scheme, services); } } } } // Load up the services for (IExtension ext : point.getExtensions()) { for (IConfigurationElement ce : ext.getConfigurationElements()) { String name = ce.getName(); if (name.equals("connectionTypeService") || name.equals("connectionService") || name.equals("processService")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ String id = ce.getAttribute("connectionTypeId"); //$NON-NLS-1$ RemoteConnectionType services = connectionTypeMap.get(id); if (services != null) { services.addService(ce); } } } } // Init connection providers for (IRemoteConnectionType connectionType : connectionTypeMap.values()) { IRemoteConnectionProviderService providerService = connectionType.getService(IRemoteConnectionProviderService.class); if (providerService != null) { providerService.init(); } } } public Preferences getPreferenceNode() { return InstanceScope.INSTANCE.getNode(RemoteCorePlugin.getUniqueIdentifier()).node("connections"); //$NON-NLS-1$ } public ISecurePreferences getSecurePreferenceNode() { return SecurePreferencesFactory.getDefault().node(RemoteCorePlugin.getUniqueIdentifier()).node("connections"); //$NON-NLS-1$ } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteServicesManager#getConnectionType(java.lang.String) */ @Override public IRemoteConnectionType getConnectionType(String id) { init(); return connectionTypeMap.get(id); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteServicesManager#getConnectionType(java.net.URI) */ @Override public IRemoteConnectionType getConnectionType(URI uri) { init(); return schemeMap.get(uri.getScheme()); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteServicesManager#getLocalConnectionType() */ @Override public IRemoteConnectionType getLocalConnectionType() { return getConnectionType(LOCAL_SERVICES_ID); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteServicesManager#getAllConnectionTypes() */ @Override public List getAllConnectionTypes() { init(); return new ArrayList(connectionTypeMap.values()); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteServicesManager#getConnectionTypesSupporting(java.lang.Class[]) */ @Override @SafeVarargs public final List getConnectionTypesSupporting(Class... services) { List connTypes = new ArrayList(); for (IRemoteConnectionType connType : getAllConnectionTypes()) { for (Class service : services) { if (connType.hasConnectionService(service)) { connTypes.add(connType); break; } } } return connTypes; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteServicesManager#getConnectionTypesByService(java.lang.Class[]) */ @Override @SafeVarargs public final List getConnectionTypesByService(Class... services) { List connTypes = new ArrayList(); for (IRemoteConnectionType connType : getAllConnectionTypes()) { for (Class service : services) { if (!connType.hasService(service)) { connTypes.add(connType); break; } } } return connTypes; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteServicesManager#getRemoteConnectionTypes() */ @Override public List getRemoteConnectionTypes() { init(); List connTypes = new ArrayList<>(connectionTypeMap.values().size() - 1); IRemoteConnectionType localServices = getLocalConnectionType(); for (IRemoteConnectionType s : connectionTypeMap.values()) { if (!s.equals(localServices)) { connTypes.add(s); } } return connTypes; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteServicesManager#getAllRemoteConnections() */ @Override public List getAllRemoteConnections() { List connections = new ArrayList<>(); for (IRemoteConnectionType connType : getAllConnectionTypes()) { connections.addAll(connType.getConnections()); } return connections; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteServicesManager#addRemoteConnectionChangeListener(org.eclipse.remote.core. * IRemoteConnectionChangeListener) */ @Override public void addRemoteConnectionChangeListener(IRemoteConnectionChangeListener listener) { synchronized (listeners) { listeners.add(listener); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteServicesManager#removeRemoteConnectionChangeListener(org.eclipse.remote.core. * IRemoteConnectionChangeListener) */ @Override public void removeRemoteConnectionChangeListener(IRemoteConnectionChangeListener listener) { synchronized (listeners) { listeners.remove(listener); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteServicesManager#fireRemoteConnectionChangeEvent(org.eclipse.remote.core. * RemoteConnectionChangeEvent) */ @Override public void fireRemoteConnectionChangeEvent(RemoteConnectionChangeEvent event) { List iListeners; synchronized (listeners) { iListeners = new ArrayList<>(listeners); } for (IRemoteConnectionChangeListener listener : iListeners) { listener.connectionChanged(event); } } } launch/000077500000000000000000000000001272114001700340205ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/coreRemoteLaunchConfigService.java000066400000000000000000000046021272114001700417220ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/launchpackage org.eclipse.remote.internal.core.launch; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.core.launch.IRemoteLaunchConfigService; import org.eclipse.remote.internal.core.RemoteCorePlugin; import org.osgi.service.prefs.Preferences; public class RemoteLaunchConfigService implements IRemoteLaunchConfigService { private static final String REMOTE_LAUNCH_CONFIG = "remoteLaunchConfig"; //$NON-NLS-1$ private static final String REMOTE_LAUNCH_TYPE = "remoteLaunchType"; //$NON-NLS-1$ private Preferences getPreferences(String node) { return InstanceScope.INSTANCE.getNode(RemoteCorePlugin.getUniqueIdentifier()).node(node); } private IRemoteConnection getRemoteConnection(String remoteId) { if (remoteId == null) { return null; } String[] ids = remoteId.split(":"); //$NON-NLS-1$ if (ids.length < 2) { return null; } IRemoteServicesManager manager = RemoteCorePlugin.getService(IRemoteServicesManager.class); IRemoteConnectionType connectionType = manager.getConnectionType(ids[0]); if (connectionType == null) { return null; } return connectionType.getConnection(ids[1]); } @Override public void setActiveConnection(ILaunchConfiguration launchConfig, IRemoteConnection connection) { String remoteId = connection.getConnectionType().getId() + ":" + connection.getName(); //$NON-NLS-1$ getPreferences(REMOTE_LAUNCH_CONFIG).put(launchConfig.getName(), remoteId); try { getPreferences(REMOTE_LAUNCH_TYPE).put(launchConfig.getType().getIdentifier(), remoteId); } catch (CoreException e) { RemoteCorePlugin.log(e.getStatus()); } } @Override public IRemoteConnection getActiveConnection(ILaunchConfiguration launchConfig) { String remoteId = getPreferences(REMOTE_LAUNCH_CONFIG).get(launchConfig.getName(), null); return getRemoteConnection(remoteId); } @Override public IRemoteConnection getLastActiveConnection(ILaunchConfigurationType launchConfigType) { String remoteId = getPreferences(REMOTE_LAUNCH_TYPE).get(launchConfigType.getIdentifier(), null); return getRemoteConnection(remoteId); } } messages/000077500000000000000000000000001272114001700343555ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/coreMessages.java000066400000000000000000000011251272114001700367660ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/messagespackage org.eclipse.remote.internal.core.messages; import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.remote.internal.core.messages.messages"; //$NON-NLS-1$ public static String LocalConnection_1; public static String LocalConnection_2; public static String RemoteServicesProxy_0; public static String RemoteServicesProxy_1; public static String Unable_to_create_new_local_connections; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); } private Messages() { } } messages.properties000066400000000000000000000004331272114001700403020ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/messagesLocalConnection_1=localhost LocalConnection_2=Port forwarding not supported Unable_to_create_new_local_connections=Unable to create new local connections RemoteServicesProxy_0=Missing {0} attribute RemoteServicesProxy_1=Failed to instantiate factory: {0} in type: {1} in plugin: {2} preferences/000077500000000000000000000000001272114001700350475ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/corePreferenceInitializer.java000066400000000000000000000020721272114001700421750ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/preferences/******************************************************************************* * Copyright (c) 2012 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core.preferences; import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; import org.eclipse.remote.core.IRemotePreferenceConstants; /** * Class used to initialize default preference values. * * @since 6.0 */ public class PreferenceInitializer extends AbstractPreferenceInitializer { @Override public void initializeDefaultPreferences() { Preferences.setDefaultString(IRemotePreferenceConstants.PREF_CONNECTION_TYPE_ID, "org.eclipse.remote.JSch"); //$NON-NLS-1$ } } Preferences.java000066400000000000000000000367011272114001700401620ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/preferences/******************************************************************************* * Copyright (c) 2011 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core.preferences; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.preferences.DefaultScope; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener; import org.eclipse.core.runtime.preferences.IScopeContext; import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.remote.internal.core.RemoteCorePlugin; import org.osgi.service.prefs.BackingStoreException; /** * Convenience class to facilitate using the new {@link IEclipsePreferences} story. Adapted from * org.eclipse.debug.internal.core.Preferences. * * @since 5.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public final class Preferences { private static final IScopeContext[] contexts = new IScopeContext[] { DefaultScope.INSTANCE, InstanceScope.INSTANCE }; private static final int DEFAULT_CONTEXT = 0; private static final int INSTANCE_CONTEXT = 1; private static final String fQualifier = RemoteCorePlugin.getUniqueIdentifier(); /** * Adds the given preference listener to the {@link DefaultScope} and the {@link InstanceScope} * * @param listener */ public static void addPreferenceChangeListener(IPreferenceChangeListener listener) { contexts[DEFAULT_CONTEXT].getNode(fQualifier).addPreferenceChangeListener(listener); contexts[INSTANCE_CONTEXT].getNode(fQualifier).addPreferenceChangeListener(listener); } /** * Returns whether the named preference is know in the preference store. * * @param name * @return */ public static boolean contains(String name) { return (contexts[INSTANCE_CONTEXT].getNode(fQualifier).get(name, null) != null || contexts[DEFAULT_CONTEXT].getNode( fQualifier).get(name, null) != null); } /** * Returns the value in the preference store for the given key. If the key * is not defined then return the default value. Use the canonical scope * lookup order for finding the preference value. * * @param key * @param defaultvalue * * @return the value of the preference or the given default value */ public static boolean getBoolean(String key) { return Platform.getPreferencesService().getBoolean(fQualifier, key, false, null); } /** * Returns the value in the preference store for the given key. If the key * is not defined then return the default value. Use the canonical scope * lookup order for finding the preference value. * * @param key * @param defaultvalue * * @return the value of the preference or the given default value */ public static byte[] getByteArray(String key) { return Platform.getPreferencesService().getByteArray(fQualifier, key, null, null); } /** * Returns the default boolean value stored in the {@link DefaultScope} for * the given key or the specified default value if the key does not appear * in the {@link DefaultScope} * * @param key * @param defaultvalue * * @return the boolean value set in the {@link DefaultScope} for the given * key, or the specified default value. */ public static synchronized boolean getDefaultBoolean(String key, boolean defaultvalue) { return contexts[DEFAULT_CONTEXT].getNode(fQualifier).getBoolean(key, defaultvalue); } /** * Returns the default byte array value stored in the {@link DefaultScope} for the given key or the specified default value if * the key does not * appear in the {@link DefaultScope} * * @param key * @param defaultvalue * * @return the byte array value set in the {@link DefaultScope} for the * given key, or the specified default value. */ public static synchronized byte[] getDefaultByteArray(String key, byte[] defaultvalue) { return contexts[DEFAULT_CONTEXT].getNode(fQualifier).getByteArray(key, defaultvalue); } /** * Returns the default double value stored in the {@link DefaultScope} for * the given key or the specified default value if the key does not appear * in the {@link DefaultScope} * * @param key * @param defaultvalue * * @return the double value set in the {@link DefaultScope} for the given * key, or the specified default value. */ public static synchronized double getDefaultDouble(String key, double defaultvalue) { return contexts[DEFAULT_CONTEXT].getNode(fQualifier).getDouble(key, defaultvalue); } /** * Returns the default float value stored in the {@link DefaultScope} for * the given key or the specified default value if the key does not appear * in the {@link DefaultScope} * * @param key * @param defaultvalue * * @return the float value set in the {@link DefaultScope} for the given * key, or the specified default value. */ public static synchronized float getDefaultFloat(String key, float defaultvalue) { return contexts[DEFAULT_CONTEXT].getNode(fQualifier).getFloat(key, defaultvalue); } /** * Returns the default integer value stored in the {@link DefaultScope} for * the given key or the specified default value if the key does not appear * in the {@link DefaultScope} * * @param key * @param defaultvalue * * @return the integer value set in the {@link DefaultScope} for the given * key, or the specified default value. */ public static synchronized int getDefaultInt(String key, int defaultvalue) { return contexts[DEFAULT_CONTEXT].getNode(fQualifier).getInt(key, defaultvalue); } /** * Returns the default long value stored in the {@link DefaultScope} for the * given key or the specified default value if the key does not appear in * the {@link DefaultScope} * * @param key * @param defaultvalue * * @return the long value set in the {@link DefaultScope} for the given key, * or the specified default value. */ public static synchronized long getDefaultLong(String key, long defaultvalue) { return contexts[DEFAULT_CONTEXT].getNode(fQualifier).getLong(key, defaultvalue); } /** * Returns the default string value stored in the {@link DefaultScope} for * the given key or the specified default value if the key does not appear * in the {@link DefaultScope} * * @param key * @param defaultvalue * * @return the string value set in the {@link DefaultScope} for the given * key, or the specified default value. */ public static synchronized String getDefaultString(String key, String defaultvalue) { return contexts[DEFAULT_CONTEXT].getNode(fQualifier).get(key, defaultvalue); } /** * Returns the value in the preference store for the given key. If the key * is not defined then return the default value. Use the canonical scope * lookup order for finding the preference value. * * @param key * @param defaultvalue * * @return the value of the preference or the given default value */ public static double getDouble(String key) { return Platform.getPreferencesService().getDouble(fQualifier, key, 0.0, null); } /** * Returns the value in the preference store for the given key. If the key * is not defined then return the default value. Use the canonical scope * lookup order for finding the preference value. * * @param fQualifier * @param key * @param defaultvalue * * @return the value of the preference or the given default value */ public static float getFloat(String key) { return Platform.getPreferencesService().getFloat(fQualifier, key, 0.0f, null); } /** * Returns the value in the preference store for the given key. If the key * is not defined then return the default value. Use the canonical scope * lookup order for finding the preference value. * * @param fQualifier * @param key * @param defaultvalue * * @return the value of the preference or the given default value */ public static int getInt(String key) { return Platform.getPreferencesService().getInt(fQualifier, key, 0, null); } /** * Returns the value in the preference store for the given key. If the key * is not defined then return the default value. Use the canonical scope * lookup order for finding the preference value. * * @param key * @param defaultvalue * * @return the value of the preference or the given default value */ public static long getLong(String key) { return Platform.getPreferencesService().getLong(fQualifier, key, 0L, null); } /** * Returns the value in the preference store for the given key. If the key * is not defined then return the default value. Use the canonical scope * lookup order for finding the preference value. * * @param key * @param defaultvalue * * @return the value of the preference or the given default value */ public static String getString(String key) { return Platform.getPreferencesService().getString(fQualifier, key, null, null); } /** * Returns true if the named preference has the default value. * * @param name * @return */ public static boolean isDefault(String name) { String defVal = contexts[DEFAULT_CONTEXT].getNode(fQualifier).get(name, null); if (defVal != null) { String val = contexts[INSTANCE_CONTEXT].getNode(fQualifier).get(name, null); return (val != null && val.equals(defVal)); } return false; } /** * Removes the given preference listener from the {@link DefaultScope} and * the {@link InstanceScope} * * @param listener */ public static void removePreferenceChangeListener(IPreferenceChangeListener listener) { contexts[DEFAULT_CONTEXT].getNode(fQualifier).removePreferenceChangeListener(listener); contexts[INSTANCE_CONTEXT].getNode(fQualifier).removePreferenceChangeListener(listener); } /** * Save the preferences for the given plugin identifier. It should be noted * that all pending preference changes will be flushed with this method. */ public static synchronized void savePreferences() { try { contexts[DEFAULT_CONTEXT].getNode(fQualifier).flush(); contexts[INSTANCE_CONTEXT].getNode(fQualifier).flush(); } catch (BackingStoreException bse) { RemoteCorePlugin.log(bse); } } /** * Sets a boolean preference in the {@link InstanceScope}. * * @param key * the key * @param value * the value */ public static synchronized void setBoolean(String key, boolean value) { contexts[INSTANCE_CONTEXT].getNode(fQualifier).putBoolean(key, value); } /** * Sets a byte array preference in the {@link InstanceScope}. * * @param key * the key * @param value * the value */ public static synchronized void setByteArray(String key, byte[] value) { contexts[INSTANCE_CONTEXT].getNode(fQualifier).putByteArray(key, value); } /** * Sets a boolean in the {@link DefaultScope} * * @param key * the key * @param value * the new value */ public static synchronized void setDefaultBoolean(String key, boolean value) { contexts[DEFAULT_CONTEXT].getNode(fQualifier).putBoolean(key, value); } /** * Sets a byte array in the {@link DefaultScope} * * @param key * the key * @param value * the new value */ public static synchronized void setDefaultByteArray(String key, byte[] value) { contexts[DEFAULT_CONTEXT].getNode(fQualifier).putByteArray(key, value); } /** * Sets a double in the {@link DefaultScope} * * @param key * the key * @param value * the new value */ public static synchronized void setDefaultDouble(String key, double value) { contexts[DEFAULT_CONTEXT].getNode(fQualifier).putDouble(key, value); } /** * Sets a float in the {@link DefaultScope} * * @param key * the key * @param value * the new value */ public static synchronized void setDefaultFloat(String key, float value) { contexts[DEFAULT_CONTEXT].getNode(fQualifier).putFloat(key, value); } /** * Sets a integer in the {@link DefaultScope} * * @param key * the key * @param value * the new value */ public static synchronized void setDefaultInt(String key, int value) { contexts[DEFAULT_CONTEXT].getNode(fQualifier).putInt(key, value); } /** * Sets a long in the {@link DefaultScope} * * @param key * the key * @param value * the new value */ public static synchronized void setDefaultLong(String key, long value) { contexts[DEFAULT_CONTEXT].getNode(fQualifier).putLong(key, value); } /** * Sets a string in the {@link DefaultScope} * * @param key * the key * @param value * the new value */ public static synchronized void setDefaultString(String key, String value) { contexts[DEFAULT_CONTEXT].getNode(fQualifier).put(key, value); } /** * Sets a double preference in the {@link InstanceScope}. * * @param key * the key * @param value * the value */ public static synchronized void setDouble(String key, double value) { contexts[INSTANCE_CONTEXT].getNode(fQualifier).putDouble(key, value); } /** * Sets a float preference in the {@link InstanceScope}. * * @param key * the key * @param value * the value */ public static synchronized void setFloat(String key, float value) { contexts[INSTANCE_CONTEXT].getNode(fQualifier).putFloat(key, value); } /** * Sets a integer preference in the {@link InstanceScope}. * * @param key * the key * @param value * the value */ public static synchronized void setInt(String key, int value) { contexts[INSTANCE_CONTEXT].getNode(fQualifier).putInt(key, value); } /** * Sets a long preference in the {@link InstanceScope}. * * @param key * the key * @param value * the value */ public static synchronized void setLong(String key, long value) { contexts[INSTANCE_CONTEXT].getNode(fQualifier).putLong(key, value); } /** * Sets a string preference in the {@link InstanceScope}. * * @param key * the key * @param value * the value */ public static synchronized void setString(String key, String value) { contexts[INSTANCE_CONTEXT].getNode(fQualifier).put(key, value); } /** * Sets the given preference to its default value. This is done by removing * any set value from the {@link InstanceScope}. Has no effect if the given * key is null. * * @param key * the key for the preference */ public static synchronized void setToDefault(String key) { if (key != null) { contexts[INSTANCE_CONTEXT].getNode(fQualifier).remove(key); } } /** * Constructor */ private Preferences() { // no direct instantiation } } services/000077500000000000000000000000001272114001700343715ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/corelocal/000077500000000000000000000000001272114001700354635ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/servicesLocalCommandShellService.java000066400000000000000000000044761272114001700432030ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core.services.local; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.eclipse.core.runtime.Platform; import org.eclipse.remote.core.IRemoteCommandShellService; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnection.Service; import org.eclipse.remote.core.IRemoteProcess; import org.eclipse.remote.core.IRemoteProcessBuilder; import org.eclipse.remote.core.IRemoteProcessService; public class LocalCommandShellService implements IRemoteCommandShellService { private final IRemoteConnection connection; public LocalCommandShellService(IRemoteConnection connection) { this.connection = connection; } public static class Factory implements IRemoteCommandShellService.Factory { @SuppressWarnings("unchecked") @Override public T getService(IRemoteConnection remoteConnection, Class service) { if (service.equals(IRemoteCommandShellService.class)) { return (T) new LocalCommandShellService(remoteConnection); } return null; } } @Override public IRemoteConnection getRemoteConnection() { return connection; } @SuppressWarnings("nls") @Override public IRemoteProcess getCommandShell(int flags) throws IOException { IRemoteProcessService procService = connection.getService(IRemoteProcessService.class); String[] command; if (Platform.getOS().equals(Platform.OS_WIN32)) { command = new String[] { "cmd" }; } else { List list = new ArrayList<>(Arrays.asList(System.getenv("SHELL").split("\\s+"))); list.add("-l"); command = list.toArray(new String[list.size()]); } IRemoteProcessBuilder builder = procService.getProcessBuilder(command); return builder.start(IRemoteProcessBuilder.ALLOCATE_PTY); } } LocalConnectionHostService.java000066400000000000000000000050041272114001700435560ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core.services.local; import java.net.InetAddress; import java.net.UnknownHostException; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnection.Service; import org.eclipse.remote.core.IRemoteConnectionHostService; public class LocalConnectionHostService implements IRemoteConnectionHostService { private final IRemoteConnection connection; public LocalConnectionHostService(IRemoteConnection connection) { this.connection = connection; } public static class Factory implements IRemoteConnectionHostService.Factory { @SuppressWarnings("unchecked") @Override public T getService(IRemoteConnection remoteConnection, Class service) { if (service.equals(IRemoteConnectionHostService.class)) { return (T) new LocalConnectionHostService(remoteConnection); } return null; } } @Override public IRemoteConnection getRemoteConnection() { return this.connection; } @Override public String getHostname() { try { return InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { return "unknown"; //$NON-NLS-1$ } } @Override public int getPort() { return 0; } @Override public int getTimeout() { return 0; } @Override public boolean useLoginShell() { return true; } @Override public String getUsername() { return System.getProperty("user.name"); //$NON-NLS-1$ } @Override public void setHostname(String hostname) { // Ignored } @Override public void setPassphrase(String passphrase) { // Ignored } @Override public void setPassword(String password) { // Ignored } @Override public void setPort(int port) { // Ignored } @Override public void setTimeout(int timeout) { // Ignored } @Override public void setUseLoginShell(boolean useLogingShell) { // Ignored } @Override public void setUsePassword(boolean usePassword) { // Ignored } @Override public void setUsername(String username) { // Ignored } } LocalConnectionPropertyService.java000066400000000000000000000040231272114001700444650ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core.services.local; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnection.Service; import org.eclipse.remote.core.IRemoteConnectionPropertyService; import org.eclipse.remote.internal.core.RemoteCorePlugin; public class LocalConnectionPropertyService implements IRemoteConnectionPropertyService { private final IRemoteConnection connection; public LocalConnectionPropertyService(IRemoteConnection connection) { this.connection = connection; } public static class Factory implements IRemoteConnectionPropertyService.Factory { @SuppressWarnings("unchecked") @Override public T getService(IRemoteConnection remoteConnection, Class service) { if (service.equals(IRemoteConnectionPropertyService.class)) { return (T) new LocalConnectionPropertyService(remoteConnection); } return null; } } @Override public IRemoteConnection getRemoteConnection() { return connection; } @Override public String getProperty(String key) { switch (key) { case IRemoteConnection.OS_NAME_PROPERTY: return RemoteCorePlugin.getDefault().getBundle().getBundleContext().getProperty("osgi.os"); //$NON-NLS-1$ case IRemoteConnection.OS_ARCH_PROPERTY: return RemoteCorePlugin.getDefault().getBundle().getBundleContext().getProperty("osgi.arch"); //$NON-NLS-1$ case IRemoteConnection.LOCALE_CHARMAP_PROPERTY: return System.getProperty("file.encoding"); //$NON-NLS-1$ } return System.getProperty(key); } } LocalConnectionProviderService.java000066400000000000000000000037241272114001700444420ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core.services.local; import org.eclipse.remote.core.IRemoteConnectionProviderService; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionType.Service; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.core.RemoteCorePlugin; public class LocalConnectionProviderService implements IRemoteConnectionProviderService { private static final String localConnectionName = Messages.LocalConnectionProviderService_LocalConnectionName; private IRemoteConnectionType connectionType; public static class Factory implements IRemoteConnectionType.Service.Factory { @SuppressWarnings("unchecked") @Override public T getService(IRemoteConnectionType connectionType, Class service) { if (service.equals(IRemoteConnectionProviderService.class)) { return (T) new LocalConnectionProviderService(connectionType); } return null; } } public LocalConnectionProviderService(IRemoteConnectionType connectionType) { this.connectionType = connectionType; } @Override public void init() { if (connectionType.getConnections().isEmpty()) { try { connectionType.newConnection(localConnectionName).save(); } catch (RemoteConnectionException e) { RemoteCorePlugin.log(e.getStatus()); } } } @Override public IRemoteConnectionType getConnectionType() { return connectionType; } } LocalFileService.java000066400000000000000000000046261272114001700415110ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core.services.local; import java.net.URI; import org.eclipse.core.filesystem.EFS; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.filesystem.URIUtil; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnection.Service; import org.eclipse.remote.core.IRemoteFileService; import org.eclipse.remote.core.IRemoteProcessService; public class LocalFileService implements IRemoteFileService { private final IRemoteConnection connection; public LocalFileService(IRemoteConnection connection) { this.connection = connection; } public static class Factory implements IRemoteFileService.Factory { @SuppressWarnings("unchecked") @Override public T getService(IRemoteConnection remoteConnection, Class service) { if (IRemoteFileService.class.equals(service)) { return (T) new LocalFileService(remoteConnection); } return null; } } @Override public IRemoteConnection getRemoteConnection() { return connection; } @Override public String getDirectorySeparator() { return System.getProperty("file.separator", "/"); //$NON-NLS-1$ //$NON-NLS-2$ } @Override public IFileStore getResource(String path) { return EFS.getLocalFileSystem().getStore(Path.fromOSString(path)); } @Override public String getBaseDirectory() { return connection.getService(IRemoteProcessService.class).getWorkingDirectory(); } @Override public void setBaseDirectory(String path) { connection.getService(IRemoteProcessService.class).setWorkingDirectory(path); } @Override public String toPath(URI uri) { return URIUtil.toPath(uri).toString(); } @Override public URI toURI(IPath path) { return URIUtil.toURI(path); } @Override public URI toURI(String path) { return URIUtil.toURI(path); } } LocalProcess.java000066400000000000000000000137241272114001700407260ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core.services.local; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PipedInputStream; import java.io.PipedOutputStream; import org.eclipse.cdt.utils.pty.PTY; import org.eclipse.remote.core.IRemoteProcess; import org.eclipse.remote.core.IRemoteProcessControlService; import org.eclipse.remote.core.IRemoteProcessTerminalService; public class LocalProcess implements IRemoteProcessControlService, IRemoteProcessTerminalService { private static int refCount = 0; private final IRemoteProcess remoteProcess; private final Process localProcess; private final PTY pty; private int width, height; private InputStream procStdout; private InputStream procStderr; private Thread stdoutReader; private Thread stderrReader; private final Thread completedChecker; private volatile boolean isCompleted; public static class Factory implements IRemoteProcess.Service.Factory { /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcess.Service.Factory#getService(org.eclipse.remote.core.IRemoteProcess, * java.lang.Class) */ @SuppressWarnings("unchecked") @Override public T getService(IRemoteProcess remoteProcess, Class service) { // This little trick creates an instance of this class // then for each interface it implements, it returns the same object. // This works because the connection caches the service so only one gets created. // As a side effect, it makes this class a service too which can be used // by the this plug-in if (LocalProcess.class.equals(service)) { return (T) new LocalProcess(remoteProcess); } if (IRemoteProcessControlService.class.equals(service)) { return (T) remoteProcess.getService(LocalProcess.class); } if (IRemoteProcessTerminalService.class.equals(service)) { return (T) remoteProcess.getService(LocalProcess.class); } return null; } } /** * Thread to merge stdout and stderr. Keeps refcount so that output stream * is not closed too early. * */ private class ProcOutputMerger implements Runnable { private final static int BUF_SIZE = 8192; private final InputStream input; private final OutputStream output; public ProcOutputMerger(InputStream input, OutputStream output) { this.input = input; this.output = output; synchronized (this.output) { refCount++; } } @Override public void run() { int len; byte b[] = new byte[BUF_SIZE]; try { while ((len = input.read(b)) > 0) { output.write(b, 0, len); } } catch (IOException e) { // Ignore } synchronized (output) { if (--refCount == 0) { try { output.close(); } catch (IOException e) { // Ignore } } } } } public class NullInputStream extends InputStream { @Override public int read() throws IOException { return -1; } @Override public int available() { return 0; } } public LocalProcess(IRemoteProcess process) { remoteProcess = process; LocalProcessBuilder builder = (LocalProcessBuilder) process.getProcessBuilder(); localProcess = builder.getProcess(); pty = builder.getPty(); try { if (process.getProcessBuilder().redirectErrorStream()) { PipedOutputStream pipedOutput = new PipedOutputStream(); procStderr = new NullInputStream(); procStdout = new PipedInputStream(pipedOutput); stderrReader = new Thread(new ProcOutputMerger(localProcess.getErrorStream(), pipedOutput)); stdoutReader = new Thread(new ProcOutputMerger(localProcess.getInputStream(), pipedOutput)); stderrReader.start(); stdoutReader.start(); } else { procStderr = localProcess.getErrorStream(); procStdout = localProcess.getInputStream(); } } catch (IOException e) { localProcess.destroy(); } completedChecker = new Thread(new Runnable() { @Override public void run() { while (!isCompleted) { try { localProcess.waitFor(); } catch (InterruptedException e) { continue; } isCompleted = true; } } }); completedChecker.start(); } /* * (non-Javadoc) * * @see java.lang.Process#destroy() */ @Override public void destroy() { localProcess.destroy(); } /* * (non-Javadoc) * * @see java.lang.Process#exitValue() */ @Override public int exitValue() { return localProcess.exitValue(); } /* * (non-Javadoc) * * @see java.lang.Process#getErrorStream() */ @Override public InputStream getErrorStream() { return procStderr; } /* * (non-Javadoc) * * @see java.lang.Process#getInputStream() */ @Override public InputStream getInputStream() { return procStdout; } /* * (non-Javadoc) * * @see java.lang.Process#getOutputStream() */ @Override public OutputStream getOutputStream() { return localProcess.getOutputStream(); } /* * (non-Javadoc) * * @see java.lang.Process#waitFor() */ @Override public int waitFor() throws InterruptedException { return localProcess.waitFor(); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.RemoteProcess#isCompleted() */ @Override public boolean isCompleted() { return isCompleted; } @Override public IRemoteProcess getRemoteProcess() { return remoteProcess; } @Override public void setTerminalSize(int cols, int rows, int pwidth, int pheight) { if (pty != null && (width != cols || height != rows)) { width = cols; height = rows; pty.setTerminalSize(width, height); } } } LocalProcessBuilder.java000066400000000000000000000142471272114001700422360ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core.services.local; import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import org.eclipse.cdt.utils.pty.PTY; import org.eclipse.cdt.utils.pty.PTY.Mode; import org.eclipse.cdt.utils.spawner.ProcessFactory; import org.eclipse.core.filesystem.EFS; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtension; import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; import org.eclipse.remote.core.AbstractRemoteProcessBuilder; import org.eclipse.remote.core.IProcessFactory; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteProcess; import org.eclipse.remote.core.IRemoteProcessBuilder; import org.eclipse.remote.internal.core.RemoteCorePlugin; import org.eclipse.remote.internal.core.RemoteProcess; public class LocalProcessBuilder extends AbstractRemoteProcessBuilder { private static final String EXTENSION_POINT_ID = "processFactory"; //$NON-NLS-1$ private static final String ATTR_CLASS = "class"; //$NON-NLS-1$ private final IProcessFactory fProcessFactory; private final Map fRemoteEnv = new HashMap(); private Process localProcess; private PTY pty; public LocalProcessBuilder(IRemoteConnection connection, List command) { super(connection, command); fRemoteEnv.putAll(System.getenv()); fProcessFactory = getProcessFactory(); } public LocalProcessBuilder(IRemoteConnection connection, String... command) { this(connection, Arrays.asList(command)); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.AbstractRemoteProcessBuilder#directory() */ @Override public IFileStore directory() { IFileStore dir = super.directory(); if (dir == null) { String userDir = System.getProperty("user.dir"); //$NON-NLS-1$ if (userDir != null) { dir = EFS.getLocalFileSystem().getStore(Path.fromOSString(userDir)); directory(dir); } } return dir; } /* * (non-Javadoc) * * @see * org.eclipse.remote.core.AbstractRemoteProcessBuilder#environment() */ @Override public Map environment() { return fRemoteEnv; } /* * (non-Javadoc) * * @see * org.eclipse.remote.core.AbstractRemoteProcessBuilder#getSupportedFlags * () */ @Override public int getSupportedFlags() { return NONE; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcessBuilder#start(int) */ @Override public IRemoteProcess start(int flags) throws IOException { String commandArray[] = command().toArray(new String[0]); if ((flags & IRemoteProcessBuilder.ALLOCATE_PTY) != 0) { environment().put("TERM", "vt100"); //$NON-NLS-1$ //$NON-NLS-2$ } String environmentArray[] = new String[environment().size()]; int index = 0; for (Entry entry : environment().entrySet()) { environmentArray[index++] = entry.getKey() + "=" + entry.getValue(); //$NON-NLS-1$ } try { if ((flags & IRemoteProcessBuilder.ALLOCATE_PTY) != 0) { pty = new PTY(Mode.TERMINAL); File dir = directory() != null ? directory().toLocalFile(EFS.NONE, new NullProgressMonitor()) : null; localProcess = ProcessFactory.getFactory().exec(commandArray, environmentArray, dir, pty); } else { if (directory() != null) { localProcess = fProcessFactory.exec(commandArray, environmentArray, directory().toLocalFile(EFS.NONE, new NullProgressMonitor())); } else { localProcess = fProcessFactory.exec(commandArray, environmentArray); } } } catch (CoreException e) { throw new IOException(e.getMessage()); } return new RemoteProcess(getRemoteConnection(), this); } public Process getProcess() { return localProcess; } public PTY getPty() { return pty; } private IProcessFactory getProcessFactory() { IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint extensionPoint = registry.getExtensionPoint(RemoteCorePlugin.getUniqueIdentifier(), EXTENSION_POINT_ID); IProcessFactory processFactory = null; for (IExtension ext : extensionPoint.getExtensions()) { final IConfigurationElement[] elements = ext.getConfigurationElements(); for (IConfigurationElement ce : elements) { try { processFactory = (IProcessFactory) ce.createExecutableExtension(ATTR_CLASS); } catch (CoreException e) { // Use default factory } } } if (processFactory == null) { processFactory = new IProcessFactory() { @Override public Process exec(String cmd) throws IOException { return Runtime.getRuntime().exec(cmd); } @Override public Process exec(String[] cmdarray) throws IOException { return Runtime.getRuntime().exec(cmdarray); } @Override public Process exec(String[] cmdarray, String[] envp) throws IOException { return Runtime.getRuntime().exec(cmdarray, envp); } @Override public Process exec(String cmd, String[] envp) throws IOException { return Runtime.getRuntime().exec(cmd, envp); } @Override public Process exec(String cmd, String[] envp, File dir) throws IOException { return Runtime.getRuntime().exec(cmd, envp, dir); } @Override public Process exec(String[] cmdarray, String[] envp, File dir) throws IOException { return Runtime.getRuntime().exec(cmdarray, envp, dir); } }; } return processFactory; } } LocalProcessService.java000066400000000000000000000037321272114001700422450ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/localpackage org.eclipse.remote.internal.core.services.local; import java.util.List; import java.util.Map; import org.eclipse.core.runtime.Path; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnection.Service; import org.eclipse.remote.core.IRemoteProcessBuilder; import org.eclipse.remote.core.IRemoteProcessService; public class LocalProcessService implements IRemoteProcessService { private final IRemoteConnection remoteConnection; private String workingDirectory; public LocalProcessService(IRemoteConnection remoteConnection) { this.remoteConnection = remoteConnection; } public static class Factory implements IRemoteProcessService.Factory { @SuppressWarnings("unchecked") @Override public T getService(IRemoteConnection remoteConnection, Class service) { if (IRemoteProcessService.class.equals(service)) { return (T) new LocalProcessService(remoteConnection); } return null; } } @Override public IRemoteConnection getRemoteConnection() { return remoteConnection; } @Override public Map getEnv() { return System.getenv(); } @Override public String getEnv(String name) { return System.getenv(name); } @Override public IRemoteProcessBuilder getProcessBuilder(List command) { return new LocalProcessBuilder(remoteConnection, command); } @Override public IRemoteProcessBuilder getProcessBuilder(String... command) { return new LocalProcessBuilder(remoteConnection, command); } @Override public String getWorkingDirectory() { if (workingDirectory == null) { workingDirectory = System.getProperty("user.home"); //$NON-NLS-1$ if (workingDirectory == null) { workingDirectory = System.getProperty("user.dir"); //$NON-NLS-1$ if (workingDirectory == null) { workingDirectory = Path.ROOT.toOSString(); } } } return workingDirectory; } @Override public void setWorkingDirectory(String path) { workingDirectory = path; } } LocalResource.java000066400000000000000000000034471272114001700411000ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/******************************************************************************* * Copyright (c) 2011 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.core.services.local; import java.net.URI; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.remote.core.IRemoteResource; public class LocalResource implements IRemoteResource { private IResource fResource; public LocalResource(IResource resource) { fResource = resource; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteResource#getDefaultLocationURI(org.eclipse.core.resources.IResource) */ @Override public URI getActiveLocationURI() { return fResource.getLocationURI(); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteResource#getResource() */ @Override public IResource getResource() { return fResource; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteResource#refresh(org.eclipse.core.runtime.IProgressMonitor) */ @Override public void refresh(IProgressMonitor monitor) throws CoreException { fResource.refreshLocal(IResource.DEPTH_INFINITE, monitor); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteResource#setResource(org.eclipse.core.resources.IResource) */ @Override public void setResource(IResource resource) { fResource = resource; } } Messages.java000066400000000000000000000007001272114001700400720ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/localpackage org.eclipse.remote.internal.core.services.local; import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.remote.internal.core.services.local.messages"; //$NON-NLS-1$ public static String LocalConnectionProviderService_LocalConnectionName; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); } private Messages() { } } messages.properties000066400000000000000000000000711272114001700414060ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/localLocalConnectionProviderService_LocalConnectionName=Local org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/000077500000000000000000000000001272114001700242015ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/.project000066400000000000000000000007551272114001700256570ustar00rootroot00000000000000 org.eclipse.remote.doc.isv org.eclipse.pde.ManifestBuilder org.eclipse.pde.SchemaBuilder org.eclipse.pde.PluginNature org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/META-INF/000077500000000000000000000000001272114001700253415ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/META-INF/MANIFEST.MF000066400000000000000000000010021272114001700267640ustar00rootroot00000000000000Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Eclipse Remote Development documentation plug-in Bundle-SymbolicName: org.eclipse.remote.doc.isv;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-Vendor: Eclipse PTP Require-Bundle: org.eclipse.remote.console, org.eclipse.remote.core, org.eclipse.remote.jsch.core, org.eclipse.remote.jsch.ui, org.eclipse.remote.serial.core, org.eclipse.remote.serial.ui, org.eclipse.remote.telnet.core, org.eclipse.remote.telnet.ui, org.eclipse.remote.ui org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/about.html000066400000000000000000000024471272114001700262100ustar00rootroot00000000000000 About

About This Content

May 2, 2006

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/build.properties000066400000000000000000000002301272114001700274110ustar00rootroot00000000000000bin.includes = plugin.xml,\ META-INF/,\ html/,\ toc*.xml,\ css/,\ about.html org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/css/000077500000000000000000000000001272114001700247715ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/css/style.css000066400000000000000000000004161272114001700266440ustar00rootroot00000000000000code { color: Crimson; font-family: monaco,consolas,"courier new",monospace; } pre { background-color: lightgrey; width: auto; overflow: auto; padding: 25px; border: 1px solid navy; margin: 1em; } p { font: 15px arial, sans-serif; }org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/html/000077500000000000000000000000001272114001700251455ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/html/.gitignore000066400000000000000000000000141272114001700271300ustar00rootroot00000000000000/reference/ org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/html/concepts/000077500000000000000000000000001272114001700267635ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/html/concepts/concepts.html000066400000000000000000000124161272114001700314730ustar00rootroot00000000000000 Concepts

This section describes the main concepts and services implemented by the Eclipse remote framework.

Concepts

Some few concepts are needed to understand the framework's services overall. They are described in the next sections.

Connection type

An connection type (IRemoteConnectionType) abstracts a remote protocol to host access. As of version 2.0.1, the framework provides the ssh (implemented through JSch framework), Telnet and Local types.

The connection type is obtained from the remote services manager either by passing its scheme ID (Identification) or an URI.

It has the newConnection method where a new connection of this type is created. It also holds the list of all connections already created that belongs to it.

Remote connection

The remote connection (IRemoteConnection) interface is used to manage a connection to a single remote host. A connection must be established (open) before any other operations are permitted. All operations carried out on remote host should be evoked from its associated services, which are get with getService method.

Connections are read-only objects. In order to change the attributes of a connection, a working copy (IRemoteConnectionWorkingCopy) must be created. The host attributes getters and setters can also be managed with connection host service (IRemoteConnectionHostService).

Every remote connection belongs to a connection type.

Remote resource

The remote resource interface (IRemoteResource) provides an adapter to a remote resource.

As of version 2.0.1, there are two types of remote resources: fully remote and synchronized. This interface provides a common mechanism for accessing resource information from either types.

Process builder

The process builder (IRemoteProcessBuilder) provides process operations on the remote host. This interface is intended to be a drop-in replacement for the Java SE ProcessBuilder class. See the java.lang.ProcessBuilder documentation for a description of the methods.

It is obtained from the process service (see IRemoteProcessService below) associated with a connection object that holds access information to the remote host.

Remote process

The remote process (IRemoteProcess) represents a process running on the remote host. Use it to manage the process (destroy), get exit status, and input/output/error streams.

Remote process are created using the IRemoteProcessBuilder interface.

Services

The remote services are implemented as OSGi services. There are available non-UI (core) and UI services.

Any given service can be associated with objects of the model (concepts) or nested to another one. In either case, an service instance is obtained by calling the getService method of its object's provider.

The main remote services are detailed in the next sections.

Services manager

The services manager (IRemoteServicesManager) interface provides the main entry point for accessing remote services. It can be obtained by calling RemoteServicesUtils.getService(IRemoteServicesManager.class) or using the Plugin's bundle context to access a OSGi service.

It provides access to connection types implemented by the framework and any connection already created.

File Service

The file service (IRemoteFileService) provides remote file manipulation operations on a given connection. It is obtained from a remote connection object by calling its getService(IRemoteFileService.class) method.

Using this interface, a path can be translated into an IFileStore object, and then manipulated using any of the normal EFS operations.

Its UI counterpart service (IRemoteUIFileService) comes with dialog widgets to browse files and directories on remote filesystem.

Process Service

The process service (IRemoteProcessService) provides services for starting up processes on a remote host. It is obtained from a remote connection object by calling its getService(IRemoteProcessService.class) method.

It is the entry point to get an IRemoteProcessBuilder object, used to spawn processes on the remote host. Environment variables of remote host are accessed using this service too.

Connection Service

The UI Connection service (IRemoteUIConnectionService) is used for manipulating connections in the UI, such as adding, editing, and opening connections.

Non-UI connection manipulation should use the IRemoteConnectionType interface (obtained from services manager) and the services related with IRemoteConnection interface.

org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/html/gettingstarted/000077500000000000000000000000001272114001700301755ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/html/gettingstarted/intro.html000066400000000000000000000047561272114001700322320ustar00rootroot00000000000000 Getting started

Introduction

The purpose of remote services API is to provide a programming interface to remote services that is agnostic to the actual remote services implementation. Currently the only implementation supported of SSH protocol uses JSch(Java Secure Channel) project (www.jcraft.com/jsch). An implementation for the local system (where Eclipse is run) and Telnet protocol are also provided.

The API is generic enough so that it is possible to use it for all remote or local operations. This is useful for situations where both a remote and local mode should be provided, but the programmer wants to avoid two separate code paths.

Types of services

The API is divided into two types of remote services: UI and non-UI.

UI services are for activities such as file browsing that require use of the UI. In particular, it provides a main preference page (under "Remote Development > Remote Connections") which allow connections to be created, edited, removed, opened, and closed.

Non-UI services are purely programmatic, they provides a set of core services for manipulating remote resources. The non-UI services can be used independently of the UI services.

Remote Services Plugins

The remote services are divided into two plugins. These plugins should have no dependencies other than the platform.

Remote service implementations provide the actual remote functionality using a particular remote protocol. These are supplied as a set of adapter plugins.

As of version 2.0.1, there is currently one implementation of SSH protocol using JSch:

The Telnet protocol implementation and UI widgets are provided by the plugins:

These plugins are dependent on the remote services implementations, but are optional for the remote services API. The API will automatically detect the installed plugins.

org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/html/samples/000077500000000000000000000000001272114001700266115ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/html/samples/examples.html000066400000000000000000000124671272114001700313270ustar00rootroot00000000000000 Samples

Usage examples

This section shows usage examples for using the Eclipse Remote API.

The services manager can be obtained using RemoteServicesUtils (since 2.0.1) helper:


IRemoteServicesManager servicesManager = RemoteServicesUtils.getService(IRemoteServicesManager.class);

An alternative is to use the bundle's context to get the service reference:


BundleContext context = plugin.getBundle().getBundleContext();
ServiceReference ref = context.getServiceReference(IRemoteServicesManager.class);
IRemoteServicesManager servicesManager = context.getService(ref);

Once with services manager object, you obtain a connection type by its scheme ID or any URI to the remote host, as in:


IRemoteConnectionType connType;
// Get connection type by Scheme ID
connType = servicesManager.getConnectionType("ssh");
// Get connection type by URI
URI uri = URI.create("ssh://MyConnection/path/to/file");
connType = servicesManager.getConnectionType(uri);

The Telnet connection type can not be obtained by URI, instead you must use its ID:


IRemoteConnectionType connType;
connType = servicesManager.getConnectionType("org.eclipse.remote.telnet.core.connectionType");

The remote connection is obtained from connection type object by either name or an URI. For example:


IRemoteConnection connection;
// Get connection by URI
URI uri = URI.create("ssh://MyConnection/path/to/file");
connection = connType.getConnection(uri);
// Get connection by name
connection = connType.getConnection("MyConnection");

If the connection does not exist, it can be created with a connection type (IRemoteConnectionType) instance. Use the connection type object to delete it as well:


IRemoteConnectionWorkingCopy rcwc; // Writable connection working copy 
rcwc = connType.newConnection(connectionName); // Create connection of connection type
IRemoteConnectionHostService hostServices; // Fill connection information through host service
hostServices = rcwc.getService(IRemoteConnectionHostService.class); // Obtain the service from working copy instance
hostServices.setHostname(address);
hostServices.setUsername(username);
hostServices.setUsePassword(true);
hostServices.setPassword(passwd);
IRemoteConnection connection = rcwc.save(); // Finally save the working copy, then get the connection (read-only) object

connType.removeConnection(connection); // Remove connection and all resources associated with it

Connections can be opened or closed programmatically. Some operations requires the connection opened:


connection.open(monitor); // Open the connection but allow the user to cancel the progress monitor
connection.close(); // Now close it

The file service is obtained from a connection object. Remote resources can be manipulated with IFileStore:


IRemoteFileService fileService = connection.getService(IRemoteFileService.class);
// The remote connection does not need to be open to get the resource
IFileStore fs = fileService.getResource("/path/to/resource");
// But the remote connection need to be open to operate on the resource
if (fs.fetchInfo().exists()) {
    System.out.println("It exists!");
}

In the other hand, the UI file service is obtained from a connection type rather than the connection. The reason is that it allows user to select the connection in a list. It is also possible to set the connection:


IRemoteUIFileService uiFileService = conn.getConnectionType().getService(IRemoteUIFileService.class);
uiFileService.setConnection(connection); // Set default connection (optional)
uiFileService.showConnections(true); // Also show list of available connections
// The return value is the path of the directory selected on the remote system
String path = uiFileService.browseDirectory(shell, "Browse /home", "/home", IRemoteUIConstants.NONE);

Use a connection object to get its associated process service (IRemoteProcessService). Then obtain a process builder (IRemoteProcessBuilder), so that commands can be executed on remote host:


IRemoteProcessService ps = connection.getService(IRemoteProcessService.class);
IRemoteProcessBuilder pb = ps.getProcessBuilder("/bin/ls", "-l");
IRemoteProcess process = pb.start();
// Use IRemoteProcess to manage the process. Alternatively, use an adaptor to java.lang.Process
Process process2 = new RemoteProcessAdapter(process);

Use the IRemoteResource adapter to get a location URI of the project (IProject):


IRemoteResource resource = (IRemoteResource)project.getAdapter(IRemoteResource.class);
URI projectLocation = resource.getActiveLocationURI(); // Get URI to active location
org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/html/toc.html000066400000000000000000000012721272114001700266220ustar00rootroot00000000000000 Remote Developer's Guide

Eclipse Remote Developer's Guide

This is the guide of the eclipse remote development framework as of provided by org.eclipse.remote project.

Table of Contents

org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/plugin.xml000066400000000000000000000007401272114001700262220ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/pom.xml000066400000000000000000000027501272114001700255220ustar00rootroot00000000000000 4.0.0 org.eclipse.remote remote-parent 2.1.0-SNAPSHOT ../../releng/org.eclipse.remote.build/pom.xml org.eclipse.remote.doc.isv eclipse-plugin org.eclipse.tycho.extras tycho-document-bundle-plugin ${tycho-extras-version} ${basedir}/html/reference/api javadoc javadoc 1.0.0-SNAPSHOT org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/toc.xml000066400000000000000000000006751272114001700255200ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/tocconcepts.xml000066400000000000000000000003171272114001700272500ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/tocgettingstarted.xml000066400000000000000000000003461272114001700304640ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/tocreference.xml000066400000000000000000000003201272114001700273620ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.doc.isv/tocsamples.xml000066400000000000000000000003131272114001700270720ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/000077500000000000000000000000001272114001700245125ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/.classpath000066400000000000000000000005611272114001700264770ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/.gitignore000066400000000000000000000000051272114001700264750ustar00rootroot00000000000000/bin org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/.project000066400000000000000000000015231272114001700261620ustar00rootroot00000000000000 org.eclipse.remote.jsch.core org.eclipse.jdt.core.javabuilder org.eclipse.pde.ManifestBuilder org.eclipse.pde.SchemaBuilder org.eclipse.pde.api.tools.apiAnalysisBuilder org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.pde.api.tools.apiAnalysisNature org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/.settings/000077500000000000000000000000001272114001700264305ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/.settings/org.eclipse.jdt.core.prefs000066400000000000000000000011131272114001700334060ustar00rootroot00000000000000eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/META-INF/000077500000000000000000000000001272114001700256525ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/META-INF/MANIFEST.MF000066400000000000000000000015321272114001700273050ustar00rootroot00000000000000Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.remote.jsch.core;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-Activator: org.eclipse.remote.internal.jsch.core.Activator Bundle-Vendor: %pluginProvider Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.remote.internal.jsch.core;x-friends:="org.eclipse.remote.jsch.ui,org.eclipse.remote.jsch.tests", org.eclipse.remote.internal.jsch.core.messages;x-internal:=true Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Import-Package: com.jcraft.jsch, org.eclipse.core.filesystem, org.eclipse.core.filesystem.provider, org.eclipse.core.runtime, org.eclipse.jsch.core, org.eclipse.osgi.util, org.eclipse.remote.core, org.eclipse.remote.core.exception, org.eclipse.remote.internal.core, org.osgi.framework org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/about.html000066400000000000000000000024471272114001700265210ustar00rootroot00000000000000 About

About This Content

May 2, 2006

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/build.properties000066400000000000000000000002461272114001700277310ustar00rootroot00000000000000source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ plugin.xml,\ plugin.properties,\ about.htmlorg.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/plugin.properties000066400000000000000000000007651272114001700301360ustar00rootroot00000000000000############################################################################### # Copyright (c) 2013 IBM Corporation. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # ############################################################################### pluginName=JSch Remote Support pluginProvider=Eclipse PTP org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/plugin.xml000066400000000000000000000072661272114001700265450ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/pom.xml000066400000000000000000000012151272114001700260260ustar00rootroot00000000000000 4.0.0 org.eclipse.remote remote-parent 2.1.0-SNAPSHOT ../../releng/org.eclipse.remote.build/pom.xml org.eclipse.remote.jsch.core eclipse-plugin 1.0.0-SNAPSHOT org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/000077500000000000000000000000001272114001700253015ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/000077500000000000000000000000001272114001700260705ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/000077500000000000000000000000001272114001700275145ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/000077500000000000000000000000001272114001700310075ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/000077500000000000000000000000001272114001700326235ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/000077500000000000000000000000001272114001700335525ustar00rootroot00000000000000core/000077500000000000000000000000001272114001700344235ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jschActivator.java000066400000000000000000000054601272114001700372270ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/corepackage org.eclipse.remote.internal.jsch.core; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Status; import org.eclipse.jsch.core.IJSchService; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; /** * The activator class controls the plug-in life cycle */ public class Activator extends Plugin { // The plug-in ID public static final String PLUGIN_ID = "org.eclipse.remote.jsch.core"; //$NON-NLS-1$ // The shared instance private static Activator plugin; /** * Returns the shared instance * * @return the shared instance */ public static Activator getDefault() { return plugin; } /** * Get unique identifier * * @return * @since 5.0 */ public static String getUniqueIdentifier() { if (getDefault() == null) { return PLUGIN_ID; } return getDefault().getBundle().getSymbolicName(); } /** * Logs the specified status with this plug-in's log. * * @param status * status to log */ public static void log(IStatus status) { getDefault().getLog().log(status); } /** * Logs an internal error with the specified message. * * @param message * the error message to log */ public static void log(String message) { log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, message, null)); } /** * Logs an internal error with the specified throwable * * @param e * the exception to be logged */ public static void log(Throwable e) { log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, e.getMessage(), e)); } private IJSchService fJSchService; /** * The constructor */ public Activator() { } /** * Return the OSGi service with the given service interface. * * @param service service interface * @return the specified service or null if it's not registered */ public static T getService(Class service) { BundleContext context = plugin.getBundle().getBundleContext(); ServiceReference ref = context.getServiceReference(service); return ref != null ? context.getService(ref) : null; } public IJSchService getService() { return fJSchService; } /* * (non-Javadoc) * * @see * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext * ) */ @Override public void start(BundleContext context) throws Exception { super.start(context); plugin = this; ServiceReference reference = context.getServiceReference(IJSchService.class); fJSchService = context.getService(reference); } /* * (non-Javadoc) * * @see * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext * ) */ @Override public void stop(BundleContext context) throws Exception { plugin = null; super.stop(context); } } ArgumentParser.java000066400000000000000000000230051272114001700402250ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.jsch.core; import java.text.CharacterIterator; import java.text.StringCharacterIterator; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; /** * Utilitiy class for managing command line arguments. * */ public class ArgumentParser { private static List parseCommandline(String commandline) { ArrayList result = new ArrayList(); StringCharacterIterator iterator = new StringCharacterIterator(commandline); for (iterator.first(); iterator.current() != CharacterIterator.DONE; iterator.next()) { // Restart to skip white space if (Character.isWhitespace(iterator.current())) { continue; } // Read token StringBuffer buffer = new StringBuffer(); token_reader: for (; iterator.current() != CharacterIterator.DONE; iterator.next()) { char tokenChar = iterator.current(); // A white space terminates the token if (Character.isWhitespace(tokenChar)) { break token_reader; } // Handle character that composes the token switch (tokenChar) { case '"': { /* * Read all text within double quotes or until end of * string. Allows escaping. */ iterator.next(); // Skip quote quoted_reader: while ((iterator.current() != CharacterIterator.DONE) && (iterator.current() != '"')) { char innerChar = iterator.current(); switch (innerChar) { case '\\': char nextChar = iterator.next(); switch (nextChar) { case CharacterIterator.DONE: break quoted_reader; case '"': // Add the character, but remove the escape buffer.append(nextChar); iterator.next(); continue quoted_reader; default: // Add the character and keep escape buffer.append(innerChar); buffer.append(nextChar); iterator.next(); continue quoted_reader; } default: buffer.append(innerChar); iterator.next(); continue quoted_reader; } } continue token_reader; } case '\'': { /* * Read all text within single quotes or until end of * string. No escaping. */ iterator.next(); // Skip the quote while ((iterator.current() != CharacterIterator.DONE) && (iterator.current() != '\'')) { buffer.append(iterator.current()); iterator.next(); } continue token_reader; } case '\\': { /* * Read escaped char. */ char nextChar = iterator.next(); switch (nextChar) { case CharacterIterator.DONE: break token_reader; case '\n': // Ignore newline. Both lines are concatenated. continue token_reader; default: // Add the character, but remove the escape buffer.append(nextChar); continue token_reader; } } default: /* * Any other char, add to the buffer. */ buffer.append(tokenChar); continue token_reader; } } result.add(buffer.toString()); } return result; } private final List tokens; /** * Create a command line representation from an array of strings. The first * element of the list is assumed to be the command, the remaining, the * arguments. The elements are not parsed not (un)escaped., but taked as the * are. * */ public ArgumentParser(List tokenList) { this.tokens = new ArrayList(tokenList); } /** * Create a command line representation from the string with a shell command * line. The command line is parsed and split on spaces. Quoted or escaped * spaces are preserved.. * */ public ArgumentParser(String commandline) { this.tokens = parseCommandline(commandline); } /** * Create a command line representation from an array of strings. The first * element of the array is assumed to be the command, the remaining, the * arguments. The elements are not parsed not (un)escaped., but taked as the * are. * */ public ArgumentParser(String tokenArray[]) { this(Arrays.asList(tokenArray)); } /** * Create a command line representation from the command and an list of * parameters. The elements are not parsed not (un)escaped., but taked as * the are. * */ public ArgumentParser(String command, List parameterList) { this.tokens = new ArrayList(); this.tokens.add(command); this.tokens.addAll(parameterList); } /** * Create a command line representation from the command and an array of * parameters. The elements are not parsed not (un)escaped., but taked as * the are. * */ public ArgumentParser(String command, String parameterArray[]) { this(command, Arrays.asList(parameterArray)); } private StringBuffer escapeToken(String token, boolean fullEscape) { StringBuffer buffer = new StringBuffer(); StringCharacterIterator iter = new StringCharacterIterator(token); for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) { if (Character.isWhitespace(c)) { buffer.append('\\'); buffer.append(c); continue; } switch (c) { case '(': case ')': case '[': case ']': case '{': case '}': case '|': case '\\': case '*': case '&': case '^': case '%': case '$': case '#': case '@': case '!': case '~': case '`': case '\'': case '"': case ':': case ';': case '?': case '>': case '<': case '\n': if (fullEscape) { buffer.append('\\'); } buffer.append(c); continue; case ' ': buffer.append('\\'); buffer.append(c); continue; default: buffer.append(c); continue; } } return buffer; } /** * Returns the command of the command line, assuming that the first entry is * always the command. * * @return The command or null if the command lines has no command nor * arguments. */ public String getCommand() { if (this.tokens.size() == 0) { return null; } return this.tokens.get(0); } /** * Convert all tokens in a full command line that can be executed in a * shell. * * @param fullEscape * If every special character shall be escaped. If false, only * white spaces are escaped and the shell will interpret the * special chars. If true, then all special chars are quoted. */ public String getCommandLine(boolean fullEscape) { StringBuffer buffer = new StringBuffer(); Iterator iterator = this.tokens.iterator(); boolean first = true; while (iterator.hasNext()) { String token = iterator.next(); if (!first) { buffer.append(' '); } else { first = false; } buffer.append(escapeToken(token, fullEscape)); } return buffer.toString(); } /** * Returns the command of the command line, assuming that the first entry is * always the command. * * @return The command or null if the command lines has no command nor * arguments. * @param fullEscape * If every special character shall be escaped. If false, only * white spaces are escaped and the shell will interpret the * special chars. If true, then all special chars are quoted. */ public String getEscapedCommand(boolean fullEscalpe) { if (this.tokens.size() == 0) { return null; } return escapeToken(this.tokens.get(0), fullEscalpe).toString(); } /** * Returns a list of all arguments, assuming that the first entry is the * command name. * * @return The Array or null if the command lines has no command nor * arguments. */ public String[] getParameterArray() { if (this.tokens.size() == 0) { return null; } return this.tokens.subList(1, this.tokens.size()).toArray(new String[this.tokens.size() - 1]); } /** * Returns a list of all arguments, assuming that the first entry is the * command name. * * @return The List or null if the command lines has no command nor * arguments. */ public List getParameterList() { if (this.tokens.size() == 0) { return null; } return new ArrayList(this.tokens.subList(1, this.tokens.size())); } /** * Returns the total number of entries. * * @return */ public int getSize() { return this.tokens.size(); } /** * Returns a List of all entries of the command line. * * @return The Array */ public String[] getTokenArray() { return this.tokens.toArray(new String[this.tokens.size()]); } /** * Returns a List of all entries of the command line. * * @return The List */ public List getTokenList() { return new ArrayList(this.tokens); } /** * Returns a representation of the command line for debug purposes. */ @Override public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("<"); //$NON-NLS-1$ Iterator iterator = this.tokens.iterator(); boolean first = true; while (iterator.hasNext()) { String token = iterator.next(); if (!first) { buffer.append('\n'); } else { first = false; } buffer.append(token); } buffer.append(">"); //$NON-NLS-1$ return buffer.toString(); } } JSchCommandShellService.java000066400000000000000000000034301272114001700417250ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.jsch.core; import java.io.IOException; import org.eclipse.remote.core.IRemoteCommandShellService; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteProcess; public class JSchCommandShellService implements IRemoteCommandShellService { private IRemoteConnection fRemoteConnection; public JSchCommandShellService(IRemoteConnection remoteConnection) { fRemoteConnection = remoteConnection; } @Override public IRemoteConnection getRemoteConnection() { return fRemoteConnection; } @Override public IRemoteProcess getCommandShell(int flags) throws IOException { return new JSchProcessBuilder(getRemoteConnection()).start(flags); } public static class Factory implements IRemoteConnection.Service.Factory { /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection.Service.Factory#getService(org.eclipse.remote.core.IRemoteConnection, * java.lang.Class) */ @Override @SuppressWarnings("unchecked") public T getService(IRemoteConnection connection, Class service) { if (IRemoteCommandShellService.class.equals(service)) { return (T) new JSchCommandShellService(connection); } return null; } } } JSchConnection.java000066400000000000000000001124361272114001700401440ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/******************************************************************************* * Copyright (c) 2007, 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation * Patrick Tasse - [462418] use stored password on non-preferred password based authentication * Martin Oberhuber - [468889] Support Eclipse older than Mars *******************************************************************************/ package org.eclipse.remote.internal.jsch.core; import java.net.PasswordAuthentication; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.jsch.core.IJSchService; import org.eclipse.osgi.util.NLS; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionChangeListener; import org.eclipse.remote.core.IRemoteConnectionControlService; import org.eclipse.remote.core.IRemoteConnectionHostService; import org.eclipse.remote.core.IRemoteConnectionPropertyService; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.IRemotePortForwardingService; import org.eclipse.remote.core.IRemoteProcessBuilder; import org.eclipse.remote.core.IRemoteProcessService; import org.eclipse.remote.core.IUserAuthenticatorService; import org.eclipse.remote.core.RemoteConnectionChangeEvent; import org.eclipse.remote.core.RemoteServicesUtils; import org.eclipse.remote.core.exception.AddressInUseException; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.core.exception.UnableToForwardPortException; import org.eclipse.remote.internal.jsch.core.commands.ExecCommand; import org.eclipse.remote.internal.jsch.core.messages.Messages; import com.jcraft.jsch.Channel; import com.jcraft.jsch.ChannelExec; import com.jcraft.jsch.ChannelSftp; import com.jcraft.jsch.ChannelShell; import com.jcraft.jsch.JSchException; import com.jcraft.jsch.Session; import com.jcraft.jsch.UIKeyboardInteractive; import com.jcraft.jsch.UserInfo; /** * @since 5.0 */ public class JSchConnection implements IRemoteConnectionControlService, IRemoteConnectionPropertyService, IRemotePortForwardingService, IRemoteProcessService, IRemoteConnectionHostService, IRemoteConnectionChangeListener { // Connection Type ID public static final String JSCH_ID = "org.eclipse.remote.JSch"; //$NON-NLS-1$ // Attributes public static final String ADDRESS_ATTR = "JSCH_ADDRESS_ATTR"; //$NON-NLS-1$ public static final String USERNAME_ATTR = "JSCH_USERNAME_ATTR"; //$NON-NLS-1$ public static final String PASSWORD_ATTR = "JSCH_PASSWORD_ATTR"; //$NON-NLS-1$ public static final String PORT_ATTR = "JSCH_PORT_ATTR"; //$NON-NLS-1$ public static final String PROXYCONNECTION_ATTR = "JSCH_PROXYCONNECTION_ATTR"; //$NON-NLS-1$ public static final String PROXYCOMMAND_ATTR = "JSCH_PROXYCOMMAND_ATTR"; //$NON-NLS-1$ public static final String IS_PASSWORD_ATTR = "JSCH_IS_PASSWORD_ATTR"; //$NON-NLS-1$ public static final String PASSPHRASE_ATTR = "JSCH_PASSPHRASE_ATTR"; //$NON-NLS-1$ public static final String TIMEOUT_ATTR = "JSCH_TIMEOUT_ATTR"; //$NON-NLS-1$ public static final String USE_LOGIN_SHELL_ATTR = "JSCH_USE_LOGIN_SHELL_ATTR"; //$NON-NLS-1$ public static final String LOGIN_SHELL_COMMAND_ATTR = "JSCH_LOGIN_SHELL_COMMAND_ATTR"; //$NON-NLS-1$ /** * Class to supply credentials from connection attributes without user interaction. */ private class JSchUserInfo implements UserInfo, UIKeyboardInteractive { private boolean firstTryPassphrase = true; /* * (non-Javadoc) * * @see com.jcraft.jsch.UserInfo#getPassphrase() */ @Override public String getPassphrase() { if (logging) { System.out.println("getPassphrase"); //$NON-NLS-1$ } return JSchConnection.this.getPassphrase(); } /* * (non-Javadoc) * * @see com.jcraft.jsch.UserInfo#getPassword() */ @Override public String getPassword() { if (logging) { System.out.println("getPassword"); //$NON-NLS-1$ } return JSchConnection.this.getPassword(); } /* * (non-Javadoc) * * @see com.jcraft.jsch.UIKeyboardInteractive#promptKeyboardInteractive(java.lang.String, java.lang.String, * java.lang.String, java.lang.String[], boolean[]) */ @Override public String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt, boolean[] echo) { if (logging) { System.out.println("promptKeyboardInteractive:" + destination + ":" + name + ":" + instruction); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ for (String p : prompt) { System.out.println(" " + p); //$NON-NLS-1$ } } IUserAuthenticatorService authService = fRemoteConnection.getService(IUserAuthenticatorService.class); if (authService != null) { String[] result = authService.prompt(destination, name, instruction, prompt, echo); if (result != null) { if (prompt.length == 1 && prompt[0].trim().equalsIgnoreCase("password:")) { //$NON-NLS-1$ IRemoteConnectionWorkingCopy wc = fRemoteConnection.getWorkingCopy(); wc.setSecureAttribute(PASSWORD_ATTR, result[0]); try { wc.save(); } catch (RemoteConnectionException e) { Activator.log(e.getStatus()); } } } return result; } return null; } /* * (non-Javadoc) * * @see com.jcraft.jsch.UserInfo#promptPassphrase(java.lang.String) */ @Override public boolean promptPassphrase(String message) { if (logging) { System.out.println("promptPassphrase:" + message); //$NON-NLS-1$ } if (firstTryPassphrase && !getPassphrase().equals("")) { //$NON-NLS-1$ firstTryPassphrase = false; return true; } IUserAuthenticatorService authService = fRemoteConnection.getService(IUserAuthenticatorService.class); if (authService != null) { PasswordAuthentication auth = authService.prompt(getUsername(), message); if (auth == null) { return false; } IRemoteConnectionWorkingCopy wc = fRemoteConnection.getWorkingCopy(); wc.setAttribute(USERNAME_ATTR, auth.getUserName()); wc.setSecureAttribute(PASSPHRASE_ATTR, new String(auth.getPassword())); try { wc.save(); } catch (RemoteConnectionException e) { Activator.log(e.getStatus()); } return true; } return false; } /* * (non-Javadoc) * * @see com.jcraft.jsch.UserInfo#promptPassword(java.lang.String) */ @Override public boolean promptPassword(String message) { if (logging) { System.out.println("promptPassword:" + message); //$NON-NLS-1$ } IUserAuthenticatorService authService = fRemoteConnection.getService(IUserAuthenticatorService.class); if (authService != null) { PasswordAuthentication auth = authService.prompt(getUsername(), message); if (auth == null) { return false; } IRemoteConnectionWorkingCopy wc = fRemoteConnection.getWorkingCopy(); wc.setAttribute(USERNAME_ATTR, auth.getUserName()); wc.setSecureAttribute(PASSWORD_ATTR, new String(auth.getPassword())); try { wc.save(); } catch (RemoteConnectionException e) { Activator.log(e.getStatus()); } return true; } return false; } /* * (non-Javadoc) * * @see com.jcraft.jsch.UserInfo#promptYesNo(java.lang.String) */ @Override public boolean promptYesNo(String message) { if (logging) { System.out.println("promptYesNo:" + message); //$NON-NLS-1$ } IUserAuthenticatorService authService = fRemoteConnection.getService(IUserAuthenticatorService.class); if (authService != null) { int prompt = authService.prompt(IUserAuthenticatorService.QUESTION, Messages.AuthInfo_Authentication_message, message, new int[] { IUserAuthenticatorService.YES, IUserAuthenticatorService.NO }, IUserAuthenticatorService.YES); return prompt == IUserAuthenticatorService.YES; } return true; } /* * (non-Javadoc) * * @see com.jcraft.jsch.UserInfo#showMessage(java.lang.String) */ @Override public void showMessage(String message) { if (logging) { System.out.println("showMessage:" + message); //$NON-NLS-1$ } IUserAuthenticatorService authService = fRemoteConnection.getService(IUserAuthenticatorService.class); if (authService != null) { authService.prompt(IUserAuthenticatorService.INFORMATION, Messages.AuthInfo_Authentication_message, message, new int[] { IUserAuthenticatorService.OK }, IUserAuthenticatorService.OK); } } } private final boolean logging = false; public static final int DEFAULT_PORT = 22; public static final int DEFAULT_TIMEOUT = 0; public static final boolean DEFAULT_IS_PASSWORD = false; public static final boolean DEFAULT_USE_LOGIN_SHELL = true; public static final String DEFAULT_LOGIN_SHELL_COMMAND = "/bin/bash -l -c '{0}'"; //$NON-NLS-1$ public static final String EMPTY_STRING = ""; //$NON-NLS-1$ private String fWorkingDir; private final IRemoteConnection fRemoteConnection; private final IJSchService fJSchService; private final Map fEnv = new HashMap<>(); private final Map fProperties = new HashMap<>(); private final List fSessions = new ArrayList<>(); private ChannelSftp fSftpCommandChannel; private boolean isFullySetup; // including sftp channel and environment private static final Map connectionMap = new HashMap<>(); public JSchConnection(IRemoteConnection connection) { fRemoteConnection = connection; fJSchService = Activator.getDefault().getService(); connection.addConnectionChangeListener(this); } @Override public void connectionChanged(RemoteConnectionChangeEvent event) { if (event.getType() == RemoteConnectionChangeEvent.CONNECTION_REMOVED) { synchronized (connectionMap) { connectionMap.remove(event.getConnection()); } } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection.Service#getRemoteConnection() */ @Override public IRemoteConnection getRemoteConnection() { return fRemoteConnection; } public static class Factory implements IRemoteConnection.Service.Factory { /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnection.Service.Factory#getService(org.eclipse.remote.core.IRemoteConnection, * java.lang.Class) */ @Override @SuppressWarnings("unchecked") public T getService(IRemoteConnection connection, Class service) { // This little trick creates an instance of this class for a connection // then for each interface it implements, it returns the same object. // This works because the connection caches the service so only one gets created. // As a side effect, it makes this class a service too which can be used // by the this plug-in if (JSchConnection.class.equals(service)) { synchronized (connectionMap) { JSchConnection jschConnection = connectionMap.get(connection); if (jschConnection == null) { jschConnection = new JSchConnection(connection); connectionMap.put(connection, jschConnection); } return (T) jschConnection; } } else if (IRemoteConnectionControlService.class.equals(service) || IRemoteConnectionPropertyService.class.equals(service) || IRemotePortForwardingService.class.equals(service) || IRemoteProcessService.class.equals(service) || IRemoteConnectionHostService.class.equals(service)) { return (T) connection.getService(JSchConnection.class); } else { return null; } } } private boolean checkConfiguration(Session session, IProgressMonitor monitor) throws RemoteConnectionException { SubMonitor subMon = SubMonitor.convert(monitor, 10); ChannelSftp sftp; try { /* * First, check if sftp is supported at all. This is required for EFS, so throw exception if not supported. */ sftp = openSftpChannel(session); } catch (RemoteConnectionException e) { throw new RemoteConnectionException(Messages.JSchConnection_Remote_host_does_not_support_sftp); } /* * While sftp channel is open, try opening an exec channel. If it doesn't succeed, then MaxSession is < 2 so we need at * least one additional session. */ try { loadEnv(subMon.newChild(10)); } catch (RemoteConnectionException e) { if (e.getMessage().contains("channel is not opened")) { //$NON-NLS-1$ return false; } } finally { if (sftp != null) { sftp.disconnect(); } } return true; } /** * @throws RemoteConnectionException */ private void checkIsConfigured() throws RemoteConnectionException { if (fRemoteConnection.getAttribute(ADDRESS_ATTR) == null) { throw new RemoteConnectionException(Messages.JSchConnection_remote_address_must_be_set); } if (fRemoteConnection.getAttribute(USERNAME_ATTR) == null) { throw new RemoteConnectionException(Messages.JSchConnection_username_must_be_set); } } private synchronized void cleanup() { if (fSftpCommandChannel != null) { if (fSftpCommandChannel.isConnected()) { fSftpCommandChannel.disconnect(); } fSftpCommandChannel = null; } for (Session session : fSessions) { if (session.isConnected()) { session.disconnect(); } } fSessions.clear(); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionControlService#close() */ @Override public synchronized void close() { cleanup(); fRemoteConnection.fireConnectionChangeEvent(RemoteConnectionChangeEvent.CONNECTION_CLOSED); } /** * Execute the command and return the result as a string. * * @param cmd * command to execute * @param monitor * progress monitor * @return result of command * @throws RemoteConnectionException */ private String executeCommand(String cmd, IProgressMonitor monitor) throws RemoteConnectionException { ExecCommand exec = new ExecCommand(this); monitor.subTask(NLS.bind(Messages.JSchConnection_Executing_command, cmd)); return exec.setCommand(cmd).getResult(monitor).trim(); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemotePortForwardingService#forwardLocalPort(int, java.lang.String, int) */ @Override public void forwardLocalPort(int localPort, String fwdAddress, int fwdPort) throws RemoteConnectionException { if (!isOpen()) { throw new RemoteConnectionException(Messages.JSchConnection_connectionNotOpen); } try { fSessions.get(0).setPortForwardingL(localPort, fwdAddress, fwdPort); } catch (JSchException e) { throw new RemoteConnectionException(e.getMessage()); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemotePortForwardingService#forwardLocalPort(java.lang.String, int, * org.eclipse.core.runtime.IProgressMonitor) */ @Override public int forwardLocalPort(String fwdAddress, int fwdPort, IProgressMonitor monitor) throws RemoteConnectionException { if (!isOpen()) { throw new RemoteConnectionException(Messages.JSchConnection_connectionNotOpen); } SubMonitor progress = SubMonitor.convert(monitor, 10); progress.beginTask(Messages.JSchConnection_forwarding, 10); /* * Start with a different port number, in case we're doing this all on localhost. */ int localPort = fwdPort + 1; /* * Try to find a free port on the remote machine. This take a while, so allow it to be canceled. If we've tried all * ports (which could take a very long while) then bail out. */ while (!progress.isCanceled()) { try { forwardLocalPort(localPort, fwdAddress, fwdPort); } catch (AddressInUseException e) { if (++localPort == fwdPort) { throw new UnableToForwardPortException(Messages.JSchConnection_remotePort); } progress.worked(1); } return localPort; } return -1; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemotePortForwardingService#forwardRemotePort(int, java.lang.String, int) */ @Override public void forwardRemotePort(int remotePort, String fwdAddress, int fwdPort) throws RemoteConnectionException { if (!isOpen()) { throw new RemoteConnectionException(Messages.JSchConnection_connectionNotOpen); } try { fSessions.get(0).setPortForwardingR(remotePort, fwdAddress, fwdPort); } catch (JSchException e) { throw new RemoteConnectionException(e.getMessage()); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemotePortForwardingService#forwardRemotePort(java.lang.String, int, * org.eclipse.core.runtime.IProgressMonitor) */ @Override public int forwardRemotePort(String fwdAddress, int fwdPort, IProgressMonitor monitor) throws RemoteConnectionException { if (!isOpen()) { throw new RemoteConnectionException(Messages.JSchConnection_connectionNotOpen); } SubMonitor progress = SubMonitor.convert(monitor, 10); progress.beginTask(Messages.JSchConnection_forwarding, 10); /* * Start with a different port number, in case we're doing this all on localhost. */ int remotePort = fwdPort + 1; /* * Try to find a free port on the remote machine. This take a while, so allow it to be canceled. If we've tried all * ports (which could take a very long while) then bail out. */ while (!progress.isCanceled()) { try { forwardRemotePort(remotePort, fwdAddress, fwdPort); return remotePort; } catch (AddressInUseException e) { if (++remotePort == fwdPort) { throw new UnableToForwardPortException(Messages.JSchConnection_remotePort); } progress.worked(1); } } return -1; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionHostService#getHostname() */ @Override public String getHostname() { return fRemoteConnection.getAttribute(ADDRESS_ATTR); } /** * Get the result of executing a pwd command. * * @return current working directory */ private String getCwd(IProgressMonitor monitor) { SubMonitor subMon = SubMonitor.convert(monitor, 10); try { return executeCommand("pwd", subMon.newChild(10)); //$NON-NLS-1$ } catch (RemoteConnectionException e) { // Ignore } return null; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcessService#getEnv() */ @Override public Map getEnv() { return Collections.unmodifiableMap(fEnv); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcessService#getEnv(java.lang.String) */ @Override public String getEnv(String name) { return getEnv().get(name); } /** * Open an exec channel to the remote host. * * @return exec channel or null if the progress monitor was cancelled * * @throws RemoteConnectionException * if a channel could not be opened */ public ChannelExec getExecChannel() throws RemoteConnectionException { try { return (ChannelExec) fSessions.get(0).openChannel("exec"); //$NON-NLS-1$ } catch (JSchException e) { throw new RemoteConnectionException(e.getMessage()); } } /** * Open a shell channel to the remote host. * * @return shell channel or null if the progress monitor was cancelled * * @throws RemoteConnectionException * if a channel could not be opened */ public ChannelShell getShellChannel() throws RemoteConnectionException { try { return (ChannelShell) fSessions.get(0).openChannel("shell"); //$NON-NLS-1$ } catch (JSchException e) { throw new RemoteConnectionException(e.getMessage()); } } public String getPassphrase() { return fRemoteConnection.getSecureAttribute(PASSPHRASE_ATTR); } public String getPassword() { return fRemoteConnection.getSecureAttribute(PASSWORD_ATTR); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionHostService#getPort() */ @Override public int getPort() { String portStr = fRemoteConnection.getAttribute(PORT_ATTR); return !portStr.isEmpty() ? Integer.parseInt(portStr) : DEFAULT_PORT; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcessService#getProcessBuilder(java.util.List) */ @Override public IRemoteProcessBuilder getProcessBuilder(List command) { if (!isOpen()) { return null; } return new JSchProcessBuilder(getRemoteConnection(), command); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcessService#getProcessBuilder(java.lang.String[]) */ @Override public IRemoteProcessBuilder getProcessBuilder(String... command) { if (!isOpen()) { return null; } return new JSchProcessBuilder(getRemoteConnection(), command); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionPropertyService#getProperty(java.lang.String) */ @Override public String getProperty(String key) { return fProperties.get(key); } /** * Get the login shell command if useLoginShell is true * * @return login shell command */ public String getLoginShellCommand() { String loginShell = fRemoteConnection.getAttribute(LOGIN_SHELL_COMMAND_ATTR); return loginShell.isEmpty() ? DEFAULT_LOGIN_SHELL_COMMAND : loginShell; } /** * Gets the proxy command. For no proxy command null is returned. * * @return proxy command */ public String getProxyCommand() { return fRemoteConnection.getAttribute(PROXYCOMMAND_ATTR); } /** * Gets the proxy connection. If no proxy connection is used it returns null. * * @return proxy connection */ public JSchConnection getProxyConnection() { String proxyConnectionName = getProxyConnectionName(); if (proxyConnectionName.isEmpty()) { return null; } return fRemoteConnection.getConnectionType().getConnection(proxyConnectionName).getService(JSchConnection.class); } /** * Gets the proxy connection name * * @return proxy connection name. If no proxy is used returns null. */ public String getProxyConnectionName() { return fRemoteConnection.getAttribute(PROXYCONNECTION_ATTR); } /** * Open an sftp command channel to the remote host. This channel is for commands that do not require any * state being preserved and should not be closed. Long running commands (such as get/put) should use a separate channel * obtained via {#link #newSftpChannel()}. * * Always use the second session if available. * * @return sftp channel * @throws RemoteConnectionException * if a channel could not be opened */ public ChannelSftp getSftpCommandChannel() throws RemoteConnectionException { if (fSftpCommandChannel == null || fSftpCommandChannel.isClosed()) { fSftpCommandChannel = newSftpChannel(); } return fSftpCommandChannel; } /** * Open a channel for long running commands. This channel should be closed when the command is completed. * * @return sftp channel * @throws RemoteConnectionException * if a channel could not be opened */ public ChannelSftp newSftpChannel() throws RemoteConnectionException { Session session = fSessions.get(0); if (fSessions.size() > 1) { session = fSessions.get(1); } ChannelSftp channel = openSftpChannel(session); if (channel == null) { throw new RemoteConnectionException(Messages.JSchConnection_Unable_to_open_sftp_channel); } return channel; } public Channel getStreamForwarder(String host, int port) throws RemoteConnectionException { try { Channel channel = fSessions.get(0).getStreamForwarder(host, port); channel.connect(); return channel; } catch (JSchException e) { throw new RemoteConnectionException(e); } } @Override public int getTimeout() { String str = fRemoteConnection.getAttribute(TIMEOUT_ATTR); return !str.isEmpty() ? Integer.parseInt(str) : DEFAULT_TIMEOUT; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionHostService#getUsername() */ @Override public String getUsername() { return fRemoteConnection.getAttribute(USERNAME_ATTR); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcessService#getWorkingDirectory() */ @Override public String getWorkingDirectory() { if (!isOpen()) { return "/"; //$NON-NLS-1$ } if (fWorkingDir == null) { return "/"; //$NON-NLS-1$ } return fWorkingDir; } /** * Test if the connection has a valid open session. Doesn't check whether the connection is fully setup. * * @return true if a valid session is available. */ public boolean hasOpenSession() { boolean hasOpenSession = fSessions.size() > 0; if (hasOpenSession) { for (Session session : fSessions) { hasOpenSession &= session.isConnected(); } } if (!hasOpenSession) { cleanup(); // Cleanup if session is closed } return hasOpenSession; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionControlService#isOpen() */ @Override public boolean isOpen() { return hasOpenSession() && isFullySetup; } public boolean isPasswordAuth() { String str = fRemoteConnection.getAttribute(IS_PASSWORD_ATTR); return !str.isEmpty() ? Boolean.parseBoolean(str) : DEFAULT_IS_PASSWORD; } private void loadEnv(IProgressMonitor monitor) throws RemoteConnectionException { SubMonitor subMon = SubMonitor.convert(monitor, 10); String env = executeCommand("printenv", subMon.newChild(10)); //$NON-NLS-1$ String[] vars = env.split("\n"); //$NON-NLS-1$ for (String var : vars) { String[] kv = var.split("="); //$NON-NLS-1$ if (kv.length == 2) { fEnv.put(kv[0], kv[1]); } } } /** * * Load the following hard-coded properties at runtime: * *
*
file.separator *
File separator character of the (remote) connection. Hardcoded "/" (forward slash). *
path.separator *
Path separator character of the (remote) connection. Hardcoded ":" (colon). *
line.separator *
Line separator character of the (remote) connection. Hardcoded "\n" (new-line). *
user.home *
User home directory on the (remote) connection. *
os.name *
Operating system name of the (remote) connection. For example, given results from the "uname" command: *
    *
  • Linux
  • *
  • AIX
  • *
  • Mac OS X - if results equal "Darwin" then results from "sw_vers -productName"
  • *
  • everything else - results from "uname" command
  • *
*
os.version *
Operating system version of the (remote) connection. For example: *
    *
  • For Linux - results from "uname -r" such as "2.6.32-279.2.1.el6.x86_64"
  • *
  • For AIX - results from "oslevel" such as "7.1.0.0"
  • *
  • For Mac OS X - results from "sw_vers -productVersion" such as "10.8.3"
  • *
  • For everything else - "unknown"
  • *
*
os.arch *
Machine architecture of the (remote) connection. For example: *
    *
  • For Linux - results from "uname -m" such as "x86_64"
  • *
  • For AIX - if results from "uname -p" equals "powerpc" *
      *
    • then if "prtconf -k" contains "64-bit" then "ppc64" else "ppc"
    • *
    • else the result from "uname -p"
    • *
    *
  • *
  • For Mac OS X - if results from "uname -m" equals "i386" *
      *
    • then if results from "sysctl -n hw.optional.x86_64" equals "1" then "x86_64" else the results from "uname -m"
    • *
    • else the results from "uname -m"
    • *
    *
  • *
  • For everything else - "unknown"
  • *
*
* */ private void loadProperties(IProgressMonitor monitor) throws RemoteConnectionException { SubMonitor subMon = SubMonitor.convert(monitor, 100); fProperties.put(IRemoteConnection.FILE_SEPARATOR_PROPERTY, "/"); //$NON-NLS-1$ fProperties.put(IRemoteConnection.PATH_SEPARATOR_PROPERTY, ":"); //$NON-NLS-1$ fProperties.put(IRemoteConnection.LINE_SEPARATOR_PROPERTY, "\n"); //$NON-NLS-1$ fProperties.put(IRemoteConnection.USER_HOME_PROPERTY, getWorkingDirectory()); String osVersion; String osArch; String encoding; String osName = executeCommand("uname", subMon.newChild(10)); //$NON-NLS-1$ switch (osName.toLowerCase()) { case "linux": //$NON-NLS-1$ osArch = executeCommand("uname -m", subMon.newChild(10)); //$NON-NLS-1$ osVersion = executeCommand("uname -r", subMon.newChild(10)); //$NON-NLS-1$ encoding = executeCommand("locale charmap", subMon.newChild(10)); //$NON-NLS-1$ break; case "darwin": //$NON-NLS-1$ osName = executeCommand("sw_vers -productName", subMon.newChild(10)); //$NON-NLS-1$ osVersion = executeCommand("sw_vers -productVersion", subMon.newChild(10)); //$NON-NLS-1$ osArch = executeCommand("uname -m", subMon.newChild(10)); //$NON-NLS-1$ if (osArch.equalsIgnoreCase("i386")) { //$NON-NLS-1$ String opt = executeCommand("sysctl -n hw.optional.x86_64", subMon.newChild(10)); //$NON-NLS-1$ if (opt.equals("1")) { //$NON-NLS-1$ osArch = "x86_64"; //$NON-NLS-1$ } } encoding = executeCommand("locale charmap", subMon.newChild(10)); //$NON-NLS-1$ break; case "aix": //$NON-NLS-1$ osArch = executeCommand("uname -p", subMon.newChild(10)); //$NON-NLS-1$ osVersion = executeCommand("oslevel", subMon.newChild(10)); //$NON-NLS-1$ if (osArch.equalsIgnoreCase("powerpc")) { //$NON-NLS-1$ /* Make the architecture match what Linux produces: either ppc or ppc64 */ osArch = "ppc"; //$NON-NLS-1$ /* Get Kernel type either 32-bit or 64-bit */ String opt = executeCommand("prtconf -k", subMon.newChild(10)); //$NON-NLS-1$ if (opt.indexOf("64-bit") > 0) { //$NON-NLS-1$ osArch += "64"; //$NON-NLS-1$ } } encoding = executeCommand("locale charmap", subMon.newChild(10)); //$NON-NLS-1$ break; case "qnx": //$NON-NLS-1$ osArch = executeCommand("uname -p", subMon.newChild(10)); //$NON-NLS-1$ osVersion = executeCommand("uname -r", subMon.newChild(10)); //$NON-NLS-1$ encoding = "UTF-8"; //$NON-NLS-1$ break; default: osVersion = "unknown"; //$NON-NLS-1$ osArch = "unknown"; //$NON-NLS-1$ encoding = "unknown"; //$NON-NLS-1$ break; } fProperties.put(IRemoteConnection.OS_NAME_PROPERTY, osName); fProperties.put(IRemoteConnection.OS_VERSION_PROPERTY, osVersion); fProperties.put(IRemoteConnection.OS_ARCH_PROPERTY, osArch); fProperties.put(IRemoteConnection.LOCALE_CHARMAP_PROPERTY, encoding); } private Session newSession(IProgressMonitor monitor) throws RemoteConnectionException { SubMonitor progress = SubMonitor.convert(monitor, 10); try { Session session = fJSchService.createSession(getHostname(), getPort(), getUsername()); session.setUserInfo(new JSchUserInfo()); if (isPasswordAuth()) { session.setConfig("PreferredAuthentications", "password,keyboard-interactive,gssapi-with-mic,publickey"); //$NON-NLS-1$ //$NON-NLS-2$ } else { session.setConfig("PreferredAuthentications", "publickey,gssapi-with-mic,password,keyboard-interactive"); //$NON-NLS-1$ //$NON-NLS-2$ } String password = getPassword(); if (!password.isEmpty()) { session.setPassword(password); } if (getProxyCommand().isEmpty() && getProxyConnectionName().isEmpty()) { fJSchService.connect(session, getTimeout() * 1000, progress.newChild(10)); // connect without proxy } else { if (getProxyCommand().isEmpty()) { session.setProxy(JSchConnectionProxyFactory.createForwardProxy(getProxyConnection(), progress.newChild(10))); fJSchService.connect(session, getTimeout() * 1000, progress.newChild(10)); } else { session.setProxy(JSchConnectionProxyFactory.createCommandProxy(getProxyConnection(), getProxyCommand(), progress.newChild(10))); session.connect(getTimeout() * 1000); // the fJSchService doesn't pass the timeout correctly } } if (!progress.isCanceled()) { fSessions.add(session); return session; } return null; } catch (OperationCanceledException e) { throw new RemoteConnectionException(Messages.JSchConnection_0); } catch (JSchException e) { throw new RemoteConnectionException(e.getMessage()); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteConnectionControlService#open(org.eclipse.core.runtime.IProgressMonitor) */ @Override public void open(IProgressMonitor monitor) throws RemoteConnectionException { open(monitor, true); } /** * Open ssh connection without full setup (environment, sftp) * * @see org.eclipse.remote.core.IRemoteConnection#open() * * @param monitor * @throws RemoteConnectionException */ public void openMinimal(IProgressMonitor monitor) throws RemoteConnectionException { open(monitor, false); } /** * @see org.eclipse.remote.core.IRemoteConnection#open() * * @param monitor * @param setupFully * open a full featured connection (environment query and sftp) * @throws RemoteConnectionException */ private void open(IProgressMonitor monitor, boolean setupFully) throws RemoteConnectionException { SubMonitor subMon = SubMonitor.convert(monitor, 60); if (!hasOpenSession()) { checkIsConfigured(); newSession(subMon.newChild(10)); if (subMon.isCanceled()) { throw new RemoteConnectionException(Messages.JSchConnection_Connection_was_cancelled); } isFullySetup = false; } if (setupFully && !isFullySetup) { // happens on the first open with setupFully==true, which might not be the first open isFullySetup = true; // getCwd checks the exec channel before checkConfiguration checks the sftp channel fWorkingDir = getCwd(subMon.newChild(10)); try { if (!checkConfiguration(fSessions.get(0), subMon.newChild(20))) { newSession(subMon.newChild(10)); loadEnv(subMon.newChild(10)); } } catch (RemoteConnectionException e) { // Do not throw exception now, it will be thrown if FileService is accessed. } loadProperties(subMon.newChild(10)); fRemoteConnection.fireConnectionChangeEvent(RemoteConnectionChangeEvent.CONNECTION_OPENED); } } private ChannelSftp openSftpChannel(Session session) throws RemoteConnectionException { try { ChannelSftp channel = (ChannelSftp) session.openChannel("sftp"); //$NON-NLS-1$ channel.connect(); return channel; } catch (JSchException e) { throw new RemoteConnectionException(e.getMessage()); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemotePortForwardingService#removeLocalPortForwarding(int) */ @Override public void removeLocalPortForwarding(int port) throws RemoteConnectionException { if (!isOpen()) { throw new RemoteConnectionException(Messages.JSchConnection_connectionNotOpen); } try { fSessions.get(0).delPortForwardingL(port); } catch (JSchException e) { throw new RemoteConnectionException(e.getMessage()); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemotePortForwardingService#removeRemotePortForwarding(int) */ @Override public void removeRemotePortForwarding(int port) throws RemoteConnectionException { if (!isOpen()) { throw new RemoteConnectionException(Messages.JSchConnection_connectionNotOpen); } try { fSessions.get(0).delPortForwardingR(port); } catch (JSchException e) { throw new RemoteConnectionException(e.getMessage()); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcessService#setWorkingDirectory(java.lang.String) */ @Override public void setWorkingDirectory(String path) { if (RemoteServicesUtils.posixPath(path).isAbsolute()) { fWorkingDir = path; } } @Override public boolean useLoginShell() { String str = fRemoteConnection.getAttribute(USE_LOGIN_SHELL_ATTR); return !str.isEmpty() ? Boolean.parseBoolean(str) : DEFAULT_USE_LOGIN_SHELL; } @Override public void setHostname(String hostname) { if (fRemoteConnection instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) fRemoteConnection; wc.setAttribute(ADDRESS_ATTR, hostname); } } @Override public void setPassphrase(String passphrase) { if (fRemoteConnection instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) fRemoteConnection; wc.setSecureAttribute(PASSPHRASE_ATTR, passphrase); } } @Override public void setPassword(String password) { if (fRemoteConnection instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) fRemoteConnection; wc.setSecureAttribute(PASSWORD_ATTR, password); } } @Override public void setPort(int port) { if (fRemoteConnection instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) fRemoteConnection; wc.setAttribute(PORT_ATTR, Integer.toString(port)); } } @Override public void setTimeout(int timeout) { if (fRemoteConnection instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) fRemoteConnection; wc.setAttribute(TIMEOUT_ATTR, Integer.toString(timeout)); } } @Override public void setUseLoginShell(boolean useLogingShell) { if (fRemoteConnection instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) fRemoteConnection; wc.setAttribute(USE_LOGIN_SHELL_ATTR, Boolean.toString(useLogingShell)); } } @Override public void setUsePassword(boolean usePassword) { if (fRemoteConnection instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) fRemoteConnection; wc.setAttribute(IS_PASSWORD_ATTR, Boolean.toString(usePassword)); } } @Override public void setUsername(String username) { if (fRemoteConnection instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) fRemoteConnection; wc.setAttribute(USERNAME_ATTR, username); } } } JSchConnectionProxyFactory.java000066400000000000000000000213761272114001700425400ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/******************************************************************************* * Copyright (c) 2014 University of Tennessee and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * University of Tennessee (Roland Schulz) - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.jsch.core; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.Socket; import java.text.MessageFormat; import java.util.List; import org.eclipse.core.runtime.ILog; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.remote.core.IRemoteProcess; import org.eclipse.remote.core.IRemoteProcessService; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.jsch.core.messages.Messages; import com.jcraft.jsch.Channel; import com.jcraft.jsch.Proxy; import com.jcraft.jsch.SocketFactory; /** * Creates a JSch Proxy. Supports both command proxies, as well as the ssh build-in * stream forwarding. * * @author rschulz * */ public class JSchConnectionProxyFactory { private static class CommandProxy implements Proxy { private String command; private IRemoteProcess process; private JSchConnection connection; private final IProgressMonitor monitor; private boolean connectCalled = false; private CommandProxy(JSchConnection connection, String command, IProgressMonitor monitor) { if (command == null || monitor == null) { throw new IllegalArgumentException(); } this.command = command; this.connection = connection; this.monitor = monitor; } /* * (non-Javadoc) * * @see com.jcraft.jsch.Proxy#close() */ @Override public void close() { process.destroy(); } /* * (non-Javadoc) * * @see com.jcraft.jsch.Proxy#connect(com.jcraft.jsch.SocketFactory, java.lang.String, int, int) */ @Override public void connect(SocketFactory socket_factory, String host, int port, int timeout) throws IOException { assert !connectCalled : "connect should only be called once"; //$NON-NLS-1$ connectCalled = true; if (timeout == 0) { timeout = 10000; // default to 10s } final int waitTime = 50; final int waitSteps = timeout / waitTime; SubMonitor subMon = SubMonitor.convert(monitor, waitSteps * 2); final SubMonitor childMon = subMon.newChild(waitSteps); if (connection != null) { // Open connection if it isn't already opened try { connection.openMinimal(childMon); } catch (RemoteConnectionException e) { throw new IOException(e); } } subMon.setWorkRemaining(waitSteps); // Start command command = command.replace("%h", host); //$NON-NLS-1$ command = command.replace("%p", Integer.toString(port)); //$NON-NLS-1$ List cmd = new ArgumentParser(command).getTokenList(); if (connection != null) { JSchProcessBuilder processBuilder = (JSchProcessBuilder) connection.getProcessBuilder(cmd); processBuilder.setPreamble(false); process = processBuilder.start(); } else { process = Activator.getService(IRemoteServicesManager.class).getLocalConnectionType().getConnections().get(0). getService(IRemoteProcessService.class).getProcessBuilder(cmd).start(); } // Wait on command to produce stdout output long endTime = System.currentTimeMillis() + timeout; boolean bOutputAvailable, bProcessComplete, bTimedOut, bCanceled; do { try { Thread.sleep(waitTime); subMon.worked(1); } catch (InterruptedException e) { /* ignore */ } bOutputAvailable = (getInputStream().available() != 0); bProcessComplete = process.isCompleted(); bTimedOut = System.currentTimeMillis() > endTime; bCanceled = subMon.isCanceled(); } while (!bOutputAvailable && !bProcessComplete && !bTimedOut && !bCanceled); // If no output was produced before process died, throw an exception with the stderr output final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getErrorStream())); if (getInputStream().available() == 0 || process.isCompleted()) { String msg = ""; //$NON-NLS-1$ while (bufferedReader.ready()) { msg += (char) bufferedReader.read(); } msg = msg.trim(); if (!process.isCompleted()) { process.destroy(); } String cause = Messages.JSchConnectionProxyFactory_failed; if (bTimedOut) { cause = Messages.JSchConnectionProxyFactory_timedOut; } else if (bCanceled) { cause = Messages.JSchConnectionProxyFactory_wasCanceled; } throw new IOException(MessageFormat.format(Messages.JSchConnectionProxyFactory_ProxyCommandFailed, command, cause, msg)); } // Dump the stderr to log new Thread() { @Override public void run() { final ILog log = Activator.getDefault().getLog(); String line; try { while ((line = bufferedReader.readLine()) != null) { log.log(new Status(IStatus.INFO, Activator.getUniqueIdentifier(), IStatus.OK, line, null)); } } catch (IOException e) { Activator.log(e); } }; }.start(); } /* * (non-Javadoc) * * @see com.jcraft.jsch.Proxy#getInputStream() */ @Override public InputStream getInputStream() { return process.getInputStream(); } /* * (non-Javadoc) * * @see com.jcraft.jsch.Proxy#getOutputStream() */ @Override public OutputStream getOutputStream() { return process.getOutputStream(); } /* * (non-Javadoc) * * @see com.jcraft.jsch.Proxy#getSocket() */ @Override public Socket getSocket() { return null; } } private static class SSHForwardProxy implements Proxy { private Channel channel; private final JSchConnection connection; private final IProgressMonitor monitor; private boolean connectCalled = false; private SSHForwardProxy(JSchConnection proxyConnection, IProgressMonitor monitor) { if (proxyConnection == null || monitor == null) { throw new IllegalArgumentException(); } this.connection = proxyConnection; this.monitor = monitor; } /* * (non-Javadoc) * * @see com.jcraft.jsch.Proxy#close() */ @Override public void close() { channel.disconnect(); } /* * (non-Javadoc) * * @see com.jcraft.jsch.Proxy#connect(com.jcraft.jsch.SocketFactory, java.lang.String, int, int) */ @Override public void connect(SocketFactory socket_factory, String host, int port, int timeout) throws Exception { assert !connectCalled : "connect should only be called once"; //$NON-NLS-1$ try { if (!connection.hasOpenSession()) { try { connection.openMinimal(monitor); } catch (RemoteConnectionException e) { throw new IOException(e); } } channel = connection.getStreamForwarder(host, port); } finally { connectCalled = true; } } /* * (non-Javadoc) * * @see com.jcraft.jsch.Proxy#getInputStream() */ @Override public InputStream getInputStream() { try { return channel.getInputStream(); } catch (IOException e) { Activator.log(e); return null; } } /* * (non-Javadoc) * * @see com.jcraft.jsch.Proxy#getOutputStream() */ @Override public OutputStream getOutputStream() { try { return channel.getOutputStream(); } catch (IOException e) { Activator.log(e); return null; } } /* * (non-Javadoc) * * @see com.jcraft.jsch.Proxy#getSocket() */ @Override public Socket getSocket() { return null; } } /** * Creates a (local or remote) command proxy. * * @param connection * Either a valid connection or null for a local command * @param command * A valid proxy command. Cannot be null or empty. * @param monitor * A valid progress monitor. Cannot be null. * @return ssh proxy */ public static Proxy createCommandProxy(JSchConnection connection, String command, IProgressMonitor monitor) { return new CommandProxy(connection, command, monitor); } /** * Creates a ssh forward proxy. * * @param proxyConnection * The Jsch proxy connection. Cannot be null. * @param monitor * A valid progress monitor. Cannot be null. * @return ssh proxy */ public static Proxy createForwardProxy(JSchConnection proxyConnection, IProgressMonitor monitor) { return new SSHForwardProxy(proxyConnection, monitor); } } JSchFileManager.java000066400000000000000000000060571272114001700402200ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/******************************************************************************* * Copyright (c) 2007, 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation * Martin Oberhuber - [468889] Support Eclipse older than Mars *******************************************************************************/ package org.eclipse.remote.internal.jsch.core; import java.net.URI; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.runtime.IPath; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnection.Service; import org.eclipse.remote.core.IRemoteFileService; import org.eclipse.remote.core.IRemoteProcessService; import org.eclipse.remote.core.RemoteServicesUtils; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.jsch.core.messages.Messages; public class JSchFileManager implements IRemoteFileService { private final IRemoteConnection fConnection; private JSchFileManager(IRemoteConnection connection) { fConnection = connection; } public static class Factory implements IRemoteFileService.Factory { @SuppressWarnings("unchecked") @Override public T getService(IRemoteConnection remoteConnection, Class service) { if (IRemoteFileService.class.equals(service)) { if (remoteConnection instanceof JSchConnection) try { ((JSchConnection) remoteConnection).getSftpCommandChannel(); } catch (RemoteConnectionException e) { throw new UnsupportedOperationException( Messages.JSchConnection_Remote_host_does_not_support_sftp); } return (T) new JSchFileManager(remoteConnection); } return null; } } @Override public IRemoteConnection getRemoteConnection() { return fConnection; } @Override public String getDirectorySeparator() { return "/"; //$NON-NLS-1$ } @Override public IFileStore getResource(String pathStr) { IPath path = RemoteServicesUtils.posixPath(pathStr); if (!path.isAbsolute()) { path = RemoteServicesUtils.posixPath(getBaseDirectory()).append(path); } return JschFileStore.getInstance(JSchFileSystem.getURIFor(fConnection.getName(), path.toString())); } @Override public String getBaseDirectory() { return fConnection.getService(IRemoteProcessService.class).getWorkingDirectory(); } @Override public void setBaseDirectory(String path) { fConnection.getService(IRemoteProcessService.class).setWorkingDirectory(path); } @Override public String toPath(URI uri) { return uri.getPath(); } @Override public URI toURI(IPath path) { try { return JSchFileSystem.getURIFor(fConnection.getName(), path.toString()); } catch (Exception e) { return null; } } @Override public URI toURI(String path) { return toURI(RemoteServicesUtils.posixPath(path)); } } JSchFileSystem.java000066400000000000000000000075301272114001700401270ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/******************************************************************************** * Copyright (c) 2006, 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 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html * * Initial Contributors: * The following IBM employees contributed to the Remote System Explorer * component that contains this file: David McKnight, Kushal Munir, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: * David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies * Kushal Munir (IBM) - moved to internal package * Martin Oberhuber (Wind River) - [181917] EFS Improvements: Avoid unclosed Streams, * - Fix early startup issues by deferring FileStore evaluation and classloading, * - Improve performance by RSEFileStore instance factory and caching IRemoteFile. * - Also remove unnecessary class RSEFileCache and obsolete branding files. * Martin Oberhuber (Wind River) - [188360] renamed from plugin org.eclipse.rse.eclipse.filesystem * Martin Oberhuber (Wind River) - [199587] return attributes of RemoteToolsFileSystem ********************************************************************************/ package org.eclipse.remote.internal.jsch.core; import java.net.URI; import java.net.URISyntaxException; import org.eclipse.core.filesystem.EFS; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.filesystem.provider.FileSystem; import org.eclipse.core.runtime.IPath; public class JSchFileSystem extends FileSystem { /** * Return the connection name encoded in the URI. * * @param uri * URI specifying a remote tools connection * @return name of the connection or null if the URI is invalid * @since 4.0 */ public static String getConnectionNameFor(URI uri) { return uri.getAuthority(); } /** * Return an URI uniquely naming a remote tools remote resource. * * @param connectionName * remote tools connection name * @param path * absolute path to resource as valid on the remote system * @return an URI uniquely naming the remote resource. */ public static URI getURIFor(String connectionName, String path) { try { return new URI("ssh", connectionName, path, null, null); //$NON-NLS-1$ } catch (URISyntaxException e) { throw new RuntimeException(e); } } /** * Default constructor. */ public JSchFileSystem() { super(); } /* * (non-Javadoc) * * @see org.eclipse.core.filesystem.IFileSystem#attributes() */ @Override public int attributes() { // Attributes supported by JSch IFileService return EFS.ATTRIBUTE_READ_ONLY | EFS.ATTRIBUTE_EXECUTABLE | EFS.ATTRIBUTE_SYMLINK | EFS.ATTRIBUTE_LINK_TARGET; } /* * (non-Javadoc) * * @see org.eclipse.core.filesystem.provider.FileSystem#canDelete() */ @Override public boolean canDelete() { return true; } /* * (non-Javadoc) * * @see org.eclipse.core.filesystem.provider.FileSystem#canWrite() */ @Override public boolean canWrite() { return true; } /* * (non-Javadoc) * * @see org.eclipse.core.filesystem.provider.FileSystem#getStore(org.eclipse.core.runtime.IPath) */ @Override public IFileStore getStore(IPath path) { return EFS.getNullFileSystem().getStore(path); } /* * (non-Javadoc) * * @see * org.eclipse.core.filesystem.provider.FileSystem#getStore(java.net.URI) */ @Override public IFileStore getStore(URI uri) { try { return JschFileStore.getInstance(uri); } catch (Exception e) { // Could be an URI format exception Activator.log(e); return EFS.getNullFileSystem().getStore(uri); } } }JSchProcess.java000066400000000000000000000154631272114001700374650ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.jsch.core; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PipedInputStream; import java.io.PipedOutputStream; import org.eclipse.remote.core.IRemoteProcess; import org.eclipse.remote.core.IRemoteProcessControlService; import org.eclipse.remote.core.IRemoteProcessSignalService; import org.eclipse.remote.core.IRemoteProcessTerminalService; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.jsch.core.messages.Messages; import com.jcraft.jsch.Channel; import com.jcraft.jsch.ChannelExec; import com.jcraft.jsch.ChannelShell; public class JSchProcess implements IRemoteProcessControlService, IRemoteProcessSignalService, IRemoteProcessTerminalService { @SuppressWarnings("nls") private final String signals[] = new String[] { "", "HUP", "INT", "QUIT", "ILL", "", "ABRT", "", "FPE", "KILL", "", "SEGV", "", "PIPE", "ALRM", "TERM", "", "STOP", "TSTP", "CONT", "", "", "", "", "", "", "", "", "", "", "USR1", "USR2" }; private static int WAIT_TIMEOUT = 1000; private static int refCount = 0; private final Channel fChannel; private final IRemoteProcess fProcess; private InputStream fProcStdout; private InputStream fProcStderr; private Thread fStdoutReader; private Thread fStderrReader; public static class Factory implements IRemoteProcess.Service.Factory { /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcess.Service.Factory#getService(org.eclipse.remote.core.IRemoteProcess, * java.lang.Class) */ @SuppressWarnings("unchecked") @Override public T getService(IRemoteProcess remoteProcess, Class service) { // This little trick creates an instance of this class // then for each interface it implements, it returns the same object. // This works because the connection caches the service so only one gets created. // As a side effect, it makes this class a service too which can be used // by the this plug-in if (JSchProcess.class.equals(service)) { return (T) new JSchProcess(remoteProcess); } if (IRemoteProcessControlService.class.equals(service) || IRemoteProcessSignalService.class.equals(service) || IRemoteProcessTerminalService.class.equals(service)) { return (T) remoteProcess.getService(JSchProcess.class); } return null; } } private class ProcReader implements Runnable { private final static int BUF_SIZE = 8192; private final InputStream fInput; private final OutputStream fOutput; public ProcReader(InputStream input, OutputStream output) { fInput = input; fOutput = output; synchronized (this.fOutput) { refCount++; } } @Override public void run() { int len; byte b[] = new byte[BUF_SIZE]; try { while ((len = fInput.read(b)) > 0) { fOutput.write(b, 0, len); } } catch (IOException e) { // Ignore } synchronized (fOutput) { if (--refCount == 0) { try { fOutput.close(); } catch (IOException e) { // Ignore } } } } } public class NullInputStream extends InputStream { @Override public int read() throws IOException { return -1; } @Override public int available() { return 0; } } public JSchProcess(IRemoteProcess process) { fProcess = process; fChannel = ((JSchProcessBuilder) process.getProcessBuilder()).getChannel(); try { if (process.getProcessBuilder().redirectErrorStream()) { PipedOutputStream pipedOutput = new PipedOutputStream(); fProcStdout = new PipedInputStream(pipedOutput); fProcStderr = new NullInputStream(); fStderrReader = new Thread(new ProcReader(fChannel.getExtInputStream(), pipedOutput)); fStdoutReader = new Thread(new ProcReader(fChannel.getInputStream(), pipedOutput)); fStderrReader.start(); fStdoutReader.start(); } else { fProcStdout = fChannel.getInputStream(); fProcStderr = fChannel.getExtInputStream(); } } catch (IOException e) { Activator.log(e); destroy(); } } /* * (non-Javadoc) * * @see java.lang.Process#destroy() */ @Override public void destroy() { fChannel.disconnect(); } /* * (non-Javadoc) * * @see java.lang.Process#exitValue() */ @Override public int exitValue() { if(!isCompleted()) { throw new IllegalThreadStateException(Messages.JSchProcess_exitValue_exception_msg); } return fChannel.getExitStatus(); } /* * (non-Javadoc) * * @see java.lang.Process#getErrorStream() */ @Override public InputStream getErrorStream() { return fProcStderr; } /* * (non-Javadoc) * * @see java.lang.Process#getInputStream() */ @Override public InputStream getInputStream() { return fProcStdout; } /* * (non-Javadoc) * * @see java.lang.Process#getOutputStream() */ @Override public OutputStream getOutputStream() { try { return fChannel.getOutputStream(); } catch (IOException e) { return null; } } /* * (non-Javadoc) * * @see java.lang.Process#waitFor() */ @Override public int waitFor() throws InterruptedException { while (!isCompleted()) { Thread.sleep(WAIT_TIMEOUT); } return exitValue(); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.RemoteProcess#isCompleted() */ @Override public boolean isCompleted() { return fChannel.isClosed(); } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcess.Service#getRemoteProcess() */ @Override public IRemoteProcess getRemoteProcess() { return fProcess; } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcessTerminalService#setTerminalSize(int, int, int, int) */ @Override public void setTerminalSize(int cols, int rows, int width, int height) { if (fChannel instanceof ChannelExec) { ((ChannelExec) fChannel).setPtySize(cols, rows, width, height); } else if (fChannel instanceof ChannelShell) { ((ChannelShell) fChannel).setPtySize(cols, rows, width, height); } } /* * (non-Javadoc) * * @see org.eclipse.remote.core.IRemoteProcessSignalService#sendSignal(int) */ @Override public void sendSignal(int signal) throws RemoteConnectionException { if (signal >= 0 && signal <= USR2) { try { fChannel.sendSignal(signals[signal]); } catch (Exception e) { throw new RemoteConnectionException(e.getMessage()); } } } } JSchProcessBuilder.java000066400000000000000000000215401272114001700407650ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.jsch.core; import java.io.IOException; import java.text.CharacterIterator; import java.text.StringCharacterIterator; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.remote.core.AbstractRemoteProcessBuilder; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteFileService; import org.eclipse.remote.core.IRemoteProcess; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.core.RemoteDebugOptions; import org.eclipse.remote.internal.core.RemoteProcess; import org.eclipse.remote.internal.jsch.core.messages.Messages; import com.jcraft.jsch.Channel; import com.jcraft.jsch.ChannelExec; import com.jcraft.jsch.ChannelShell; import com.jcraft.jsch.JSchException; public class JSchProcessBuilder extends AbstractRemoteProcessBuilder { private final JSchConnection fConnection; private final Map fRemoteEnv = new HashMap(); private final Set charSet = new HashSet(); private Channel fChannel; private Map fNewRemoteEnv; private boolean fPreamble = true; private boolean fShell = false; public JSchProcessBuilder(IRemoteConnection connection, List command) { super(connection, command); fConnection = connection.getService(JSchConnection.class); fRemoteEnv.putAll(fConnection.getEnv()); // Create set of characters not to escape String trustedChars = null; trustedChars = "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; //$NON-NLS-1$ //$NON-NLS-2$ trustedChars += "0123456789" + "/._-"; //$NON-NLS-1$ //$NON-NLS-2$ CharacterIterator it = new StringCharacterIterator(trustedChars); for (char c = it.first(); c != CharacterIterator.DONE; c = it.next()) { charSet.add(c); } } public JSchProcessBuilder(IRemoteConnection connection, String... command) { this(connection, Arrays.asList(command)); } public JSchProcessBuilder(IRemoteConnection connection) { this(connection, new ArrayList()); fShell = true; } @Override public IFileStore directory() { IFileStore dir = super.directory(); IRemoteFileService fileService = fConnection.getRemoteConnection().getService(IRemoteFileService.class); if (dir == null && fileService != null) { dir = fileService.getResource(fConnection.getWorkingDirectory()); directory(dir); } return dir; } @Override public Map environment() { if (fNewRemoteEnv == null) { fNewRemoteEnv = new HashMap(); fNewRemoteEnv.putAll(fRemoteEnv); } return fNewRemoteEnv; } @Override public int getSupportedFlags() { return ALLOCATE_PTY | FORWARD_X11; } @Override public IRemoteProcess start(int flags) throws IOException { if (!fConnection.hasOpenSession()) { throw new IOException(Messages.JSchProcessBuilder_Connection_is_not_open); } List cmdArgs = command(); if (cmdArgs.size() < 1 && !fShell) { throw new IndexOutOfBoundsException(); } String remoteCmd = ""; //$NON-NLS-1$ for (int i = 0; i < cmdArgs.size(); i++) { if (i > 0) { remoteCmd += " "; //$NON-NLS-1$ } remoteCmd += charEscapify(cmdArgs.get(i), charSet); } /* * There are two possibilities: * * 1. Some environment variables have changed values, or new variables have been added. In this case we just want to * send send the changed values rather than all the variables. * * 2. Some of the existing variables have been removed. In this case, we need to resend the entire environment variable * list. */ final List env = new ArrayList(); boolean clearEnv = false; if (fNewRemoteEnv != null) { /* * See if any of the existing variables have been removed */ for (String key : fRemoteEnv.keySet()) { if (fNewRemoteEnv.get(key) == null) { clearEnv = true; break; } } if (clearEnv) { /* * Add new/changed variables */ for (Entry entry : fNewRemoteEnv.entrySet()) { env.add(entry.getKey() + "=" + entry.getValue()); //$NON-NLS-1$ } } else { /* * Just add new or changed environment variables. */ for (Entry entry : fNewRemoteEnv.entrySet()) { String oldValue = fRemoteEnv.get(entry.getKey()); if (oldValue == null || !oldValue.equals(entry.getValue())) { env.add(entry.getKey() + "=" + entry.getValue()); //$NON-NLS-1$ } } } } try { if (fShell) { fChannel = fConnection.getShellChannel(); if ((flags & ALLOCATE_PTY) == ALLOCATE_PTY) { ((ChannelShell) fChannel).setPty(true); ((ChannelShell) fChannel).setPtyType((flags & FORWARD_X11) == FORWARD_X11 ? "xterm" : "vt100"); //$NON-NLS-1$ //$NON-NLS-2$ } RemoteDebugOptions.trace(RemoteDebugOptions.DEBUG_REMOTE_COMMANDS, "executing shell"); //$NON-NLS-1$ } else { fChannel = fConnection.getExecChannel(); String command = buildCommand(remoteCmd, env, clearEnv); ((ChannelExec) fChannel).setCommand(command); if ((flags & ALLOCATE_PTY) == ALLOCATE_PTY) { ((ChannelExec) fChannel).setPty(true); ((ChannelExec) fChannel).setPtyType((flags & FORWARD_X11) == FORWARD_X11 ? "xterm" : "vt100"); //$NON-NLS-1$ //$NON-NLS-2$ } RemoteDebugOptions.trace(RemoteDebugOptions.DEBUG_REMOTE_COMMANDS, "executing command: " + command); //$NON-NLS-1$ } fChannel.setXForwarding((flags & FORWARD_X11) == FORWARD_X11); fChannel.connect(); return new RemoteProcess(getRemoteConnection(), this); } catch (RemoteConnectionException e) { throw new IOException(e.getMessage()); } catch (JSchException e) { throw new IOException(e.getMessage()); } } public Channel getChannel() { return fChannel; } public void setPreamble(boolean enable) { fPreamble = enable; } private String buildCommand(String cmd, List environment, boolean clearEnv) { StringBuffer sb = new StringBuffer(); if (fPreamble) { if (directory() != null) { sb.append("cd " + charEscapify(directory().toURI().getPath(), charSet) + " && "); //$NON-NLS-1$ //$NON-NLS-2$ } if (clearEnv) { sb.append("env -i"); //$NON-NLS-1$ for (String env : environment) { sb.append(" \"" + env + "\""); //$NON-NLS-1$ //$NON-NLS-2$ } sb.append(" "); //$NON-NLS-1$ } else { for (String env : environment) { sb.append("export \"" + env + "\"; "); //$NON-NLS-1$ //$NON-NLS-2$ } } } sb.append(cmd); if (fPreamble && fConnection.useLoginShell()) { return substitute(fConnection.getLoginShellCommand(), sb.toString()); } return sb.toString(); } private String charEscapify(String inputString, Set charSet) { if (inputString == null) { return null; } StringBuffer newString = new StringBuffer(""); //$NON-NLS-1$ CharacterIterator it = new StringCharacterIterator(inputString); for (char c = it.first(); c != CharacterIterator.DONE; c = it.next()) { if (c == '\'') { newString.append("'\\\\\\''"); //$NON-NLS-1$ } else if (c > 127 || charSet.contains(c)) { // Do not escape non-ASCII characters (> 127) newString.append(c); } else { newString.append("\\" + c); //$NON-NLS-1$ } } inputString = newString.toString(); return inputString; } private String substitute(String str, String... args) { int length = str.length(); StringBuffer buffer = new StringBuffer(length + (args.length * 5)); for (int i = 0; i < length; i++) { char c = str.charAt(i); switch (c) { case '{': int index = str.indexOf('}', i); // if we don't have a matching closing brace then... if (index == -1) { buffer.append(c); break; } i++; if (i >= length) { buffer.append(c); break; } // look for a substitution int number = -1; try { number = Integer.parseInt(str.substring(i, index)); } catch (NumberFormatException e) { buffer.append(""); //$NON-NLS-1$ i = index; break; } if (number >= args.length || number < 0) { buffer.append(""); //$NON-NLS-1$ i = index; break; } buffer.append(args[number]); i = index; break; default: buffer.append(c); } } return buffer.toString(); } }JschFileStore.java000066400000000000000000000267401272114001700400030ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/******************************************************************************* * Copyright (c) 2007, 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation * Roland Schulz, University of Tennessee * Martin Oberhuber - [468889] Support Eclipse older than Mars *******************************************************************************/ package org.eclipse.remote.internal.jsch.core; import java.io.InputStream; import java.io.OutputStream; import java.net.URI; import java.util.HashMap; import java.util.Map; import org.eclipse.core.filesystem.EFS; import org.eclipse.core.filesystem.IFileInfo; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.filesystem.provider.FileStore; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.osgi.util.NLS; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.core.RemoteServicesUtils; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.jsch.core.commands.ChildInfosCommand; import org.eclipse.remote.internal.jsch.core.commands.DeleteCommand; import org.eclipse.remote.internal.jsch.core.commands.FetchInfoCommand; import org.eclipse.remote.internal.jsch.core.commands.GetInputStreamCommand; import org.eclipse.remote.internal.jsch.core.commands.GetOutputStreamCommand; import org.eclipse.remote.internal.jsch.core.commands.MkdirCommand; import org.eclipse.remote.internal.jsch.core.commands.PutInfoCommand; import org.eclipse.remote.internal.jsch.core.messages.Messages; public class JschFileStore extends FileStore { /** * Public factory method for obtaining JschFileStore instances. * * @param uri * URI to get a fileStore for * @return an JschFileStore instance for the URI. */ public static JschFileStore getInstance(URI uri) { synchronized (instanceMap) { JschFileStore store = instanceMap.get(uri.toString()); if (store == null) { store = new JschFileStore(uri); instanceMap.put(uri.toString(), store); } return store; } } private static Map instanceMap = new HashMap(); private final IPath fRemotePath; private final URI fURI; private JschFileStore(URI uri) { fURI = uri; fRemotePath = RemoteServicesUtils.posixPath(uri.getPath()); } private JSchConnection checkConnection(IProgressMonitor monitor) throws RemoteConnectionException { IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class); IRemoteConnectionType connectionType = manager.getConnectionType(fURI); if (connectionType == null) { throw new RemoteConnectionException(NLS.bind(Messages.JschFileStore_No_remote_services_found_for_URI, fURI)); } try { IRemoteConnection connection = connectionType.getConnection(fURI); if (connection == null) { throw new RemoteConnectionException(NLS.bind(Messages.JschFileStore_Invalid_connection_for_URI, fURI)); } if (!connection.isOpen()) { connection.open(monitor); if (!connection.isOpen()) { throw new RemoteConnectionException(Messages.JschFileStore_Connection_is_not_open); } } return connection.getService(JSchConnection.class); } catch (CoreException e) { throw new RemoteConnectionException(e); } } /* * (non-Javadoc) * * @see org.eclipse.core.filesystem.provider.FileStore#childInfos(int, * org.eclipse.core.runtime.IProgressMonitor) */ @Override public IFileInfo[] childInfos(int options, IProgressMonitor monitor) throws CoreException { SubMonitor subMon = SubMonitor.convert(monitor, 10); JSchConnection connection = checkConnection(subMon.newChild(1)); ChildInfosCommand command = new ChildInfosCommand(connection, fRemotePath); return command.getResult(subMon.newChild(9)); } /* * (non-Javadoc) * * @see org.eclipse.core.filesystem.provider.FileStore#childNames(int, * org.eclipse.core.runtime.IProgressMonitor) */ @Override public String[] childNames(int options, IProgressMonitor monitor) throws CoreException { SubMonitor subMon = SubMonitor.convert(monitor, 10); IFileInfo[] infos = childInfos(options, subMon.newChild(10)); String[] names = new String[infos.length]; for (int i = 0; i < infos.length; i++) { names[i] = infos[i].getName(); } return names; } /* * (non-Javadoc) * * @see org.eclipse.core.filesystem.provider.FileStore#delete(int, * org.eclipse.core.runtime.IProgressMonitor) */ @Override public void delete(int options, IProgressMonitor monitor) throws CoreException { SubMonitor subMon = SubMonitor.convert(monitor, 20); JSchConnection connection = checkConnection(subMon.newChild(1)); IFileInfo info = fetchInfo(EFS.NONE, subMon.newChild(9)); if (!subMon.isCanceled() && info.exists()) { DeleteCommand command = new DeleteCommand(connection, fRemotePath); command.getResult(subMon.newChild(10)); } } /* * (non-Javadoc) * * @see org.eclipse.core.filesystem.provider.FileStore#fetchInfo(int, * org.eclipse.core.runtime.IProgressMonitor) */ @Override public IFileInfo fetchInfo(int options, IProgressMonitor monitor) throws CoreException { SubMonitor subMon = SubMonitor.convert(monitor, 10); JSchConnection connection = checkConnection(subMon.newChild(1)); FetchInfoCommand command = new FetchInfoCommand(connection, fRemotePath); return command.getResult(subMon.newChild(9)); } /* * (non-Javadoc) * * @see * org.eclipse.core.filesystem.provider.FileStore#getChild(java.lang.String) */ @Override public IFileStore getChild(String name) { URI uri = JSchFileSystem.getURIFor(JSchFileSystem.getConnectionNameFor(fURI), fRemotePath.append(name).toString()); return JschFileStore.getInstance(uri); } /* * (non-Javadoc) * * @see org.eclipse.core.filesystem.provider.FileStore#getName() */ @Override public String getName() { return getNameFromPath(fRemotePath); } /** * Utility routing to get the file name from an absolute path. * * @param path * path to extract file name from * @return last segment of path, or the full path if it is root */ private String getNameFromPath(IPath path) { if (path.isRoot()) { return path.toString(); } return path.lastSegment(); } /* * (non-Javadoc) * * @see org.eclipse.core.filesystem.provider.FileStore#getParent() */ @Override public IFileStore getParent() { if (fRemotePath.isRoot()) { return null; } String parentPath = fRemotePath.toString(); if (fRemotePath.segmentCount() > 0) { parentPath = fRemotePath.removeLastSegments(1).toString(); } return JschFileStore.getInstance(JSchFileSystem.getURIFor(JSchFileSystem.getConnectionNameFor(fURI), parentPath)); } /* * (non-Javadoc) * * @see org.eclipse.core.filesystem.provider.FileStore#mkdir(int, * org.eclipse.core.runtime.IProgressMonitor) */ @Override public IFileStore mkdir(int options, IProgressMonitor monitor) throws CoreException { SubMonitor subMon = SubMonitor.convert(monitor, 20); JSchConnection connection = checkConnection(subMon.newChild(1)); if ((options & EFS.SHALLOW) == EFS.SHALLOW) { IFileStore parent = getParent(); if (parent != null && !parent.fetchInfo(EFS.NONE, subMon.newChild(9)).exists()) { throw new CoreException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), EFS.ERROR_WRITE, NLS.bind(Messages.JschFileStore_The_parent_of_directory_does_not_exist, fRemotePath.toString()), null)); } if (subMon.isCanceled()) { return this; } } try { MkdirCommand command = new MkdirCommand(connection, fRemotePath); command.getResult(subMon.newChild(10)); } catch (Exception e) { // Ignore any exceptions } if (!subMon.isCanceled()) { /* * Check if the result exists and is a directory, throw an exception if neither. */ IFileInfo info = fetchInfo(EFS.NONE, subMon.newChild(10)); if (!subMon.isCanceled()) { if (!info.exists()) { throw new CoreException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), EFS.ERROR_WRITE, NLS.bind(Messages.JschFileStore_The_directory_could_not_be_created, fRemotePath.toString()), null)); } if (!info.isDirectory()) { throw new CoreException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), EFS.ERROR_WRONG_TYPE, NLS.bind(Messages.JschFileStore_A_file_of_name_already_exists, fRemotePath.toString()), null)); } } } return this; } /* * (non-Javadoc) * * @see org.eclipse.core.filesystem.provider.FileStore#openInputStream(int, * org.eclipse.core.runtime.IProgressMonitor) */ @Override public InputStream openInputStream(int options, IProgressMonitor monitor) throws CoreException { SubMonitor subMon = SubMonitor.convert(monitor, 30); JSchConnection connection = checkConnection(subMon.newChild(1)); IFileInfo info = fetchInfo(EFS.NONE, subMon.newChild(9)); if (!subMon.isCanceled()) { if (!info.exists()) { throw new CoreException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), EFS.ERROR_READ, NLS.bind(Messages.JschFileStore_File_doesnt_exist, fRemotePath.toString()), null)); } if (info.isDirectory()) { throw new CoreException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), EFS.ERROR_WRONG_TYPE, NLS.bind(Messages.JschFileStore_Is_a_directory, fRemotePath.toString()), null)); } GetInputStreamCommand command = new GetInputStreamCommand(connection, fRemotePath); return command.getResult(subMon.newChild(10)); } return null; } /* * (non-Javadoc) * * @see org.eclipse.core.filesystem.provider.FileStore#openOutputStream(int, * org.eclipse.core.runtime.IProgressMonitor) */ @Override public OutputStream openOutputStream(int options, IProgressMonitor monitor) throws CoreException { SubMonitor subMon = SubMonitor.convert(monitor, 30); JSchConnection connection = checkConnection(subMon.newChild(1)); IFileInfo info = fetchInfo(EFS.NONE, subMon.newChild(9)); if (!subMon.isCanceled()) { if (info.isDirectory()) { throw new CoreException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), EFS.ERROR_WRONG_TYPE, NLS.bind(Messages.JschFileStore_Is_a_directory, fRemotePath.toString()), null)); } GetOutputStreamCommand command = new GetOutputStreamCommand(connection, options, fRemotePath); return command.getResult(subMon.newChild(10)); } return null; } /* * (non-Javadoc) * * @see * org.eclipse.core.filesystem.provider.FileStore#putInfo(org.eclipse.core * .filesystem.IFileInfo, int, org.eclipse.core.runtime.IProgressMonitor) */ @Override public void putInfo(IFileInfo info, int options, IProgressMonitor monitor) throws CoreException { SubMonitor subMon = SubMonitor.convert(monitor, 10); JSchConnection connection = checkConnection(subMon.newChild(1)); PutInfoCommand command = new PutInfoCommand(connection, info, options, fRemotePath); command.getResult(subMon.newChild(9)); } /* * (non-Javadoc) * * @see org.eclipse.core.filesystem.provider.FileStore#toURI() */ @Override public URI toURI() { return fURI; } } commands/000077500000000000000000000000001272114001700362245ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/coreAbstractRemoteCommand.java000077500000000000000000000343551272114001700433220ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/commands/****************************************************************************** * Copyright (c) 2013, 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial Implementation * Martin Oberhuber - [468889] Support Eclipse older than Mars *****************************************************************************/ package org.eclipse.remote.internal.jsch.core.commands; import java.io.IOException; import java.text.CharacterIterator; import java.text.MessageFormat; import java.text.StringCharacterIterator; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.eclipse.core.filesystem.EFS; import org.eclipse.core.filesystem.IFileInfo; import org.eclipse.core.filesystem.provider.FileInfo; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.remote.core.RemoteServicesUtils; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.jsch.core.JSchConnection; import org.eclipse.remote.internal.jsch.core.messages.Messages; import com.jcraft.jsch.ChannelExec; import com.jcraft.jsch.ChannelSftp; import com.jcraft.jsch.JSchException; import com.jcraft.jsch.SftpATTRS; import com.jcraft.jsch.SftpException; import com.jcraft.jsch.SftpProgressMonitor; /** * @author greg * */ public abstract class AbstractRemoteCommand { protected static class CommandProgressMonitor implements SftpProgressMonitor { private final IProgressMonitor fMonitor; private double fWorkPercentFactor; private Long fMaxWork; private String fMaxWorkSize; private long fWorkToDate; private String fPrefix; public CommandProgressMonitor(IProgressMonitor monitor) { fMonitor = monitor; } public CommandProgressMonitor(String prefix, IProgressMonitor monitor) { fPrefix = prefix; fMonitor = monitor; } @Override public boolean count(long count) { fWorkToDate += count; String size; Long workToDate; if (fWorkToDate < 1024L) { size = "bytes"; //$NON-NLS-1$ workToDate = fWorkToDate; } else { size = "KB"; //$NON-NLS-1$ workToDate = fWorkToDate / 1024L; } StringBuffer taskName = new StringBuffer(); if (fPrefix != null) { taskName.append(fPrefix); } if (fWorkPercentFactor < 0) { taskName.append(MessageFormat.format(Messages.AbstractRemoteCommand_format1, new Object[] { workToDate, size })); } else { Double workPercent = new Double(fWorkPercentFactor * fWorkToDate); taskName.append(MessageFormat.format(Messages.AbstractRemoteCommand_format2, new Object[] { workToDate, size, fMaxWork, fMaxWorkSize, workPercent })); } fMonitor.subTask(taskName.toString()); fMonitor.worked((int) count); return !(fMonitor.isCanceled()); } @Override public void end() { fMonitor.done(); } @Override public void init(int op, String src, String dest, long max) { fWorkPercentFactor = 1.0 / max; if (max < 1024L) { fMaxWorkSize = "bytes"; //$NON-NLS-1$ fMaxWork = max; } else { fMaxWorkSize = "KB"; //$NON-NLS-1$ fMaxWork = max / 1024L; } fWorkToDate = 0; fMonitor.beginTask(RemoteServicesUtils.posixPath(src).lastSegment(), (int) max); } } protected abstract class ExecCallable implements Callable { private IProgressMonitor fProgressMonitor; private ChannelExec fExecChannel; private Future asyncCmdInThread() throws RemoteConnectionException { setChannel(fConnection.getExecChannel()); return fPool.submit(this); } /* * (non-Javadoc) * * @see java.util.concurrent.Callable#call() */ @Override public abstract T1 call() throws JSchException, IOException, RemoteConnectionException; private void finalizeCmdInThread() { setChannel(null); } public ChannelExec getChannel() { return fExecChannel; } public IProgressMonitor getProgressMonitor() { return fProgressMonitor; } /** * Function opens exec channel and then executes the exec operation. If * run on the main thread it executes it on a separate thread */ public T1 getResult(IProgressMonitor monitor) throws RemoteConnectionException { Future future = null; fProgressMonitor = SubMonitor.convert(monitor, 10); try { future = asyncCmdInThread(); return waitCmdInThread(future); } finally { finalizeCmdInThread(); } } public void setChannel(ChannelExec channel) { fExecChannel = channel; } private T1 waitCmdInThread(Future future) throws RemoteConnectionException { boolean bInterrupted = Thread.interrupted(); while (!getProgressMonitor().isCanceled()) { try { return future.get(100, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { bInterrupted = true; } catch (TimeoutException e) { // ignore } catch (ExecutionException e) { getChannel().disconnect(); throw new RemoteConnectionException(e.getMessage()); } getProgressMonitor().worked(1); } if (bInterrupted) { Thread.currentThread().interrupt(); // set current thread flag } future.cancel(true); getChannel().disconnect(); throw new RemoteConnectionException(Messages.AbstractRemoteCommand_Operation_cancelled_by_user); } } protected abstract class SftpCallable implements Callable { private IProgressMonitor fProgressMonitor; private ChannelSftp fSftpChannel; private Future asyncCmdInThread() throws RemoteConnectionException { setChannel(fConnection.getSftpCommandChannel()); return fPool.submit(this); } /* * (non-Javadoc) * * @see java.util.concurrent.Callable#call() */ @Override public abstract T1 call() throws JSchException, SftpException, IOException; private void finalizeCmdInThread() { setChannel(null); } public ChannelSftp getChannel() { return fSftpChannel; } public IProgressMonitor getProgressMonitor() { return fProgressMonitor; } /** * Function opens sftp channel and then executes the sftp operation. If * run on the main thread it executes it on a separate thread */ public T1 getResult(IProgressMonitor monitor) throws SftpException, RemoteConnectionException { Future future = null; fProgressMonitor = SubMonitor.convert(monitor, 10); try { future = asyncCmdInThread(); return waitCmdInThread(future); } finally { finalizeCmdInThread(); } } public void setChannel(ChannelSftp channel) { fSftpChannel = channel; } private T1 waitCmdInThread(Future future) throws SftpException, RemoteConnectionException { boolean bInterrupted = Thread.interrupted(); while (!getProgressMonitor().isCanceled()) { try { return future.get(100, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { bInterrupted = true; } catch (TimeoutException e) { // ignore } catch (ExecutionException e) { if (e.getCause() instanceof SftpException) { throw (SftpException) e.getCause(); } throw new RemoteConnectionException(e.getMessage()); } getProgressMonitor().worked(1); } if (bInterrupted) { Thread.currentThread().interrupt(); // set current thread flag } future.cancel(true); throw new RemoteConnectionException(Messages.AbstractRemoteCommand_Operation_cancelled_by_user); } } private static ExecutorService fPool = Executors.newSingleThreadExecutor(); private final JSchConnection fConnection; public static final int UNKNOWN = 0; public static final int SUCCESS_OK = 1; public static final int SUCCESS_ERROR = 2; public static final int ERROR_NOT_EXECUTABLE = 126; public static final int ERROR_NOT_FOUND = 127; public static final int INVALID_EXIT_CODE = 128; public static final int SIGHUP = 129; public static final int SIGINT = 130; public static final int SIGQUIT = 131; public static final int SIGILL = 132; public static final int SIGTRAP = 133; public static final int SIGIOT = 134; public static final int SIGBUS = 135; public static final int SIGFPE = 136; public static final int SIGKILL = 137; public static final int SIGUSR1 = 138; public static final int SIGSEGV = 139; public static final int SIGUSR2 = 140; public static final int SIGPIPE = 141; public static final int SIGALRM = 142; public static final int SIGTERM = 143; public static final int SIGSTKFLT = 144; public static final int SIGCHLD = 145; public static final int SIGCONT = 146; public static final int SIGSTOP = 147; public static final int SIGTSTP = 148; public static final int SIGTTIN = 149; public static final int SIGTTOU = 150; public static final int SIGURG = 151; public static final int SIGXCPU = 152; public static final int SIGXFSZ = 153; public static final int SIGVTALRM = 154; public static final int SIGPROF = 155; public static final int SIGWINCH = 156; public static final int SIGIO = 157; public static final int SIGPWR = 158; public AbstractRemoteCommand(JSchConnection connection) { fConnection = connection; } protected IFileInfo convertToFileInfo(final IPath path, SftpATTRS attrs, IProgressMonitor monitor) throws RemoteConnectionException { return convertToFileInfo(path.lastSegment(), path.removeLastSegments(1), attrs, monitor); } protected IFileInfo convertToFileInfo(final String name, final IPath parentPath, SftpATTRS attrs, IProgressMonitor monitor) throws RemoteConnectionException { SubMonitor progress = SubMonitor.convert(monitor, 10); FileInfo fileInfo = new FileInfo(name); fileInfo.setExists(true); fileInfo.setDirectory(attrs.isDir()); fileInfo.setAttribute(EFS.ATTRIBUTE_OWNER_EXECUTE, (attrs.getPermissions() & 0100) != 0); fileInfo.setAttribute(EFS.ATTRIBUTE_OWNER_WRITE, (attrs.getPermissions() & 0200) != 0); fileInfo.setAttribute(EFS.ATTRIBUTE_OWNER_READ, (attrs.getPermissions() & 0400) != 0); fileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_EXECUTE, (attrs.getPermissions() & 0010) != 0); fileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_WRITE, (attrs.getPermissions() & 0020) != 0); fileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_READ, (attrs.getPermissions() & 0040) != 0); fileInfo.setAttribute(EFS.ATTRIBUTE_OTHER_EXECUTE, (attrs.getPermissions() & 0001) != 0); fileInfo.setAttribute(EFS.ATTRIBUTE_OTHER_WRITE, (attrs.getPermissions() & 0002) != 0); fileInfo.setAttribute(EFS.ATTRIBUTE_OTHER_READ, (attrs.getPermissions() & 0004) != 0); fileInfo.setAttribute(EFS.ATTRIBUTE_SYMLINK, attrs.isLink()); if (attrs.isLink()) { SftpCallable c2 = new SftpCallable() { @Override public String call() throws JSchException, SftpException { return getChannel().readlink(parentPath.append(name).toString()); } }; String target; try { progress.subTask(Messages.AbstractRemoteCommand_Get_symlink_target); target = c2.getResult(progress.newChild(10)); fileInfo.setStringAttribute(EFS.ATTRIBUTE_LINK_TARGET, target); } catch (SftpException e) { // Ignore } } fileInfo.setLastModified(attrs.getMTime() * 1000L); fileInfo.setLength(attrs.getSize()); return fileInfo; } public JSchConnection getConnection() { return fConnection; } public int getFinishStatus() { int code = 0; if (code == 0) { return SUCCESS_OK; } else if (code <= 125) { return SUCCESS_ERROR; } else if (code == 126) { return ERROR_NOT_EXECUTABLE; } else if (code == 127) { return ERROR_NOT_FOUND; } else if (code == 128) { return UNKNOWN; } else if (code == 255) { return INVALID_EXIT_CODE; } else if (code == 128 + 1) { return SIGHUP; } else if (code == 128 + 2) { return SIGINT; } else if (code == 128 + 3) { return SIGQUIT; } else if (code == 128 + 4) { return SIGILL; } else if (code == 128 + 5) { return SIGTRAP; } else if (code == 128 + 6) { return SIGIOT; } else if (code == 128 + 7) { return SIGBUS; } else if (code == 128 + 8) { return SIGFPE; } else if (code == 128 + 9) { return SIGKILL; } else if (code == 128 + 10) { return SIGUSR1; } else if (code == 128 + 11) { return SIGSEGV; } else if (code == 128 + 12) { return SIGUSR2; } else if (code == 128 + 13) { return SIGPIPE; } else if (code == 128 + 14) { return SIGALRM; } else if (code == 128 + 15) { return SIGTERM; } else if (code == 128 + 16) { return SIGSTKFLT; } else if (code == 128 + 17) { return SIGCHLD; } else if (code == 128 + 18) { return SIGCONT; } else if (code == 128 + 19) { return SIGSTOP; } else if (code == 128 + 20) { return SIGTSTP; } else if (code == 128 + 21) { return SIGTTIN; } else if (code == 128 + 22) { return SIGTTOU; } else if (code == 128 + 23) { return SIGURG; } else if (code == 128 + 24) { return SIGXCPU; } else if (code == 128 + 25) { return SIGXFSZ; } else if (code == 128 + 26) { return SIGVTALRM; } else if (code == 128 + 27) { return SIGPROF; } else if (code == 128 + 28) { return SIGWINCH; } else if (code == 128 + 29) { return SIGIO; } else if (code == 128 + 30) { return SIGPWR; } else { return UNKNOWN; } } protected abstract T getResult(IProgressMonitor monitor) throws RemoteConnectionException; protected String quote(String path, boolean full) { StringBuffer buffer = new StringBuffer(); StringCharacterIterator iter = new StringCharacterIterator(path); for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) { switch (c) { case '(': case ')': case '[': case ']': case '{': case '}': case '|': case '\\': case '*': case '&': case '^': case '%': case '$': case '#': case '@': case '!': case '~': case '`': case '\'': case '"': case ':': case ';': case '?': case '<': case '>': case ',': case '\n': if (full) { buffer.append('\\'); } buffer.append(c); continue; case ' ': buffer.append('\\'); buffer.append(c); continue; default: buffer.append(c); continue; } } return buffer.toString(); } }ChildInfosCommand.java000066400000000000000000000043621272114001700424150ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/commandspackage org.eclipse.remote.internal.jsch.core.commands; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import java.util.Vector; import org.eclipse.core.filesystem.IFileInfo; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.jsch.core.JSchConnection; import com.jcraft.jsch.ChannelSftp.LsEntry; import com.jcraft.jsch.JSchException; import com.jcraft.jsch.SftpException; public class ChildInfosCommand extends AbstractRemoteCommand { private final IPath fRemotePath; public ChildInfosCommand(JSchConnection connection, IPath path) { super(connection); fRemotePath = path; } @Override public IFileInfo[] getResult(IProgressMonitor monitor) throws RemoteConnectionException { final SubMonitor subMon = SubMonitor.convert(monitor, 20); Vector files = getResult(fRemotePath.toString(), subMon.newChild(10)); List result = new ArrayList(); if (files != null && !subMon.isCanceled()) { Enumeration enumeration = files.elements(); while (enumeration.hasMoreElements() && !subMon.isCanceled()) { LsEntry entry = enumeration.nextElement(); final String fileName = entry.getFilename(); if (fileName.equals(".") || fileName.equals("..")) { //$NON-NLS-1$ //$NON-NLS-2$ // Ignore parent and current dir entry. continue; } result.add(convertToFileInfo(fileName, fRemotePath, entry.getAttrs(), subMon.newChild(10))); } } return result.toArray(new IFileInfo[result.size()]); } private Vector getResult(String path, IProgressMonitor monitor) throws RemoteConnectionException { final SubMonitor subMon = SubMonitor.convert(monitor, 10); SftpCallable> c = new SftpCallable>() { @SuppressWarnings("unchecked") @Override public Vector call() throws JSchException, SftpException { return getChannel().ls(quote(fRemotePath.toString(), true)); } }; try { return c.getResult(subMon.newChild(10)); } catch (SftpException e) { throw new RemoteConnectionException(e.getMessage()); } } } DeleteCommand.java000066400000000000000000000017601272114001700415740ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/commandspackage org.eclipse.remote.internal.jsch.core.commands; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.jsch.core.JSchConnection; public class DeleteCommand extends AbstractRemoteCommand { private final IPath fRemotePath; public DeleteCommand(JSchConnection connection, IPath path) { super(connection); fRemotePath = path; } @Override public Void getResult(IProgressMonitor monitor) throws RemoteConnectionException { final SubMonitor subMon = SubMonitor.convert(monitor, 10); ExecCommand command = new ExecCommand(getConnection()); command.setCommand("/bin/rm -rf " + quote(fRemotePath.toString(), true)); //$NON-NLS-1$ String result = command.getResult(subMon.newChild(10)); if (!result.equals("")) { //$NON-NLS-1$ throw new RemoteConnectionException(result); } return null; } } ExecCommand.java000066400000000000000000000034671272114001700412640ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/commandspackage org.eclipse.remote.internal.jsch.core.commands; import java.io.ByteArrayOutputStream; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.osgi.util.NLS; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.jsch.core.JSchConnection; import org.eclipse.remote.internal.jsch.core.messages.Messages; import com.jcraft.jsch.JSchException; public class ExecCommand extends AbstractRemoteCommand { private String fCommand; public ExecCommand(JSchConnection connection) { super(connection); } public ExecCommand setCommand(String command) { fCommand = command; return this; } @Override public String getResult(IProgressMonitor monitor) throws RemoteConnectionException { final SubMonitor subMon = SubMonitor.convert(monitor, 10); ExecCallable c = new ExecCallable() { @Override public String call() throws JSchException, RemoteConnectionException { getChannel().setCommand(fCommand); ByteArrayOutputStream stream = new ByteArrayOutputStream(); ByteArrayOutputStream err = new ByteArrayOutputStream(); getChannel().setOutputStream(stream); getChannel().setErrStream(err); getChannel().connect(); while (!getChannel().isClosed() && !getProgressMonitor().isCanceled()) { synchronized (this) { try { wait(100); } catch (InterruptedException e) { // Ignore } } } if (getProgressMonitor().isCanceled()) { return ""; //$NON-NLS-1$ } if (getChannel().getExitStatus()!=0) { throw new RemoteConnectionException(err.toString()); } return stream.toString(); } }; subMon.subTask(NLS.bind(Messages.ExecCommand_Exec_command, fCommand)); return c.getResult(subMon.newChild(10)); } } FetchInfoCommand.java000066400000000000000000000030121272114001700422270ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/commandspackage org.eclipse.remote.internal.jsch.core.commands; import org.eclipse.core.filesystem.IFileInfo; import org.eclipse.core.filesystem.provider.FileInfo; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.jsch.core.JSchConnection; import com.jcraft.jsch.ChannelSftp; import com.jcraft.jsch.JSchException; import com.jcraft.jsch.SftpATTRS; import com.jcraft.jsch.SftpException; public class FetchInfoCommand extends AbstractRemoteCommand { private final IPath fRemotePath; public FetchInfoCommand(JSchConnection connection, IPath path) { super(connection); fRemotePath = path; } @Override public IFileInfo getResult(IProgressMonitor monitor) throws RemoteConnectionException { SubMonitor subMon = SubMonitor.convert(monitor, 20); SftpCallable c = new SftpCallable() { @Override public SftpATTRS call() throws JSchException, SftpException { return getChannel().lstat(fRemotePath.toString()); } }; SftpATTRS attrs; try { attrs = c.getResult(subMon.newChild(10)); return convertToFileInfo(fRemotePath, attrs, subMon.newChild(10)); } catch (SftpException e) { if (e.id == ChannelSftp.SSH_FX_NO_SUCH_FILE) { FileInfo info = new FileInfo(fRemotePath.lastSegment()); info.setExists(false); return info; } throw new RemoteConnectionException(e.getMessage()); } } } GetInputStreamCommand.java000066400000000000000000000105151272114001700433030ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/commandspackage org.eclipse.remote.internal.jsch.core.commands; import java.io.IOException; import java.io.InputStream; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.osgi.util.NLS; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.jsch.core.JSchConnection; import org.eclipse.remote.internal.jsch.core.messages.Messages; import com.jcraft.jsch.ChannelSftp; import com.jcraft.jsch.JSchException; import com.jcraft.jsch.SftpException; /** * The JSch implementation does not support multiple streams open on a single channel, so we must create a new channel for each * subsequent stream. This has the problem that there are usually only a limited number of channels that can be opened * simultaneously, so it is possible that this call will fail unless the open streams are closed first. * * This code will use the initial (command) channel first, or if that is already being used, will open a new stream. It must be * careful not to close the command stream as other threads may still be using it. */ public class GetInputStreamCommand extends AbstractRemoteCommand { private final IPath fRemotePath; private static ChannelSftp commandChannel; private ChannelSftp thisChannel; public GetInputStreamCommand(JSchConnection connection, IPath path) { super(connection); fRemotePath = path; } @Override public InputStream getResult(IProgressMonitor monitor) throws RemoteConnectionException { final SubMonitor subMon = SubMonitor.convert(monitor, 10); final SftpCallable c = new SftpCallable() { private ChannelSftp newChannel() throws IOException { synchronized (GetInputStreamCommand.class) { if (commandChannel != null) { try { thisChannel = getConnection().newSftpChannel(); return thisChannel; } catch (RemoteConnectionException e) { throw new IOException(e.getMessage()); } } thisChannel = commandChannel = getChannel(); return commandChannel; } } @Override public InputStream call() throws JSchException, SftpException, IOException { return newChannel().get(fRemotePath.toString(), new CommandProgressMonitor( NLS.bind(Messages.GetInputStreamCommand_Receiving, fRemotePath.toString()), getProgressMonitor())); } }; try { final InputStream stream = c.getResult(subMon.newChild(10)); return new InputStream() { @Override public int read() throws IOException { return stream.read(); } /* * (non-Javadoc) * * @see java.io.InputStream#close() */ @Override public void close() throws IOException { stream.close(); synchronized (GetInputStreamCommand.class) { if (thisChannel != commandChannel) { thisChannel.disconnect(); } else { commandChannel = null; } } } /* * (non-Javadoc) * * @see java.io.InputStream#read(byte[]) */ @Override public int read(byte[] b) throws IOException { return stream.read(b); } /* * (non-Javadoc) * * @see java.io.InputStream#read(byte[], int, int) */ @Override public int read(byte[] b, int off, int len) throws IOException { return stream.read(b, off, len); } /* * (non-Javadoc) * * @see java.io.InputStream#skip(long) */ @Override public long skip(long n) throws IOException { return stream.skip(n); } /* * (non-Javadoc) * * @see java.io.InputStream#available() */ @Override public int available() throws IOException { return stream.available(); } /* * (non-Javadoc) * * @see java.io.InputStream#mark(int) */ @Override public synchronized void mark(int readlimit) { stream.mark(readlimit); } /* * (non-Javadoc) * * @see java.io.InputStream#reset() */ @Override public synchronized void reset() throws IOException { stream.reset(); } /* * (non-Javadoc) * * @see java.io.InputStream#markSupported() */ @Override public boolean markSupported() { return stream.markSupported(); } }; } catch (SftpException e) { throw new RemoteConnectionException(e.getMessage()); } } } GetOutputStreamCommand.java000066400000000000000000000045441272114001700435110ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/commandspackage org.eclipse.remote.internal.jsch.core.commands; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import org.eclipse.core.filesystem.EFS; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.osgi.util.NLS; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.jsch.core.JSchConnection; import org.eclipse.remote.internal.jsch.core.messages.Messages; import com.jcraft.jsch.ChannelSftp; import com.jcraft.jsch.JSchException; import com.jcraft.jsch.SftpException; public class GetOutputStreamCommand extends AbstractRemoteCommand { private final IPath fRemotePath; private final int fOptions; private boolean fIsClosed; public GetOutputStreamCommand(JSchConnection connection, int options, IPath path) { super(connection); fRemotePath = path; fOptions = options; fIsClosed = false; } @Override public OutputStream getResult(IProgressMonitor monitor) throws RemoteConnectionException { final SubMonitor subMon = SubMonitor.convert(monitor, 10); return new ByteArrayOutputStream() { @Override public void close() throws IOException { if (!fIsClosed) { super.close(); final InputStream input = new ByteArrayInputStream(this.toByteArray()); try { SftpCallable c = new SftpCallable() { @Override public Integer call() throws JSchException, SftpException, IOException { try { int mode = ChannelSftp.OVERWRITE; if ((fOptions & EFS.APPEND) != 0) { mode = ChannelSftp.APPEND; } getChannel().put( input, fRemotePath.toString(), new CommandProgressMonitor(NLS.bind(Messages.GetOutputStreamCommand_Sending, fRemotePath.toString()), getProgressMonitor()), mode); input.close(); } finally { fIsClosed = true; } return 0; } }; c.getResult(subMon.newChild(10)); } catch (SftpException e) { throw new IOException(e.getMessage()); } catch (CoreException e) { throw new IOException(e.getMessage()); } } } }; } } MkdirCommand.java000066400000000000000000000030731272114001700414370ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/commandspackage org.eclipse.remote.internal.jsch.core.commands; import org.eclipse.core.filesystem.IFileInfo; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.jsch.core.JSchConnection; import com.jcraft.jsch.JSchException; import com.jcraft.jsch.SftpException; public class MkdirCommand extends AbstractRemoteCommand { private final IPath fRemotePath; public MkdirCommand(JSchConnection connection, IPath path) { super(connection); fRemotePath = path; } @Override public Void getResult(IProgressMonitor monitor) throws RemoteConnectionException { final SubMonitor subMon = SubMonitor.convert(monitor, 20); /* * Recursively create parent directories */ FetchInfoCommand command = new FetchInfoCommand(getConnection(), fRemotePath.removeLastSegments(1)); IFileInfo info = command.getResult(subMon.newChild(10)); if (!info.exists()) { MkdirCommand mkdirCommand = new MkdirCommand(getConnection(), fRemotePath.removeLastSegments(1)); mkdirCommand.getResult(subMon.newChild(10)); } /* * Now create directory */ SftpCallable c = new SftpCallable() { @Override public Void call() throws JSchException, SftpException { getChannel().mkdir(fRemotePath.toString()); return null; } }; try { c.getResult(subMon.newChild(10)); } catch (SftpException e) { throw new RemoteConnectionException(e.getMessage()); } return null; } } PutInfoCommand.java000066400000000000000000000100171272114001700417510ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/commandspackage org.eclipse.remote.internal.jsch.core.commands; import org.eclipse.core.filesystem.EFS; import org.eclipse.core.filesystem.IFileInfo; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.jsch.core.JSchConnection; import com.jcraft.jsch.JSchException; import com.jcraft.jsch.SftpException; public class PutInfoCommand extends AbstractRemoteCommand { private static final int S_IRUSR = 0400; // owner has read permission private static final int S_IWUSR = 0200; // owner has write permission private static final int S_IXUSR = 0100; // owner has execute permission private static final int S_IRGRP = 0040; // group has read permission private static final int S_IWGRP = 0020; // group has write permission private static final int S_IXGRP = 0010; // group has execute permission private static final int S_IROTH = 0004; // others have read permission private static final int S_IWOTH = 0002; // others have write permission private static final int S_IXOTH = 0001; // others have execute permission private final IPath fRemotePath; private final IFileInfo fFileInfo; private final int fOptions; public PutInfoCommand(JSchConnection connection, IFileInfo info, int options, IPath path) { super(connection); fFileInfo = info; fOptions = options; fRemotePath = path; } @Override public Void getResult(IProgressMonitor monitor) throws RemoteConnectionException { final SubMonitor subMon = SubMonitor.convert(monitor, 30); FetchInfoCommand command = new FetchInfoCommand(getConnection(), fRemotePath); String quotedPath = quote(fRemotePath.toString(), true); if ((fOptions & EFS.SET_ATTRIBUTES) != 0) { chmod(getPermissions(fFileInfo), quotedPath, subMon.newChild(10)); } if ((fOptions & EFS.SET_LAST_MODIFIED) != 0) { IFileInfo info = command.getResult(subMon.newChild(10)); long oldMTime = info.getLastModified(); int newMTime = (int) (oldMTime / 1000); if (oldMTime != newMTime) { setMTime(newMTime, quotedPath, subMon.newChild(10)); } } return null; } private void chmod(final int permissions, final String path, IProgressMonitor monitor) throws RemoteConnectionException { final SubMonitor subMon = SubMonitor.convert(monitor, 10); SftpCallable c = new SftpCallable() { @Override public Void call() throws JSchException, SftpException { getChannel().chmod(permissions, path); return null; } }; try { c.getResult(subMon.newChild(10)); } catch (SftpException e) { throw new RemoteConnectionException(e.getMessage()); } } private void setMTime(final int mtime, final String path, IProgressMonitor monitor) throws RemoteConnectionException { final SubMonitor subMon = SubMonitor.convert(monitor, 10); SftpCallable c = new SftpCallable() { @Override public Void call() throws JSchException, SftpException { getChannel().setMtime(path, mtime); return null; } }; try { c.getResult(subMon.newChild(10)); } catch (SftpException e) { throw new RemoteConnectionException(e.getMessage()); } } private int getPermissions(IFileInfo info) { int permissions = 0; if (info.getAttribute(EFS.ATTRIBUTE_OWNER_READ)) { permissions |= S_IRUSR; } if (info.getAttribute(EFS.ATTRIBUTE_OWNER_WRITE)) { permissions |= S_IWUSR; } if (info.getAttribute(EFS.ATTRIBUTE_OWNER_EXECUTE)) { permissions |= S_IXUSR; } if (info.getAttribute(EFS.ATTRIBUTE_GROUP_READ)) { permissions |= S_IRGRP; } if (info.getAttribute(EFS.ATTRIBUTE_GROUP_WRITE)) { permissions |= S_IWGRP; } if (info.getAttribute(EFS.ATTRIBUTE_GROUP_EXECUTE)) { permissions |= S_IXGRP; } if (info.getAttribute(EFS.ATTRIBUTE_OTHER_READ)) { permissions |= S_IROTH; } if (info.getAttribute(EFS.ATTRIBUTE_OTHER_WRITE)) { permissions |= S_IWOTH; } if (info.getAttribute(EFS.ATTRIBUTE_OTHER_EXECUTE)) { permissions |= S_IXOTH; } return permissions; } } messages/000077500000000000000000000000001272114001700362325ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/coreMessages.java000077500000000000000000000055351272114001700406570ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/messages/** * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial Implementation * */ package org.eclipse.remote.internal.jsch.core.messages; import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_ID = "org.eclipse.remote.internal.jsch.core.messages.messages"; //$NON-NLS-1$ public static String AbstractRemoteCommand_format1; public static String AbstractRemoteCommand_format2; public static String AbstractRemoteCommand_Get_symlink_target; public static String AbstractRemoteCommand_Operation_cancelled_by_user; public static String AuthInfo_Authentication_message; public static String ExecCommand_Exec_command; public static String GetInputStreamCommand_Receiving; public static String GetOutputStreamCommand_Sending; public static String JSchConnection_0; public static String JSchConnection_Connection_was_cancelled; public static String JSchConnection_connectionNotOpen; public static String JSchConnection_Executing_command; public static String JSchConnection_remote_address_must_be_set; public static String JSchConnection_remotePort; public static String JSchConnection_forwarding; public static String JSchConnection_Remote_host_does_not_support_sftp; public static String JSchConnection_Unable_to_open_sftp_channel; public static String JSchConnection_username_must_be_set; public static String JSchConnectionManager_connection_with_name_exists; public static String JSchConnectionManager_cannotRemoveOpenConnection; public static String JSchConnectionManager_invalidConnectionType; public static String JSchConnectionProxyFactory_failed; public static String JSchConnectionProxyFactory_ProxyCommandFailed; public static String JSchConnectionProxyFactory_timedOut; public static String JSchConnectionProxyFactory_wasCanceled; public static String JSchProcess_exitValue_exception_msg; public static String JSchProcessBuilder_Connection_is_not_open; public static String JschFileStore_Connection_is_not_open; public static String JschFileStore_File_doesnt_exist; public static String JschFileStore_Invalid_connection_for_URI; public static String JschFileStore_Is_a_directory; public static String JschFileStore_No_remote_services_found_for_URI; public static String JschFileStore_The_directory_could_not_be_created; public static String JschFileStore_A_file_of_name_already_exists; public static String JschFileStore_The_parent_of_directory_does_not_exist; static { // load message values from bundle file NLS.initializeMessages(BUNDLE_ID, Messages.class); } private Messages() { // cannot create new instance } } messages.properties000077500000000000000000000056201272114001700421650ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/messages############################################################################### # Copyright (c) 2013 IBM Corporation. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # IBM Corporation - initial implementation ############################################################################### AbstractRemoteCommand_format1={0,number,integer} {1} completed AbstractRemoteCommand_format2={0,number,integer} {1} of {2,number,integer} {3} complete ({4,number,percent}) AbstractRemoteCommand_Get_symlink_target=Get symlink target AbstractRemoteCommand_Operation_cancelled_by_user=Operation cancelled by user AuthInfo_Authentication_message=Authentication Message ExecCommand_Exec_command=Executing command "{0}" GetInputStreamCommand_Receiving=Receiving {0}: GetOutputStreamCommand_Sending=Sending {0}: JSchConnection_0=Connection canceled by user JSchConnection_Connection_was_cancelled=Connection was cancelled JSchConnection_connectionNotOpen=Connection is not open JSchConnection_Executing_command=Executing command "{0}" JSchConnection_remote_address_must_be_set=Remote address must be set before opening connection JSchConnection_remotePort=Could not allocate remote port JSchConnection_forwarding=Setting up remote forwarding JSchConnection_Remote_host_does_not_support_sftp=Remote host does not support sftp. Remote functionality requires sftp to be enabled JSchConnection_Unable_to_open_sftp_channel=Unable to open sftp channel: check sftp is enabled on remote host JSchConnection_username_must_be_set=Username must be set before opening connection JSchConnectionManager_connection_with_name_exists=A connection with name \"{0}\" already exists JSchConnectionManager_cannotRemoveOpenConnection=Cannot remove an open connection JSchConnectionManager_invalidConnectionType=Invalid connection type JSchConnectionProxyFactory_failed=failed JSchConnectionProxyFactory_ProxyCommandFailed=Proxy command "{0}" {1} and printed message "{2}" JSchConnectionProxyFactory_timedOut=timed out JSchConnectionProxyFactory_wasCanceled=was canceled JSchProcess_exitValue_exception_msg=process has not exited JSchProcessBuilder_Connection_is_not_open=Connection is not open JschFileStore_Connection_is_not_open=Connection is not open JschFileStore_File_doesnt_exist=File {0} doesn't exist JschFileStore_Invalid_connection_for_URI=Invalid connection for URI: "{0}" JschFileStore_Is_a_directory={0} is a directory JschFileStore_No_remote_services_found_for_URI=No remote services found for URI: "{0}" JschFileStore_The_directory_could_not_be_created=The directory {0} could not be created JschFileStore_A_file_of_name_already_exists=A file of name {0} already exists JschFileStore_The_parent_of_directory_does_not_exist=The parent of directory {0} does not exist org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/000077500000000000000000000000001272114001700241775ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/.classpath000066400000000000000000000005611272114001700261640ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/.gitignore000066400000000000000000000000051272114001700261620ustar00rootroot00000000000000/bin org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/.project000066400000000000000000000015211272114001700256450ustar00rootroot00000000000000 org.eclipse.remote.jsch.ui org.eclipse.jdt.core.javabuilder org.eclipse.pde.ManifestBuilder org.eclipse.pde.SchemaBuilder org.eclipse.pde.api.tools.apiAnalysisBuilder org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.pde.api.tools.apiAnalysisNature org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/.settings/000077500000000000000000000000001272114001700261155ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/.settings/org.eclipse.jdt.core.prefs000066400000000000000000000011131272114001700330730ustar00rootroot00000000000000eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/META-INF/000077500000000000000000000000001272114001700253375ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/META-INF/MANIFEST.MF000066400000000000000000000024701272114001700267740ustar00rootroot00000000000000Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.remote.jsch.ui;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-Activator: org.eclipse.remote.internal.jsch.ui.Activator Bundle-Vendor: %pluginProvider Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.remote.internal.jsch.ui;x-internal:=true, org.eclipse.remote.internal.jsch.ui.messages;x-internal:=true Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Import-Package: com.jcraft.jsch, org.eclipse.core.filesystem, org.eclipse.core.runtime, org.eclipse.jface.dialogs, org.eclipse.jface.operation, org.eclipse.jface.preference, org.eclipse.jface.resource, org.eclipse.jface.viewers, org.eclipse.jface.window, org.eclipse.jface.wizard, org.eclipse.jsch.core, org.eclipse.jsch.ui, org.eclipse.osgi.util, org.eclipse.remote.core, org.eclipse.remote.core.exception, org.eclipse.remote.internal.jsch.core, org.eclipse.remote.ui, org.eclipse.remote.ui.dialogs, org.eclipse.remote.ui.widgets, org.eclipse.swt, org.eclipse.swt.events, org.eclipse.swt.graphics, org.eclipse.swt.layout, org.eclipse.swt.widgets, org.eclipse.ui.dialogs, org.eclipse.ui.forms.events, org.eclipse.ui.forms.widgets, org.eclipse.ui.ide.fileSystem, org.eclipse.ui.plugin, org.osgi.framework org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/about.html000066400000000000000000000024471272114001700262060ustar00rootroot00000000000000 About

About This Content

May 2, 2006

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/build.properties000066400000000000000000000003001272114001700274050ustar00rootroot00000000000000source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ plugin.xml,\ plugin.properties,\ about.html,\ icons/ org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/icons/000077500000000000000000000000001272114001700253125ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/icons/full/000077500000000000000000000000001272114001700262545ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/icons/full/obj16/000077500000000000000000000000001272114001700271755ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/icons/full/obj16/connection.gif000066400000000000000000000002401272114001700320170ustar00rootroot00000000000000GIF89aokպ&!,M18[wLTh5/\bx>cAIHQp#18G0>y^;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/icons/ssh.png000066400000000000000000000010001272114001700266040ustar00rootroot00000000000000PNG  IHDRabKGD pHYs+tIME>iTXtCommentCreated with GIMPd.edIDAT8˕J[asfЭ*T}2'p%b*/VҍuUhD7^͝nrg'|\?pX"*_gdat Lx~e2'LkᑴlϴZ@ Rшã#Zsuy"$ ύ>~xa8ג$Gzt:noj T ';jFn8wRx·ǿ1LB`sr| %JSchTransferConnections.description org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/pom.xml000066400000000000000000000012131272114001700255110ustar00rootroot00000000000000 4.0.0 org.eclipse.remote remote-parent 2.1.0-SNAPSHOT ../../releng/org.eclipse.remote.build/pom.xml org.eclipse.remote.jsch.ui eclipse-plugin 1.0.0-SNAPSHOT org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/000077500000000000000000000000001272114001700247665ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/org/000077500000000000000000000000001272114001700255555ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/org/eclipse/000077500000000000000000000000001272114001700272015ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/org/eclipse/remote/000077500000000000000000000000001272114001700304745ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/org/eclipse/remote/internal/000077500000000000000000000000001272114001700323105ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/org/eclipse/remote/internal/jsch/000077500000000000000000000000001272114001700332375ustar00rootroot00000000000000ui/000077500000000000000000000000001272114001700335755ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/org/eclipse/remote/internal/jschActivator.java000066400000000000000000000060421272114001700363760ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/org/eclipse/remote/internal/jsch/uipackage org.eclipse.remote.internal.jsch.ui; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.jsch.core.IJSchService; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; /** * The activator class controls the plug-in life cycle */ public class Activator extends AbstractUIPlugin { // The plug-in ID private static final String PLUGIN_ID = "org.eclipse.remote.jsch.ui"; //$NON-NLS-1$ // Image Keys public static final String IMG_CONNECTION_TYPE = PLUGIN_ID + ".connectionType"; //$NON-NLS-1$ // The shared instance private static Activator plugin; /** * Returns the shared instance * * @return the shared instance */ public static Activator getDefault() { return plugin; } /** * Get unique identifier * * @return * @since 5.0 */ public static String getUniqueIdentifier() { if (getDefault() == null) { return PLUGIN_ID; } return getDefault().getBundle().getSymbolicName(); } /** * Logs the specified status with this plug-in's log. * * @param status * status to log */ public static void log(IStatus status) { getDefault().getLog().log(status); } /** * Logs an internal error with the specified message. * * @param message * the error message to log */ public static void log(String message) { log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, message, null)); } /** * Logs an internal error with the specified throwable * * @param e * the exception to be logged */ public static void log(Throwable e) { log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, e.getMessage(), e)); } private IJSchService fJSchService; /** * The constructor */ public Activator() { } /** * Return the OSGi service with the given service interface. * * @param service service interface * @return the specified service or null if it's not registered */ public static T getService(Class service) { BundleContext context = plugin.getBundle().getBundleContext(); ServiceReference ref = context.getServiceReference(service); return ref != null ? context.getService(ref) : null; } public IJSchService getService() { return fJSchService; } /* * (non-Javadoc) * * @see * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext * ) */ @Override public void start(BundleContext context) throws Exception { super.start(context); plugin = this; ServiceReference reference = context.getServiceReference(IJSchService.class); fJSchService = context.getService(reference); getImageRegistry().put(IMG_CONNECTION_TYPE, imageDescriptorFromPlugin(PLUGIN_ID, "/icons/ssh.png")); //$NON-NLS-1$ } /* * (non-Javadoc) * * @see * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext * ) */ @Override public void stop(BundleContext context) throws Exception { plugin = null; super.stop(context); } } JSchFileSystemContributor.java000066400000000000000000000062441272114001700415350ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/org/eclipse/remote/internal/jsch/ui/******************************************************************************** * 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 * available at http://www.eclipse.org/legal/epl-v10.html * * Initial Contributors: * The following IBM employees contributed to the Remote System Explorer * component that contains this file: David McKnight, Kushal Munir, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: * Kushal Munir (IBM) - moved to internal package. * Martin Oberhuber (Wind River) - [181917] EFS Improvements: Avoid unclosed Streams, * - Fix early startup issues by deferring FileStore evaluation and classloading, * - Improve performance by RSEFileStore instance factory and caching IRemoteFile. * - Also remove unnecessary class RSEFileCache and obsolete branding files. * Martin Oberhuber (Wind River) - [188360] renamed from plugin org.eclipse.rse.eclipse.filesystem * Martin Oberhuber (Wind River) - [189441] fix EFS operations on Windows (Local) systems * David Dykstal (IBM) - [235840] externalizing dialog title ********************************************************************************/ package org.eclipse.remote.internal.jsch.ui; import java.net.URI; import java.net.URISyntaxException; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.internal.jsch.core.JSchConnection; import org.eclipse.remote.internal.jsch.core.JSchFileSystem; import org.eclipse.remote.internal.jsch.ui.messages.Messages; import org.eclipse.remote.ui.IRemoteUIFileService; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.ide.fileSystem.FileSystemContributor; public class JSchFileSystemContributor extends FileSystemContributor { /* * (non-Javadoc) * * @see * org.eclipse.ui.ide.fileSystem.FileSystemContributor#browseFileSystem( * java.lang.String, org.eclipse.swt.widgets.Shell) */ @Override public URI browseFileSystem(String initialPath, Shell shell) { IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class); IRemoteConnectionType connectionType = manager.getConnectionType(JSchConnection.JSCH_ID); IRemoteUIFileService uiFileMgr = connectionType.getService(IRemoteUIFileService.class); uiFileMgr.showConnections(true); String path = uiFileMgr.browseDirectory(shell, Messages.JSchFileSystemContributor_0, initialPath, 0); if (path != null) { IRemoteConnection conn = uiFileMgr.getConnection(); if (conn != null) { return JSchFileSystem.getURIFor(conn.getName(), path); } } return null; } /* * (non-Javadoc) * * @see * org.eclipse.ui.ide.fileSystem.FileSystemContributor#getURI(java.lang. * String) */ @Override public URI getURI(String string) { try { return new URI(string); } catch (URISyntaxException e) { // Ignore } return null; } }JSchUIConnectionService.java000066400000000000000000000077161272114001700411010ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/org/eclipse/remote/internal/jsch/ui/******************************************************************************* * Copyright (c) 2013 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.jsch.ui; import java.lang.reflect.InvocationTargetException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionType.Service; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.jsch.ui.messages.Messages; import org.eclipse.remote.internal.jsch.ui.wizards.JSchConnectionWizard; import org.eclipse.remote.ui.AbstractRemoteUIConnectionService; import org.eclipse.remote.ui.IRemoteUIConnectionService; import org.eclipse.remote.ui.IRemoteUIConnectionWizard; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Shell; public class JSchUIConnectionService extends AbstractRemoteUIConnectionService { private final IRemoteConnectionType fConnectionType; public JSchUIConnectionService(IRemoteConnectionType connectionType) { fConnectionType = connectionType; } public static class Factory implements IRemoteConnectionType.Service.Factory { @SuppressWarnings("unchecked") @Override public T getService(IRemoteConnectionType connectionType, Class service) { if (IRemoteUIConnectionService.class.equals(service)) { return (T) new JSchUIConnectionService(connectionType); } return null; } } @Override public IRemoteConnectionType getConnectionType() { return fConnectionType; } @Override public IRemoteUIConnectionWizard getConnectionWizard(Shell shell) { return new JSchConnectionWizard(shell, fConnectionType); } @Override public void openConnectionWithProgress(Shell shell, IRunnableContext context, final IRemoteConnection connection) { if (!connection.isOpen()) { IRunnableWithProgress op = new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { connection.open(monitor); } catch (RemoteConnectionException e) { throw new InvocationTargetException(e); } if (monitor.isCanceled()) { throw new InterruptedException(); } } }; try { if (context != null) { context.run(true, true, op); } else { new ProgressMonitorDialog(shell).run(true, true, op); } } catch (InvocationTargetException e) { ErrorDialog.openError(shell, Messages.JSchUIConnectionManager_Connection_Error, Messages.JSchUIConnectionManager_Could_not_open_connection, new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), e.getCause().getMessage())); } catch (InterruptedException e) { ErrorDialog.openError(shell, Messages.JSchUIConnectionManager_Connection_Error, Messages.JSchUIConnectionManager_Could_not_open_connection, new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), e.getMessage())); } } } @Override public ILabelProvider getLabelProvider() { return new DefaultLabelProvider() { @Override public Image getImage(Object element) { return Activator.getDefault().getImageRegistry().get(Activator.IMG_CONNECTION_TYPE); } }; } } JSchUIFileService.java000066400000000000000000000114551272114001700376540ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/org/eclipse/remote/internal/jsch/ui/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.jsch.ui; import java.util.ArrayList; import java.util.List; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.jface.window.Window; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionType.Service; import org.eclipse.remote.ui.IRemoteUIFileService; import org.eclipse.remote.ui.dialogs.RemoteResourceBrowser; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Shell; public class JSchUIFileService implements IRemoteUIFileService { private final IRemoteConnectionType connectionType; private IRemoteConnection connection = null; private boolean showConnections = false; public JSchUIFileService(IRemoteConnectionType connectionType) { this.connectionType = connectionType; } public static class Factory implements IRemoteConnectionType.Service.Factory { @SuppressWarnings("unchecked") @Override public T getService(IRemoteConnectionType connectionType, Class service) { if (IRemoteUIFileService.class.equals(service)) { return (T) new JSchUIFileService(connectionType); } return null; } } @Override public IRemoteConnectionType getConnectionType() { return connectionType; } /* * (non-Javadoc) * * @see * org.eclipse.ptp.remote.core.IRemoteFileManager#browseDirectory(org.eclipse * .swt.widgets.Shell, java.lang.String, java.lang.String) */ @Override public String browseDirectory(Shell shell, String message, String filterPath, int flags) { RemoteResourceBrowser browser = new RemoteResourceBrowser(shell, SWT.SINGLE); browser.setType(RemoteResourceBrowser.DIRECTORY_BROWSER); browser.setInitialPath(filterPath); browser.setTitle(message); browser.showConnections(showConnections); browser.setConnection(connection); if (browser.open() == Window.CANCEL) { return null; } connection = browser.getConnection(); IFileStore resource = browser.getResource(); if (resource == null) { return null; } return resource.toURI().getPath(); } /* * (non-Javadoc) * * @see * org.eclipse.ptp.remote.core.IRemoteFileManager#browseFile(org.eclipse * .swt.widgets.Shell, java.lang.String, java.lang.String) */ @Override public String browseFile(Shell shell, String message, String filterPath, int flags) { RemoteResourceBrowser browser = new RemoteResourceBrowser(shell, SWT.SINGLE); browser.setType(RemoteResourceBrowser.FILE_BROWSER); browser.setInitialPath(filterPath); browser.setTitle(message); browser.showConnections(showConnections); browser.setConnection(connection); if (browser.open() == Window.CANCEL) { return null; } connection = browser.getConnection(); IFileStore resource = browser.getResource(); if (resource == null) { return null; } return resource.toURI().getPath(); } /* * (non-Javadoc) * * @see * org.eclipse.ptp.remote.core.IRemoteFileManager#browseFile(org.eclipse * .swt.widgets.Shell, java.lang.String, java.lang.String) */ @Override public List browseFiles(Shell shell, String message, String filterPath, int flags) { RemoteResourceBrowser browser = new RemoteResourceBrowser(shell, SWT.MULTI); browser.setType(RemoteResourceBrowser.FILE_BROWSER); browser.setInitialPath(filterPath); browser.setTitle(message); browser.showConnections(showConnections); browser.setConnection(connection); if (browser.open() == Window.CANCEL) { return null; } connection = browser.getConnection(); List paths = new ArrayList(); for (IFileStore store : browser.getResources()) { paths.add(store.toURI().getPath()); } return paths; } /* * (non-Javadoc) * * @see org.eclipse.ptp.remote.ui.IRemoteUIFileManager#getConnection() */ @Override public IRemoteConnection getConnection() { return connection; } /* * (non-Javadoc) * * @see * org.eclipse.ptp.remote.ui.IRemoteUIFileManager#setConnection(org.eclipse * .ptp.remote.core.IRemoteConnection) */ @Override public void setConnection(IRemoteConnection connection) { this.connection = connection; } /* * (non-Javadoc) * * @see * org.eclipse.ptp.remote.ui.IRemoteUIFileManager#showConnections(boolean) */ @Override public void showConnections(boolean enable) { showConnections = enable; } } JSchUserAuthenticator.java000066400000000000000000000076371272114001700406760ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/org/eclipse/remote/internal/jsch/ui/******************************************************************************* * Copyright (c) 2014, 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation * Bernd Hufmann - Implement IRemoteConnection.Service.Factory *******************************************************************************/ package org.eclipse.remote.internal.jsch.ui; import java.net.PasswordAuthentication; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jsch.ui.UserInfoPrompter; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IUserAuthenticatorService; import org.eclipse.remote.internal.jsch.core.JSchConnection; import org.eclipse.swt.widgets.Display; import com.jcraft.jsch.JSch; import com.jcraft.jsch.JSchException; public class JSchUserAuthenticator implements IUserAuthenticatorService { private final IRemoteConnection remoteConnection; private UserInfoPrompter prompter; public JSchUserAuthenticator(IRemoteConnection conn) { this.remoteConnection = conn; try { String username = conn.getAttribute(JSchConnection.USERNAME_ATTR); String address = conn.getAttribute(JSchConnection.ADDRESS_ATTR); prompter = new UserInfoPrompter(new JSch().getSession(username, address)); } catch (JSchException e) { // Not allowed } } @Override public IRemoteConnection getRemoteConnection() { return remoteConnection; } @Override public PasswordAuthentication prompt(String username, String message) { if (prompter.promptPassword(message)) { String sessionUserName = prompter.getSession().getUserName(); if (sessionUserName != null) { username = sessionUserName; } PasswordAuthentication auth = new PasswordAuthentication(username, prompter.getPassword().toCharArray()); return auth; } return null; } @Override public String[] prompt(String destination, String name, String message, String[] prompt, boolean[] echo) { return prompter.promptKeyboardInteractive(destination, name, message, prompt, echo); } @Override public int prompt(final int promptType, final String title, final String message, final int[] promptResponses, final int defaultResponseIndex) { final Display display = getDisplay(); final int[] retval = new int[1]; final String[] buttons = new String[promptResponses.length]; for (int i = 0; i < promptResponses.length; i++) { int prompt = promptResponses[i]; switch (prompt) { case IDialogConstants.OK_ID: buttons[i] = IDialogConstants.OK_LABEL; break; case IDialogConstants.CANCEL_ID: buttons[i] = IDialogConstants.CANCEL_LABEL; break; case IDialogConstants.NO_ID: buttons[i] = IDialogConstants.NO_LABEL; break; case IDialogConstants.YES_ID: buttons[i] = IDialogConstants.YES_LABEL; break; } } display.syncExec(new Runnable() { @Override public void run() { final MessageDialog dialog = new MessageDialog(display.getActiveShell(), title, null /* title image */, message, promptType, buttons, defaultResponseIndex); retval[0] = dialog.open(); } }); return promptResponses[retval[0]]; } private Display getDisplay() { Display display = Display.getCurrent(); if (display == null) { display = Display.getDefault(); } return display; } public static class Factory implements IRemoteConnection.Service.Factory { @Override @SuppressWarnings("unchecked") public T getService(IRemoteConnection connection, Class service) { if (IUserAuthenticatorService.class.equals(service)) { return (T) new JSchUserAuthenticator(connection); } else { return null; } } } } messages/000077500000000000000000000000001272114001700354045ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/org/eclipse/remote/internal/jsch/uiMessages.java000077500000000000000000000062601272114001700400250ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/org/eclipse/remote/internal/jsch/ui/messages/** * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial Implementation * */ package org.eclipse.remote.internal.jsch.ui.messages; import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_ID = "org.eclipse.remote.internal.jsch.ui.messages.messages"; //$NON-NLS-1$ static { // load message values from bundle file NLS.initializeMessages(BUNDLE_ID, Messages.class); } public static String JSchConnectionPage_0; public static String JSchConnectionPage_1; public static String JSchConnectionPage_2; public static String JSchConnectionPage_A_connection_with_that_name_already_exists; public static String JSchConnectionPage_Edit_Connection; public static String JSchConnectionPage_Edit_properties_of_an_existing_connection; public static String JSchConnectionPage_Initial_Message; public static String JSchConnectionPage_Proxy; public static String JSchConnectionPage_Help; public static String JSchConnectionPage_KeysAtSSH2; public static String JSchConnectionPage_SelectCommand; public static String JSchConnectionPage_SelectConnection; public static String JSchConnectionPage_Settings0; public static String JSchConnectionPage_selectProxyConnection; public static String JSchFileSystemContributor_0; public static String JSchNewConnectionPage_Advanced; public static String JSchNewConnectionPage_Connection_name; public static String JSchNewConnectionPage_File_with_private_key; public static String JSchNewConnectionPage_Host; public static String JSchNewConnectionPage_Host_information; public static String JSchNewConnectionPage_Host_name_cannot_be_empty; public static String JSchNewConnectionPage_New_Connection; public static String JSchNewConnectionPage_New_connection_properties; public static String JSchNewConnectionPage_Passphrase; public static String JSchNewConnectionPage_Password; public static String JSchNewConnectionPage_Password_based_authentication; public static String JSchNewConnectionPage_Please_enter_a_connection_name; public static String JSchNewConnectionPage_Port; public static String JSchNewConnectionPage_Port_is_not_valid; public static String JSchNewConnectionPage_Private_key_file_cannot_be_read; public static String JSchNewConnectionPage_Private_key_file_does_not_exist; public static String JSchNewConnectionPage_Private_key_file_is_invalid; public static String JSchNewConnectionPage_Private_key_path_cannot_be_empty; public static String JSchNewConnectionPage_Public_key_based_authentication; public static String JSchNewConnectionPage_Timeout; public static String JSchNewConnectionPage_Timeout_is_not_valid; public static String JSchNewConnectionPage_User; public static String JSchNewConnectionPage_User_name_cannot_be_empty; public static String JSchUIConnectionManager_Connection_Error; public static String JSchUIConnectionManager_Could_not_open_connection; private Messages() { // cannot create new instance } } messages.properties000077500000000000000000000062041272114001700413360ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/org/eclipse/remote/internal/jsch/ui/messages############################################################################### # Copyright (c) 2013 IBM Corporation. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # IBM Corporation - initial implementation ############################################################################### JSchConnectionPage_0=Use login shell JSchConnectionPage_1=Login shell command JSchConnectionPage_2=Login shell command cannot be empty JSchConnectionPage_A_connection_with_that_name_already_exists=A connection with that name already exists JSchConnectionPage_Edit_Connection=Edit Connection JSchConnectionPage_Edit_properties_of_an_existing_connection=Edit properties of an existing connection JSchConnectionPage_Initial_Message=Specify properties of a new connection JSchConnectionPage_Proxy=SSH Proxy Settings JSchConnectionPage_Help=If 'Local' is selected and proxy command is empty, no proxy is used.\nSee Network Connections for SOCKS and HTTP proxy options. JSchConnectionPage_KeysAtSSH2=Keys are set at Network Connections, SSH2 JSchConnectionPage_SelectCommand=Enter a local or remote command such as 'nc %h %p'. Can be empty for an ssh gateway. JSchConnectionPage_SelectConnection=Select 'Remote' for an ssh gateway or a remote proxy command. JSchConnectionPage_Settings0=Connection Settings JSchConnectionPage_selectProxyConnection=Please select a proxy connection JSchFileSystemContributor_0=Browse File System JSchNewConnectionPage_Advanced=Advanced JSchNewConnectionPage_Connection_name=Connection name: JSchNewConnectionPage_File_with_private_key=File with private key: JSchNewConnectionPage_Host=Host: JSchNewConnectionPage_Host_information=Host information JSchNewConnectionPage_Host_name_cannot_be_empty=Host name cannot be empty JSchNewConnectionPage_New_Connection=New Connection JSchNewConnectionPage_New_connection_properties=New connection properties JSchNewConnectionPage_Passphrase=Passphrase: JSchNewConnectionPage_Password=Password: JSchNewConnectionPage_Password_based_authentication=Password based authentication JSchNewConnectionPage_Please_enter_a_connection_name=Please enter a connection name JSchNewConnectionPage_Port=Port: JSchNewConnectionPage_Port_is_not_valid=Port is not valid JSchNewConnectionPage_Private_key_file_cannot_be_read=Private key file cannot be read JSchNewConnectionPage_Private_key_file_does_not_exist=Private key file does not exist JSchNewConnectionPage_Private_key_file_is_invalid=Private key file is invalid JSchNewConnectionPage_Private_key_path_cannot_be_empty=Private key path cannot be empty JSchNewConnectionPage_Public_key_based_authentication=Public key based authentication JSchNewConnectionPage_Timeout=Timeout: JSchNewConnectionPage_Timeout_is_not_valid=Timeout is not valid JSchNewConnectionPage_User=User: JSchNewConnectionPage_User_name_cannot_be_empty=User name cannot be empty JSchUIConnectionManager_Connection_Error=Connection Error JSchUIConnectionManager_Could_not_open_connection=Could not open connection wizards/000077500000000000000000000000001272114001700352605ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/org/eclipse/remote/internal/jsch/uiJSchConnectionPage.java000077500000000000000000000547741272114001700416130ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/org/eclipse/remote/internal/jsch/ui/wizards/** * Copyright (c) 2013, 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial Implementation * Patrick Tasse - [461541] fix handling of default attributes */ package org.eclipse.remote.internal.jsch.ui.wizards; import java.util.HashMap; import java.util.Map; import java.util.Set; import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.preference.PreferenceDialog; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionHostService; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.IRemotePortForwardingService; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.jsch.core.Activator; import org.eclipse.remote.internal.jsch.core.JSchConnection; import org.eclipse.remote.internal.jsch.ui.messages.Messages; import org.eclipse.remote.ui.widgets.RemoteConnectionWidget; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.FontMetrics; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Link; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.dialogs.PreferencesUtil; import org.eclipse.ui.forms.events.ExpansionEvent; import org.eclipse.ui.forms.events.IExpansionListener; import org.eclipse.ui.forms.widgets.ExpandableComposite; public class JSchConnectionPage extends WizardPage { private class DataModifyListener implements ModifyListener { @Override public synchronized void modifyText(ModifyEvent e) { validateFields(); getContainer().updateButtons(); } } private Text fConnectionName; private Button fPasswordButton; private Button fPublicKeyButton; private Button fUseLoginShellButton; private Text fHostText; private Text fUserText; private Text fPasswordText; private Text fPassphraseText; private Text fPortText; private Text fTimeoutText; private Text fLoginShellText; private String fInitialName = "Remote Host"; //$NON-NLS-1$ private Set fInvalidConnectionNames; private final Map fInitialAttributes = new HashMap(); private IRemoteConnectionWorkingCopy fConnection; private final IRemoteConnectionType fConnectionType; private final DataModifyListener fDataModifyListener = new DataModifyListener(); private RemoteConnectionWidget fProxyConnectionWidget; private Text fProxyCommandText; private static final String PREFS_PAGE_ID_NET_PROXY = "org.eclipse.ui.net.NetPreferences"; //$NON-NLS-1$ public JSchConnectionPage(IRemoteConnectionType connectionType) { super(Messages.JSchNewConnectionPage_New_Connection); fConnectionType = connectionType; setPageComplete(false); } /** * Create controls for the bottom (hideable) advanced composite * * @param mold * */ private void createAdvancedControls(final Composite parent) { ExpandableComposite expComp = new ExpandableComposite(parent, ExpandableComposite.TWISTIE); expComp.setText(Messages.JSchNewConnectionPage_Advanced); expComp.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); expComp.setExpanded(false); expComp.addExpansionListener(new IExpansionListener() { @Override public void expansionStateChanged(ExpansionEvent e) { for (int i = 0; i < 2; i++) { // sometimes the size compute isn't correct on first try Point newSize = parent.computeSize(SWT.DEFAULT, SWT.DEFAULT); Point currentSize = parent.getSize(); int deltaY = newSize.y - currentSize.y; Point shellSize = getShell().getSize(); shellSize.y += deltaY; getShell().setSize(shellSize); getShell().layout(true, true); } } @Override public void expansionStateChanging(ExpansionEvent e) { // Ignore } }); Composite advancedComp = new Composite(expComp, SWT.NONE); advancedComp.setLayout(new GridLayout(1, false)); advancedComp.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); Group settingsComp = new Group(advancedComp, SWT.NONE); settingsComp.setText(Messages.JSchConnectionPage_Settings0); settingsComp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); settingsComp.setLayout(new GridLayout(2, false)); Label portLabel = new Label(settingsComp, SWT.NONE); portLabel.setText(Messages.JSchNewConnectionPage_Port); fPortText = new Text(settingsComp, SWT.BORDER | SWT.SINGLE); fPortText.setText(Integer.toString(JSchConnection.DEFAULT_PORT)); fPortText.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false)); setTextFieldWidthInChars(fPortText, 5); Label timeoutLabel = new Label(settingsComp, SWT.NONE); timeoutLabel.setText(Messages.JSchNewConnectionPage_Timeout); fTimeoutText = new Text(settingsComp, SWT.BORDER | SWT.SINGLE); fTimeoutText.setText(Integer.toString(JSchConnection.DEFAULT_TIMEOUT)); fTimeoutText.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false)); setTextFieldWidthInChars(fTimeoutText, 5); fUseLoginShellButton = new Button(settingsComp, SWT.CHECK); fUseLoginShellButton.setText(Messages.JSchConnectionPage_0); fUseLoginShellButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1)); fUseLoginShellButton.addSelectionListener(new SelectionAdapter() { /* * (non-Javadoc) * * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent) */ @Override public void widgetSelected(SelectionEvent e) { validateFields(); updateEnablement(); } }); Label loginShellLabel = new Label(settingsComp, SWT.NONE); loginShellLabel.setText(Messages.JSchConnectionPage_1); fLoginShellText = new Text(settingsComp, SWT.BORDER | SWT.SINGLE); fLoginShellText.setText(JSchConnection.DEFAULT_LOGIN_SHELL_COMMAND); fLoginShellText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); fUseLoginShellButton.setSelection(JSchConnection.DEFAULT_USE_LOGIN_SHELL); Group proxyComp = new Group(advancedComp, SWT.NONE); proxyComp.setText(Messages.JSchConnectionPage_Proxy); proxyComp.setLayout(new GridLayout(1, false)); proxyComp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); createProxyControls(proxyComp); expComp.setClient(advancedComp); } private void createAuthControls(Composite parent) { Composite controls = new Composite(parent, SWT.NONE); controls.setLayout(new GridLayout(3, false)); controls.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); Label hostLabel = new Label(controls, SWT.NONE); hostLabel.setText(Messages.JSchNewConnectionPage_Host); fHostText = new Text(controls, SWT.BORDER | SWT.SINGLE); fHostText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1)); Label userLabel = new Label(controls, SWT.NONE); userLabel.setText(Messages.JSchNewConnectionPage_User); fUserText = new Text(controls, SWT.BORDER | SWT.SINGLE); fUserText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1)); // Key option box fPublicKeyButton = new Button(controls, SWT.RADIO); fPublicKeyButton.setText(Messages.JSchNewConnectionPage_Public_key_based_authentication); fPublicKeyButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1)); fPublicKeyButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { validateFields(); updateEnablement(); } }); Link link = new Link(controls, SWT.WRAP); final GridData linkLayoutData = new GridData(GridData.FILL_HORIZONTAL); link.setLayoutData(linkLayoutData); final String PREFS_PAGE_ID_NET_SSH = "org.eclipse.jsch.ui.SSHPreferences"; //$NON-NLS-1$ link.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { PreferenceDialog dlg = PreferencesUtil.createPreferenceDialogOn(getShell(), PREFS_PAGE_ID_NET_SSH, new String[] { PREFS_PAGE_ID_NET_SSH }, null); dlg.open(); } @Override public void widgetDefaultSelected(SelectionEvent e) { // ignore } }); link.setText(Messages.JSchConnectionPage_KeysAtSSH2); // Passphrase field Label passphraseLabel = new Label(controls, SWT.NONE); passphraseLabel.setText(Messages.JSchNewConnectionPage_Passphrase); fPassphraseText = new Text(controls, SWT.BORDER | SWT.SINGLE | SWT.PASSWORD); fPassphraseText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1)); // User option box fPasswordButton = new Button(controls, SWT.RADIO); fPasswordButton.setText(Messages.JSchNewConnectionPage_Password_based_authentication); fPasswordButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 3, 1)); fPasswordButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { validateFields(); updateEnablement(); } }); // Password field Label passwordLabel = new Label(controls, SWT.NONE); passwordLabel.setText(Messages.JSchNewConnectionPage_Password); fPasswordText = new Text(controls, SWT.BORDER | SWT.SINGLE | SWT.PASSWORD); fPasswordText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1)); fPasswordButton.setSelection(JSchConnection.DEFAULT_IS_PASSWORD); fPublicKeyButton.setSelection(!JSchConnection.DEFAULT_IS_PASSWORD); controls.setTabList( new Control[] { fHostText, fUserText, fPublicKeyButton, fPassphraseText, fPasswordButton, fPasswordText }); } @Override public void createControl(Composite parent) { if (fConnection == null) { setDescription(Messages.JSchNewConnectionPage_New_connection_properties); setTitle(Messages.JSchNewConnectionPage_New_Connection); setMessage(Messages.JSchConnectionPage_Initial_Message); } else { setDescription(Messages.JSchConnectionPage_Edit_properties_of_an_existing_connection); setTitle(Messages.JSchConnectionPage_Edit_Connection); } setErrorMessage(null); GridLayout topLayout = new GridLayout(2, false); final Composite topControl = new Composite(parent, SWT.NONE); setControl(topControl); topControl.setLayout(topLayout); Label label = new Label(topControl, SWT.NONE); label.setText(Messages.JSchNewConnectionPage_Connection_name); fConnectionName = new Text(topControl, SWT.BORDER | SWT.SINGLE); fConnectionName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); fConnectionName.setEnabled(fConnection == null); final Group authGroup = new Group(topControl, SWT.NONE); authGroup.setText(Messages.JSchNewConnectionPage_Host_information); authGroup.setLayout(new GridLayout(1, false)); authGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1)); createAuthControls(authGroup); createAdvancedControls(authGroup); try { loadValues(); } catch (CoreException e) { Activator.log(e.getStatus()); } /* * Register listeners after loading values so we don't trigger listeners */ registerListeners(); if (fConnection != null) { validateFields(); } updateEnablement(); } /** * Create controls for the bottom (hideable) proxy composite * * @param mold * */ private void createProxyControls(final Composite proxyComp) { Label lblConnection = new Label(proxyComp, SWT.WRAP); lblConnection.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); lblConnection.setText(Messages.JSchConnectionPage_SelectConnection); fProxyConnectionWidget = new RemoteConnectionWidget(proxyComp, SWT.NONE, null, 0); fProxyConnectionWidget.filterConnections(IRemoteConnectionHostService.class, IRemotePortForwardingService.class); Label lblCommand = new Label(proxyComp, SWT.WRAP); lblCommand.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); lblCommand.setText(Messages.JSchConnectionPage_SelectCommand); fProxyCommandText = new Text(proxyComp, SWT.BORDER); fProxyCommandText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Link link = new Link(proxyComp, SWT.WRAP); final GridData linkLayoutData = new GridData(GridData.FILL_HORIZONTAL); link.setLayoutData(linkLayoutData); link.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { PreferenceDialog dlg = PreferencesUtil.createPreferenceDialogOn(getShell(), PREFS_PAGE_ID_NET_PROXY, new String[] { PREFS_PAGE_ID_NET_PROXY }, null); dlg.open(); } @Override public void widgetDefaultSelected(SelectionEvent e) { // ignore } }); linkLayoutData.widthHint = 400; link.setText(Messages.JSchConnectionPage_Help); } public IRemoteConnectionWorkingCopy getConnection() { return fConnection; } /** * Check if the connection name is invalid. This only applies to new connections (when fConnection is null). * * @param name * connection name * @return true if the name is invalid, false otherwise */ private boolean isInvalidName(String name) { if (fConnection == null) { if (fInvalidConnectionNames == null) { return fConnectionType.getConnection(name) != null; } return fInvalidConnectionNames.contains(name); } return false; } private void loadValues() throws CoreException { IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class); if (fConnection != null) { fConnectionName.setText(fConnection.getName()); fHostText.setText(fConnection.getAttribute(JSchConnection.ADDRESS_ATTR)); fUserText.setText(fConnection.getAttribute(JSchConnection.USERNAME_ATTR)); String portStr = fConnection.getAttribute(JSchConnection.PORT_ATTR); fPortText.setText(portStr.isEmpty() ? Integer.toString(JSchConnection.DEFAULT_PORT) : portStr); String timeoutStr = fConnection.getAttribute(JSchConnection.TIMEOUT_ATTR); fTimeoutText.setText(timeoutStr.isEmpty() ? Integer.toString(JSchConnection.DEFAULT_TIMEOUT) : timeoutStr); String isPwdStr = fConnection.getAttribute(JSchConnection.IS_PASSWORD_ATTR); boolean isPwd = isPwdStr.isEmpty() ? JSchConnection.DEFAULT_IS_PASSWORD : Boolean.parseBoolean(isPwdStr); fPasswordButton.setSelection(isPwd); fPublicKeyButton.setSelection(!isPwd); fPasswordText.setText(fConnection.getSecureAttribute(JSchConnection.PASSWORD_ATTR)); fPassphraseText.setText(fConnection.getSecureAttribute(JSchConnection.PASSPHRASE_ATTR)); String useLoginShellStr = fConnection.getAttribute(JSchConnection.USE_LOGIN_SHELL_ATTR); boolean useLoginShell = useLoginShellStr.isEmpty() ? JSchConnection.DEFAULT_USE_LOGIN_SHELL : Boolean.parseBoolean(useLoginShellStr); fUseLoginShellButton.setSelection(useLoginShell); String loginShellStr = fConnection.getAttribute(JSchConnection.LOGIN_SHELL_COMMAND_ATTR); fLoginShellText.setText(loginShellStr.isEmpty() ? JSchConnection.DEFAULT_LOGIN_SHELL_COMMAND : loginShellStr); fProxyCommandText.setText(fConnection.getAttribute(JSchConnection.PROXYCOMMAND_ATTR)); JSchConnection proxyConn = fConnection.getService(JSchConnection.class).getProxyConnection(); if (proxyConn == null) { // Use local connection fProxyConnectionWidget.setConnection(manager.getLocalConnectionType().getConnections().get(0)); } else { fProxyConnectionWidget.setConnection(proxyConn.getRemoteConnection()); } } else { fConnectionName.setText(fInitialName); String host = fInitialAttributes.get(JSchConnection.ADDRESS_ATTR); if (host != null) { fHostText.setText(host); } String username = fInitialAttributes.get(JSchConnection.USERNAME_ATTR); if (username != null) { fUserText.setText(username); } String port = fInitialAttributes.get(JSchConnection.PORT_ATTR); if (port != null) { fPortText.setText(port); } String timeout = fInitialAttributes.get(JSchConnection.TIMEOUT_ATTR); if (timeout != null) { fTimeoutText.setText(timeout); } String isPwd = fInitialAttributes.get(JSchConnection.IS_PASSWORD_ATTR); if (isPwd != null) { fPasswordButton.setSelection(Boolean.parseBoolean(isPwd)); } String password = fInitialAttributes.get(JSchConnection.PASSWORD_ATTR); if (password != null) { fPasswordText.setText(password); } String passphrase = fInitialAttributes.get(JSchConnection.PASSPHRASE_ATTR); if (passphrase != null) { fPassphraseText.setText(passphrase); } String useLoginShell = fInitialAttributes.get(JSchConnection.USE_LOGIN_SHELL_ATTR); if (useLoginShell != null) { fUseLoginShellButton.setSelection(Boolean.parseBoolean(useLoginShell)); } String loginShell = fInitialAttributes.get(JSchConnection.LOGIN_SHELL_COMMAND_ATTR); if (loginShell != null) { fLoginShellText.setText(loginShell); } fProxyConnectionWidget.setConnection(manager.getLocalConnectionType().getConnections().get(0)); } } private void registerListeners() { fConnectionName.addModifyListener(fDataModifyListener); fHostText.addModifyListener(fDataModifyListener); fUserText.addModifyListener(fDataModifyListener); fPasswordText.addModifyListener(fDataModifyListener); fPassphraseText.addModifyListener(fDataModifyListener); fPortText.addModifyListener(fDataModifyListener); fTimeoutText.addModifyListener(fDataModifyListener); fLoginShellText.addModifyListener(fDataModifyListener); fProxyCommandText.addModifyListener(fDataModifyListener); fProxyConnectionWidget.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { validateFields(); getContainer().updateButtons(); } }); } public void setAddress(String address) { fInitialAttributes.put(JSchConnection.ADDRESS_ATTR, address); } public void setAttributes(Map attributes) { fInitialAttributes.putAll(attributes); } public void setConnection(IRemoteConnectionWorkingCopy connection) { fConnection = connection; } public void setConnectionName(String name) { fInitialName = name; } public void setInvalidConnectionNames(Set names) { fInvalidConnectionNames = names; } @Override public void setPageComplete(boolean complete) { super.setPageComplete(complete); if (complete) { storeValues(); } } public void setPort(int port) { fInitialAttributes.put(JSchConnection.PORT_ATTR, Integer.toString(port)); } private void setTextFieldWidthInChars(Text text, int chars) { text.setTextLimit(chars); Object data = text.getLayoutData(); if (data instanceof GridData) { GC gc = new GC(text); FontMetrics fm = gc.getFontMetrics(); int width = chars * fm.getAverageCharWidth(); gc.dispose(); ((GridData) data).widthHint = width; } } public void setUsername(String username) { fInitialAttributes.put(JSchConnection.USERNAME_ATTR, username); } private void storeValues() { if (fConnection == null) { try { fConnection = fConnectionType.newConnection(fConnectionName.getText().trim()); } catch (RemoteConnectionException e) { Activator.log(e); } } if (fConnection != null) { fConnection.setName(fConnectionName.getText().trim()); fConnection.setAttribute(JSchConnection.ADDRESS_ATTR, fHostText.getText().trim()); fConnection.setAttribute(JSchConnection.USERNAME_ATTR, fUserText.getText().trim()); fConnection.setSecureAttribute(JSchConnection.PASSWORD_ATTR, fPasswordText.getText().trim()); fConnection.setSecureAttribute(JSchConnection.PASSPHRASE_ATTR, fPassphraseText.getText().trim()); fConnection.setAttribute(JSchConnection.IS_PASSWORD_ATTR, Boolean.toString(fPasswordButton.getSelection())); fConnection.setAttribute(JSchConnection.TIMEOUT_ATTR, fTimeoutText.getText().trim()); fConnection.setAttribute(JSchConnection.PORT_ATTR, fPortText.getText().trim()); fConnection.setAttribute(JSchConnection.PROXYCOMMAND_ATTR, fProxyCommandText.getText().trim()); fConnection.setAttribute(JSchConnection.USE_LOGIN_SHELL_ATTR, Boolean.toString(fUseLoginShellButton.getSelection())); fConnection.setAttribute(JSchConnection.LOGIN_SHELL_COMMAND_ATTR, fLoginShellText.getText().trim()); IRemoteConnection proxyConnection = fProxyConnectionWidget.getConnection(); IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class); String proxyConnectionName = ""; //$NON-NLS-1$ if (proxyConnection != null && proxyConnection.getConnectionType() != manager.getLocalConnectionType()) { proxyConnectionName = proxyConnection.getName(); } fConnection.setAttribute(JSchConnection.PROXYCONNECTION_ATTR, proxyConnectionName); } } private void updateEnablement() { boolean isPasswordAuth = fPasswordButton.getSelection(); fPasswordText.setEnabled(isPasswordAuth); fPassphraseText.setEnabled(!isPasswordAuth); fLoginShellText.setEnabled(fUseLoginShellButton.getSelection()); } private String validateAdvanced() { try { Integer.parseInt(fPortText.getText().trim()); } catch (NumberFormatException ne) { return Messages.JSchNewConnectionPage_Port_is_not_valid; } try { Integer.parseInt(fTimeoutText.getText().trim()); } catch (NumberFormatException ne) { return Messages.JSchNewConnectionPage_Timeout_is_not_valid; } return null; } private void validateFields() { String message = null; if (fConnectionName.getText().trim().length() == 0) { message = Messages.JSchNewConnectionPage_Please_enter_a_connection_name; } else if (isInvalidName(fConnectionName.getText().trim())) { message = Messages.JSchConnectionPage_A_connection_with_that_name_already_exists; } else if (fHostText.getText().trim().length() == 0) { message = Messages.JSchNewConnectionPage_Host_name_cannot_be_empty; } else if (fUserText.getText().trim().length() == 0) { message = Messages.JSchNewConnectionPage_User_name_cannot_be_empty; } else if (fUseLoginShellButton.getSelection() && fLoginShellText.getText().trim().length() == 0) { message = Messages.JSchConnectionPage_2; } else if (fProxyConnectionWidget.getConnection() == null) { message = Messages.JSchConnectionPage_selectProxyConnection; } if (message == null) { message = validateAdvanced(); } setErrorMessage(message); setPageComplete(message == null); } } JSchConnectionWizard.java000077500000000000000000000035441272114001700421640ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.jsch.ui/src/org/eclipse/remote/internal/jsch/ui/wizards/** * Copyright (c) 2013 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial Implementation * */ package org.eclipse.remote.internal.jsch.ui.wizards; import java.util.Set; import org.eclipse.jface.wizard.Wizard; import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.ui.IRemoteUIConnectionWizard; import org.eclipse.swt.widgets.Shell; public class JSchConnectionWizard extends Wizard implements IRemoteUIConnectionWizard { private final Shell fShell; private final JSchConnectionPage fPage; public JSchConnectionWizard(Shell shell, IRemoteConnectionType connectionType) { fShell = shell; fPage = new JSchConnectionPage(connectionType); } @Override public void addPages() { super.addPages(); addPage(fPage); } public IRemoteConnectionWorkingCopy open() { WizardDialog dialog = new WizardDialog(fShell, this); dialog.setBlockOnOpen(true); if (dialog.open() == WizardDialog.OK) { return fPage.getConnection(); } return null; } @Override public IRemoteConnectionWorkingCopy getConnection() { return fPage.getConnection(); } @Override public boolean performCancel() { return true; } @Override public boolean performFinish() { return true; } public void setConnection(IRemoteConnectionWorkingCopy connection) { fPage.setConnection(connection); } public void setConnectionName(String name) { fPage.setConnectionName(name); } public void setInvalidConnectionNames(Set names) { fPage.setInvalidConnectionNames(names); } } org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/000077500000000000000000000000001272114001700250425ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/.classpath000066400000000000000000000005611272114001700270270ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/.gitignore000066400000000000000000000000061272114001700270260ustar00rootroot00000000000000/bin/ org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/.project000066400000000000000000000012271272114001700265130ustar00rootroot00000000000000 org.eclipse.remote.serial.core org.eclipse.jdt.core.javabuilder org.eclipse.pde.ManifestBuilder org.eclipse.pde.SchemaBuilder org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/.settings/000077500000000000000000000000001272114001700267605ustar00rootroot00000000000000org.eclipse.jdt.core.prefs000066400000000000000000000005451272114001700336670ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/.settingseclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/META-INF/000077500000000000000000000000001272114001700262025ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/META-INF/MANIFEST.MF000066400000000000000000000010601272114001700276310ustar00rootroot00000000000000Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %bundleName Bundle-SymbolicName: org.eclipse.remote.serial.core;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-Activator: org.eclipse.remote.serial.internal.core.Activator Bundle-Vendor: %providerName Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.remote.serial.core Bundle-Localization: plugin Import-Package: org.eclipse.cdt.serial, org.eclipse.core.runtime, org.eclipse.osgi.util, org.eclipse.remote.core, org.osgi.framework org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/about.html000066400000000000000000000024471272114001700270510ustar00rootroot00000000000000 About

About This Content

May 2, 2006

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/about.ini000066400000000000000000000016471272114001700266650ustar00rootroot00000000000000# about.ini # contains information about a feature # java.io.Properties file (ISO 8859-1 with "\" escapes) # "%key" are externalized strings defined in about.properties # This file does not need to be translated. # Property "aboutText" contains blurb for "About" dialog (translated) aboutText=%blurb # Property "windowImage" contains path to window icon (16x16) # needed for primary features only # Property "featureImage" contains path to feature image (32x32) featureImage=ptp_logo_icon32.png # Property "aboutImage" contains path to product image (500x330 or 115x164) # needed for primary features only # Property "appName" contains name of the application (not translated) # needed for primary features only # Property "welcomePage" contains path to welcome page (special XML-based format) # optional # Property "welcomePerspective" contains the id of the perspective in which the # welcome page is to be opened. # optional org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/about.mappings000066400000000000000000000002501272114001700277110ustar00rootroot00000000000000# about.mappings # contains fill-ins for about.properties # java.io.Properties file (ISO 8859-1 with "\" escapes) # This file does not need to be translated. 0=@build@org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/about.properties000066400000000000000000000014231272114001700302720ustar00rootroot00000000000000############################################################################### # Copyright (c) 2015 QNX Software Systems and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # QNX Software Systems - initial API and implementation ############################################################################### # NLS_MESSAGEFORMAT_NONE # NLS_ENCODING=UTF-8 blurb=Serial Port Remote Services\n\ \n\ Version: {featureVersion}\n\ Build id: {0}\n\ \n\ Copyright (c) 2015 QNX Software Systems, and others. All rights reserved.\n\ Visit http://www.eclipse.org/ptp\n org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/build.properties000066400000000000000000000004511272114001700302570ustar00rootroot00000000000000source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ plugin.xml,\ about.html,\ about.ini,\ about.mappings,\ about.properties,\ ptp_logo_icon32.png,\ plugin.properties org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/plugin.properties000066400000000000000000000001041272114001700304510ustar00rootroot00000000000000bundleName = Remote Serial Port Services providerName = Eclipse PTP org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/plugin.xml000066400000000000000000000015621272114001700270660ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/pom.xml000066400000000000000000000012171272114001700263600ustar00rootroot00000000000000 4.0.0 org.eclipse.remote remote-parent 2.1.0-SNAPSHOT ../../releng/org.eclipse.remote.build/pom.xml org.eclipse.remote.serial.core eclipse-plugin 1.0.0-SNAPSHOT org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/ptp_logo_icon32.png000066400000000000000000001476271272114001700305710ustar00rootroot00000000000000PNG  IHDR VόsBIT|d pHYs  ~tEXtSoftwareAdobe Fireworks CS3F:prVWxn18cw^ mL@ApD{E**Ur ^GGo#T G6^7gfq*ND׼iu3&obkfJ꺪ouU8>iU*Vot*aYkUσaaaaRD2{ϡ㌑ @ rcR Zu-P2/ L# .nI>sN;3#7r;J-Ʒ֍,6h> j[jI4IfZ) a\4->Dg9HR]kz :! Euan+cQ0 0 ,S!UOaaɀnu鯋X﯏b3*wo6ԣjvNN^?-OQ%1 Z&&gǻUυaU~5ɟfFHmkBF)37!mkTSx}[sƲ.vVlG|KVe?U}<% 7EQSCPvdKxOw .HʁYH |MwO}}zܴ'7ƴ;؊lܘ7qo˿ѧo^ǿp49:\~w}ß卶4O{vN><3(1_D 8:#]ylMvgއlANʜ]ڴ{6[]=A6hsv:}@>mY]}Jfo[yҧC /9hӅ&lLp3-6M{ouK(/3㖘wَv|>Bٕ6fL2ѕx^ =ɰ6e &iN;e4uj5v/|AFP-PQ0„YB-iYhJηwBf%F!CڦxyPA7|ƹV7cu4l~+SH::ad ly[9CHPzHw(RC2 #sEȘ;J/(uHF0fU\6ծr<3VTc0 &00Àv>pG3A3htΠ4z,Ӭg)=F-}CZm~\߆_BAWœL,%DTFFd?rfuFɠ2T6fP3V[!vf1 c.P]- "p 0:̇ UsŐlMhZsY?/c6X7]4DJ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^ٿ$3z*FP!SPRXNh`mZCCub>sx':~NieIҗyu9N-q7m*ji=]yqA@% @-bss*0q=&)$3+AlR/_Ӭ]07я{ib}dbêqC|ѷ8"gu^Ͼmjl)'5C@i0E$$Q"ؐ$0%ve9j?{w>c?݋Ͽ1q%oϾ[m\G~oH]QbV6Z&PCAp 8#q {ԩ_`a]kGTԮ~͜ҒߔG/ɨb}߯ p-\_4˳.o/̰W_|=R*!;bQ{/Şr.xޝJ᳾rg㢁B C0Kɬz ǒِn;DN1,'sbl+֯>Nx0#+-A!`hm W`A^ztayzO^ihvGt~5gGׯBm,4;CQ+nKuuk̯=_EQo),@T|,Wka!'&WT a?|ED> me(F*B{.vS}@DNs')?"HyIENDB`org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/src/000077500000000000000000000000001272114001700256315ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/src/org/000077500000000000000000000000001272114001700264205ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/src/org/eclipse/000077500000000000000000000000001272114001700300445ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/src/org/eclipse/remote/000077500000000000000000000000001272114001700313375ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/src/org/eclipse/remote/serial/000077500000000000000000000000001272114001700326165ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/src/org/eclipse/remote/serial/core/000077500000000000000000000000001272114001700335465ustar00rootroot00000000000000ISerialPortService.java000066400000000000000000000023131272114001700400470ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/src/org/eclipse/remote/serial/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems, and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - initial contribution *******************************************************************************/ package org.eclipse.remote.serial.core; import org.eclipse.cdt.serial.SerialPort; import org.eclipse.remote.core.IRemoteConnection; public interface ISerialPortService extends IRemoteConnection.Service { static final String CONNECTION_TYPE_ID = "org.eclipse.remote.serial.core.connectionType"; //$NON-NLS-1$ static final String PORT_NAME_ATTR = "serial.portName"; //$NON-NLS-1$ static final String BAUD_RATE_ATTR = "serial.baudRate"; //$NON-NLS-1$ static final String BYTE_SIZE_ATTR = "serial.byteSize"; //$NON-NLS-1$ static final String PARITY_ATTR = "serial.parity"; //$NON-NLS-1$ static final String STOP_BITS_ATTR = "serial.stopBits"; //$NON-NLS-1$ SerialPort getSerialPort(); } SerialPortCommandShell.java000066400000000000000000000050601272114001700407060ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/src/org/eclipse/remote/serial/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems, and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - initial contribution *******************************************************************************/ package org.eclipse.remote.serial.core; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import org.eclipse.cdt.serial.SerialPort; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteProcess; import org.eclipse.remote.core.IRemoteProcessBuilder; import org.eclipse.remote.serial.internal.core.Activator; public class SerialPortCommandShell implements IRemoteProcess { private final IRemoteConnection remoteConnection; private final SerialPort serialPort; public SerialPortCommandShell(IRemoteConnection remoteConnection, SerialPort serialPort) throws IOException { this.remoteConnection = remoteConnection; this.serialPort = serialPort; serialPort.open(); } @Override public synchronized void destroy() { if (serialPort.isOpen()) { try { serialPort.close(); } catch (IOException e) { Activator.log(e); } notifyAll(); } } @Override public int exitValue() { return 0; } @Override public InputStream getErrorStream() { return new InputStream() { @Override public int read() throws IOException { synchronized (SerialPortCommandShell.this) { if (serialPort.isOpen()) { try { wait(); } catch (InterruptedException e) { } } } return 0; } }; } @Override public InputStream getInputStream() { return serialPort.getInputStream(); } @Override public OutputStream getOutputStream() { return serialPort.getOutputStream(); } @Override public synchronized int waitFor() throws InterruptedException { if (serialPort.isOpen()) { wait(); } return 0; } @Override public boolean isCompleted() { return false; } @Override public IRemoteConnection getRemoteConnection() { return remoteConnection; } @Override public T getService(Class service) { return null; } @Override public boolean hasService(Class service) { return false; } @Override public IRemoteProcessBuilder getProcessBuilder() { return null; } } SerialPortConnection.java000066400000000000000000000060601272114001700404400ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/src/org/eclipse/remote/serial/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems, and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - initial contribution *******************************************************************************/ package org.eclipse.remote.serial.core; import java.io.IOException; import org.eclipse.cdt.serial.BaudRate; import org.eclipse.cdt.serial.ByteSize; import org.eclipse.cdt.serial.Parity; import org.eclipse.cdt.serial.SerialPort; import org.eclipse.cdt.serial.StopBits; import org.eclipse.remote.core.IRemoteCommandShellService; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnection.Service; import org.eclipse.remote.core.IRemoteProcess; import org.eclipse.remote.serial.internal.core.Activator; import org.eclipse.remote.serial.internal.core.Messages; public class SerialPortConnection implements ISerialPortService, IRemoteCommandShellService { private final IRemoteConnection remoteConnection; private SerialPort serialPort; private SerialPortConnection(IRemoteConnection remoteConnection) { this.remoteConnection = remoteConnection; } public static class Factory implements IRemoteConnection.Service.Factory { @SuppressWarnings("unchecked") @Override public T getService(IRemoteConnection remoteConnection, Class service) { if (ISerialPortService.class.equals(service)) { return (T) new SerialPortConnection(remoteConnection); } else if (IRemoteCommandShellService.class.equals(service)) { return (T) getService(remoteConnection, ISerialPortService.class); } return null; } } @Override public IRemoteConnection getRemoteConnection() { return remoteConnection; } @Override public SerialPort getSerialPort() { if (serialPort == null) { String portName = remoteConnection.getAttribute(PORT_NAME_ATTR); if (portName != null) { serialPort = new SerialPort(portName); try { serialPort.setBaudRate(BaudRate.fromStringIndex(Integer.parseInt(remoteConnection.getAttribute(BAUD_RATE_ATTR)))); serialPort.setByteSize(ByteSize.fromStringIndex(Integer.parseInt(remoteConnection.getAttribute(BYTE_SIZE_ATTR)))); serialPort.setParity(Parity.fromStringIndex(Integer.parseInt(remoteConnection.getAttribute(PARITY_ATTR)))); serialPort.setStopBits(StopBits.fromStringIndex(Integer.parseInt(remoteConnection.getAttribute(STOP_BITS_ATTR)))); } catch (IOException e) { Activator.log(e); } } } return serialPort; } @Override public IRemoteProcess getCommandShell(int flags) throws IOException { SerialPort serialPort = getSerialPort(); if (serialPort == null) { throw new IOException(Messages.SerialPortConnection_SerialPortNotAvailable); } return new SerialPortCommandShell(remoteConnection, getSerialPort()); } } internal/000077500000000000000000000000001272114001700343535ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/src/org/eclipse/remote/serialcore/000077500000000000000000000000001272114001700353035ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/src/org/eclipse/remote/serial/internalActivator.java000066400000000000000000000025631272114001700401100ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/src/org/eclipse/remote/serial/internal/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems, and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - initial contribution *******************************************************************************/ package org.eclipse.remote.serial.internal.core; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Status; import org.osgi.framework.BundleContext; public class Activator extends Plugin { private static Plugin plugin; public void start(BundleContext bundleContext) throws Exception { plugin = this; } public void stop(BundleContext bundleContext) throws Exception { plugin = null; } public static void log(IStatus status) { plugin.getLog().log(status); } public static void log(Exception exception) { if (exception instanceof CoreException) { log(((CoreException) exception).getStatus()); } else { log(new Status(IStatus.ERROR, plugin.getBundle().getSymbolicName(), exception.getLocalizedMessage(), exception)); } } } Messages.java000066400000000000000000000016761272114001700377270ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/src/org/eclipse/remote/serial/internal/core/******************************************************************************* * Copyright (c) 2015 QNX Software Systems, and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - initial contribution *******************************************************************************/ package org.eclipse.remote.serial.internal.core; import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.remote.serial.internal.core.messages"; //$NON-NLS-1$ public static String SerialPortConnection_SerialPortNotAvailable; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); } private Messages() { } } messages.properties000066400000000000000000000011221272114001700412240ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.core/src/org/eclipse/remote/serial/internal/core################################################################################ # Copyright (c) 2015 QNX Software Systems, and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # QNX Software Systems - initial contribution ################################################################################ SerialPortConnection_SerialPortNotAvailable=Serial port not available. org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/000077500000000000000000000000001272114001700245275ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/.classpath000066400000000000000000000005611272114001700265140ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/.gitignore000066400000000000000000000000061272114001700265130ustar00rootroot00000000000000/bin/ org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/.project000066400000000000000000000012251272114001700261760ustar00rootroot00000000000000 org.eclipse.remote.serial.ui org.eclipse.jdt.core.javabuilder org.eclipse.pde.ManifestBuilder org.eclipse.pde.SchemaBuilder org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/.settings/000077500000000000000000000000001272114001700264455ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/.settings/org.eclipse.jdt.core.prefs000066400000000000000000000005451272114001700334330ustar00rootroot00000000000000eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/META-INF/000077500000000000000000000000001272114001700256675ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/META-INF/MANIFEST.MF000066400000000000000000000020511272114001700273170ustar00rootroot00000000000000Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %bundleName Bundle-SymbolicName: org.eclipse.remote.serial.ui;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-Activator: org.eclipse.remote.serial.internal.ui.Activator Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Bundle-Vendor: %providerName Bundle-Localization: plugin Export-Package: org.eclipse.remote.serial.ui Import-Package: org.eclipse.cdt.serial, org.eclipse.core.expressions, org.eclipse.core.runtime, org.eclipse.jface.dialogs, org.eclipse.jface.operation, org.eclipse.jface.preference, org.eclipse.jface.resource, org.eclipse.jface.viewers, org.eclipse.jface.window, org.eclipse.jface.wizard, org.eclipse.osgi.util, org.eclipse.remote.core, org.eclipse.remote.core.exception, org.eclipse.remote.serial.core, org.eclipse.remote.ui, org.eclipse.swt, org.eclipse.swt.events, org.eclipse.swt.graphics, org.eclipse.swt.layout, org.eclipse.swt.widgets, org.eclipse.ui, org.eclipse.ui.dialogs, org.eclipse.ui.plugin, org.osgi.framework org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/about.html000066400000000000000000000024471272114001700265360ustar00rootroot00000000000000 About

About This Content

May 2, 2006

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/about.ini000066400000000000000000000016471272114001700263520ustar00rootroot00000000000000# about.ini # contains information about a feature # java.io.Properties file (ISO 8859-1 with "\" escapes) # "%key" are externalized strings defined in about.properties # This file does not need to be translated. # Property "aboutText" contains blurb for "About" dialog (translated) aboutText=%blurb # Property "windowImage" contains path to window icon (16x16) # needed for primary features only # Property "featureImage" contains path to feature image (32x32) featureImage=ptp_logo_icon32.png # Property "aboutImage" contains path to product image (500x330 or 115x164) # needed for primary features only # Property "appName" contains name of the application (not translated) # needed for primary features only # Property "welcomePage" contains path to welcome page (special XML-based format) # optional # Property "welcomePerspective" contains the id of the perspective in which the # welcome page is to be opened. # optional org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/about.mappings000066400000000000000000000002501272114001700273760ustar00rootroot00000000000000# about.mappings # contains fill-ins for about.properties # java.io.Properties file (ISO 8859-1 with "\" escapes) # This file does not need to be translated. 0=@build@org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/about.properties000066400000000000000000000014231272114001700277570ustar00rootroot00000000000000############################################################################### # Copyright (c) 2015 QNX Software Systems and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # QNX Software Systems - initial API and implementation ############################################################################### # NLS_MESSAGEFORMAT_NONE # NLS_ENCODING=UTF-8 blurb=Serial Port Remote Services\n\ \n\ Version: {featureVersion}\n\ Build id: {0}\n\ \n\ Copyright (c) 2015 QNX Software Systems, and others. All rights reserved.\n\ Visit http://www.eclipse.org/ptp\n org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/build.properties000066400000000000000000000005011272114001700277400ustar00rootroot00000000000000source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ plugin.xml,\ about.html,\ about.ini,\ about.mappings,\ about.properties,\ ptp_logo_icon32.png,\ icons/,\ plugin.properties org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/icons/000077500000000000000000000000001272114001700256425ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/icons/serial.png000066400000000000000000000006321272114001700276300ustar00rootroot00000000000000PNG  IHDRabKGD pHYs+tIME ;eiTXtCommentCreated with GIMPd.eIDAT8풱@(H2y_D}tD\{W:0L5 꺶duӉJU%0 PǓ(PU9pVf\.D녈L"z,K'ƈqX,ǃrafQU>lfi=9gڶgsv;RJkl6f3rΌ0~bQ x$@JUU|>o?:uIENDB`org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/plugin.properties000066400000000000000000000001071272114001700301410ustar00rootroot00000000000000bundleName = Remote Serial Port Services UI providerName = Eclipse PTP org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/plugin.xml000066400000000000000000000021331272114001700265460ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/pom.xml000066400000000000000000000012151272114001700260430ustar00rootroot00000000000000 4.0.0 org.eclipse.remote remote-parent 2.1.0-SNAPSHOT ../../releng/org.eclipse.remote.build/pom.xml org.eclipse.remote.serial.ui eclipse-plugin 1.0.0-SNAPSHOT org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/ptp_logo_icon32.png000066400000000000000000001476271272114001700302560ustar00rootroot00000000000000PNG  IHDR VόsBIT|d pHYs  ~tEXtSoftwareAdobe Fireworks CS3F:prVWxn18cw^ mL@ApD{E**Ur ^GGo#T G6^7gfq*ND׼iu3&obkfJ꺪ouU8>iU*Vot*aYkUσaaaaRD2{ϡ㌑ @ rcR Zu-P2/ L# .nI>sN;3#7r;J-Ʒ֍,6h> j[jI4IfZ) a\4->Dg9HR]kz :! Euan+cQ0 0 ,S!UOaaɀnu鯋X﯏b3*wo6ԣjvNN^?-OQ%1 Z&&gǻUυaU~5ɟfFHmkBF)37!mkTSx}[sƲ.vVlG|KVe?U}<% 7EQSCPvdKxOw .HʁYH |MwO}}zܴ'7ƴ;؊lܘ7qo˿ѧo^ǿp49:\~w}ß卶4O{vN><3(1_D 8:#]ylMvgއlANʜ]ڴ{6[]=A6hsv:}@>mY]}Jfo[yҧC /9hӅ&lLp3-6M{ouK(/3㖘wَv|>Bٕ6fL2ѕx^ =ɰ6e &iN;e4uj5v/|AFP-PQ0„YB-iYhJηwBf%F!CڦxyPA7|ƹV7cu4l~+SH::ad ly[9CHPzHw(RC2 #sEȘ;J/(uHF0fU\6ծr<3VTc0 &00Àv>pG3A3htΠ4z,Ӭg)=F-}CZm~\߆_BAWœL,%DTFFd?rfuFɠ2T6fP3V[!vf1 c.P]- "p 0:̇ UsŐlMhZsY?/c6X7]4DJ=tD{"#DdnC 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!SPRXNh`mZCCub>sx':~NieIҗyu9N-q7m*ji=]yqA@% @-bss*0q=&)$3+AlR/_Ӭ]07я{ib}dbêqC|ѷ8"gu^Ͼmjl)'5C@i0E$$Q"ؐ$0%ve9j?{w>c?݋Ͽ1q%oϾ[m\G~oH]QbV6Z&PCAp 8#q {ԩ_`a]kGTԮ~͜ҒߔG/ɨb}߯ p-\_4˳.o/̰W_|=R*!;bQ{/Şr.xޝJ᳾rg㢁B C0Kɬz ǒِn;DN1,'sbl+֯>Nx0#+-A!`hm W`A^ztayzO^ihvGt~5gGׯBm,4;CQ+nKuuk̯=_EQo),@T|,Wka!'&WT a?|ED> me(F*B{.vS}@DNs')?"HyIENDB`org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/src/000077500000000000000000000000001272114001700253165ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/src/org/000077500000000000000000000000001272114001700261055ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/000077500000000000000000000000001272114001700275315ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/remote/000077500000000000000000000000001272114001700310245ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/remote/serial/000077500000000000000000000000001272114001700323035ustar00rootroot00000000000000internal/000077500000000000000000000000001272114001700340405ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/remote/serialui/000077500000000000000000000000001272114001700344555ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/remote/serial/internalActivator.java000066400000000000000000000042711272114001700372600ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/remote/serial/internal/ui/******************************************************************************* * Copyright (c) 2015 QNX Software Systems, and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - initial contribution *******************************************************************************/ package org.eclipse.remote.serial.internal.ui; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; /** * The activator class controls the plug-in life cycle */ public class Activator extends AbstractUIPlugin { // The plug-in ID public static final String PLUGIN_ID = "org.eclipse.remote.serial.ui"; //$NON-NLS-1$ // Image keys public static final String IMG_CONNECTION_TYPE = PLUGIN_ID + ".connectionType"; //$NON-NLS-1$ // The shared instance private static Activator plugin; public void start(BundleContext context) throws Exception { super.start(context); plugin = this; getImageRegistry().put(IMG_CONNECTION_TYPE, imageDescriptorFromPlugin(PLUGIN_ID, "/icons/serial.png")); //$NON-NLS-1$ } public void stop(BundleContext context) throws Exception { plugin = null; super.stop(context); } /** * Returns the shared instance * * @return the shared instance */ public static Activator getDefault() { return plugin; } public static void log(IStatus status) { plugin.getLog().log(status); } public static void log(Exception e) { if (e instanceof CoreException) { log(((CoreException) e).getStatus()); } else { log(new Status(IStatus.ERROR, PLUGIN_ID, e.getLocalizedMessage(), e)); } } public static T getService(Class service) { BundleContext context = plugin.getBundle().getBundleContext(); ServiceReference ref = context.getServiceReference(service); return ref != null ? context.getService(ref) : null; } } Messages.java000066400000000000000000000026331272114001700370730ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/remote/serial/internal/ui/******************************************************************************* * Copyright (c) 2015 QNX Software Systems, and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - initial contribution *******************************************************************************/ package org.eclipse.remote.serial.internal.ui; import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.remote.serial.internal.ui.messages"; //$NON-NLS-1$ public static String NewSerialPortConnectionWizardPage_BaudRateLabel; public static String NewSerialPortConnectionWizardPage_ByteSizeLabel; public static String NewSerialPortConnectionWizardPage_Description; public static String NewSerialPortConnectionWizardPage_NameLabel; public static String NewSerialPortConnectionWizardPage_ParityLabel; public static String NewSerialPortConnectionWizardPage_PortLabel; public static String NewSerialPortConnectionWizardPage_StopBitsLabel; public static String NewSerialPortConnectionWizardPage_Title; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); } private Messages() { } } SerialPortConnectionsUI.java000066400000000000000000000060011272114001700420420ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/remote/serial/internal/ui/******************************************************************************* * Copyright (c) 2015 QNX Software Systems, and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - initial contribution *******************************************************************************/ package org.eclipse.remote.serial.internal.ui; import java.lang.reflect.InvocationTargetException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionType.Service; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.serial.ui.NewSerialPortConnectionWizard; import org.eclipse.remote.ui.AbstractRemoteUIConnectionService; import org.eclipse.remote.ui.IRemoteUIConnectionService; import org.eclipse.remote.ui.IRemoteUIConnectionWizard; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Shell; public class SerialPortConnectionsUI extends AbstractRemoteUIConnectionService { private final IRemoteConnectionType connectionType; private SerialPortConnectionsUI(IRemoteConnectionType connectionType) { this.connectionType = connectionType; } public static class Factory implements IRemoteConnectionType.Service.Factory { @SuppressWarnings("unchecked") @Override public T getService(IRemoteConnectionType connectionType, Class service) { if (IRemoteUIConnectionService.class.equals(service)) { return (T) new SerialPortConnectionsUI(connectionType); } return null; } } @Override public IRemoteConnectionType getConnectionType() { return connectionType; } @Override public IRemoteUIConnectionWizard getConnectionWizard(Shell shell) { return new NewSerialPortConnectionWizard(shell, connectionType); } @Override public void openConnectionWithProgress(Shell shell, IRunnableContext context, final IRemoteConnection connection) { try { context.run(false, true, new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { connection.open(monitor); } catch (RemoteConnectionException e) { Activator.log(e.getStatus()); } } }); } catch (InvocationTargetException | InterruptedException e) { Activator.log(e); } } @Override public ILabelProvider getLabelProvider() { return new DefaultLabelProvider() { @Override public Image getImage(Object element) { return Activator.getDefault().getImageRegistry().get(Activator.IMG_CONNECTION_TYPE); } }; } } messages.properties000066400000000000000000000017751272114001700404140ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/remote/serial/internal/ui################################################################################ # Copyright (c) 2015 QNX Software Systems, and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # QNX Software Systems - initial contribution ################################################################################ NewSerialPortConnectionWizardPage_BaudRateLabel=Baud rate: NewSerialPortConnectionWizardPage_ByteSizeLabel=Data size: NewSerialPortConnectionWizardPage_Description=New serial port connection settings NewSerialPortConnectionWizardPage_NameLabel=Connection name: NewSerialPortConnectionWizardPage_ParityLabel=Parity: NewSerialPortConnectionWizardPage_PortLabel=Serial port: NewSerialPortConnectionWizardPage_StopBitsLabel=Stop bits: NewSerialPortConnectionWizardPage_Title=New Serial Port Connection org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/remote/serial/ui/000077500000000000000000000000001272114001700327205ustar00rootroot00000000000000NewSerialPortConnectionWizard.java000066400000000000000000000060071272114001700414460ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/remote/serial/ui/******************************************************************************* * Copyright (c) 2015 QNX Software Systems, and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - initial contribution *******************************************************************************/ package org.eclipse.remote.serial.ui; import java.util.Set; import org.eclipse.jface.wizard.Wizard; import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.serial.core.ISerialPortService; import org.eclipse.remote.serial.internal.ui.Activator; import org.eclipse.remote.ui.IRemoteUIConnectionWizard; import org.eclipse.swt.widgets.Shell; public class NewSerialPortConnectionWizard extends Wizard implements IRemoteUIConnectionWizard { private NewSerialPortConnectionWizardPage page; private IRemoteConnectionWorkingCopy workingCopy; private Shell shell; private IRemoteConnectionType connectionType; public NewSerialPortConnectionWizard(Shell shell, IRemoteConnectionType connectionType) { this.shell = shell; this.connectionType = connectionType; } @Override public void addPages() { page = new NewSerialPortConnectionWizardPage(); addPage(page); } @Override public boolean performFinish() { if (getConnection() == null) { return false; } workingCopy.setAttribute(ISerialPortService.PORT_NAME_ATTR, page.getPortName()); workingCopy.setAttribute(ISerialPortService.BAUD_RATE_ATTR, Integer.toString(page.getBaudRateIndex())); workingCopy.setAttribute(ISerialPortService.BYTE_SIZE_ATTR, Integer.toString(page.getByteSizeIndex())); workingCopy.setAttribute(ISerialPortService.PARITY_ATTR, Integer.toString(page.getParityIndex())); workingCopy.setAttribute(ISerialPortService.STOP_BITS_ATTR, Integer.toString(page.getStopBitsIndex())); return true; } @Override public IRemoteConnectionWorkingCopy open() { WizardDialog dialog = new WizardDialog(shell, this); dialog.setBlockOnOpen(true); if (dialog.open() == WizardDialog.OK) { return getConnection(); } return null; } @Override public IRemoteConnectionWorkingCopy getConnection() { if (workingCopy == null) { try { workingCopy = connectionType.newConnection(page.getConnectionName()); } catch (RemoteConnectionException e) { Activator.log(e.getStatus()); } } return workingCopy; } @Override public void setConnection(IRemoteConnectionWorkingCopy connection) { workingCopy = connection; } @Override public void setConnectionName(String name) { // TODO Auto-generated method stub } @Override public void setInvalidConnectionNames(Set names) { // TODO Auto-generated method stub } } NewSerialPortConnectionWizardPage.java000066400000000000000000000037051272114001700422450ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/remote/serial/ui/******************************************************************************* * Copyright (c) 2015 QNX Software Systems, and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - initial contribution *******************************************************************************/ package org.eclipse.remote.serial.ui; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.remote.serial.internal.ui.Messages; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; public class NewSerialPortConnectionWizardPage extends WizardPage { protected SerialPortConnectionBlock block; public NewSerialPortConnectionWizardPage() { super(NewSerialPortConnectionWizardPage.class.getName()); setDescription(Messages.NewSerialPortConnectionWizardPage_Description); setTitle(Messages.NewSerialPortConnectionWizardPage_Title); block = new SerialPortConnectionBlock(); block.addUpdateListener(block.new SerialBlockUpdateListener() { @Override public void update() { setPageComplete(block.isComplete()); } }); } @Override public void createControl(Composite parent) { Composite comp = new Composite(parent, SWT.NONE); comp.setLayout(new GridLayout(2, false)); block.createBlock(comp, null); setControl(comp); } public String getConnectionName() { return block.getConnectionName(); } public String getPortName() { return block.getPortName(); } public int getBaudRateIndex() { return block.getBaudRateIndex(); } public int getByteSizeIndex() { return block.getByteSizeIndex(); } public int getParityIndex() { return block.getParityIndex(); } public int getStopBitsIndex() { return block.getStopBitsIndex(); } } SerialPortConnectionBlock.java000066400000000000000000000172001272114001700405630ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/remote/serial/ui/******************************************************************************* * Copyright (c) 2016 QNX Software Systems, and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - initial contribution *******************************************************************************/ package org.eclipse.remote.serial.ui; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.eclipse.cdt.serial.BaudRate; import org.eclipse.cdt.serial.ByteSize; import org.eclipse.cdt.serial.Parity; import org.eclipse.cdt.serial.SerialPort; import org.eclipse.cdt.serial.StopBits; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.serial.core.ISerialPortService; import org.eclipse.remote.serial.internal.ui.Activator; import org.eclipse.remote.serial.internal.ui.Messages; import org.eclipse.swt.SWT; import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.KeyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; public class SerialPortConnectionBlock { private String name; private String portName; private int baudRateIndex; private int byteSizeIndex; private int parityIndex; private int stopBitsIndex; private String[] portNames; private Text nameText; private Combo portCombo; private Combo baudRateCombo; private Combo byteSizeCombo; private Combo parityCombo; private Combo stopBitsCombo; private boolean isComplete; private List listeners = new ArrayList<>(); /** * Creates the UI elements for the SerialPortConnectionBlock * * @param comp - parent composite * @param wc - an IRemoteConnectionWorkingCopy to populate the default values from. Can be null. */ public void createBlock(Composite comp, IRemoteConnectionWorkingCopy wc) { String name = ""; String connectionPortName = ""; int baudRateStringIndex = BaudRate.getStringIndex(BaudRate.getDefault()); int byteSizeStringIndex = ByteSize.getStringIndex(ByteSize.getDefault()); int parityStringIndex = Parity.getStringIndex(Parity.getDefault()); int stopBitsStringIndex = StopBits.getStringIndex(StopBits.getDefault()); if (wc != null) { name = wc.getName(); connectionPortName = wc.getAttribute(ISerialPortService.PORT_NAME_ATTR); baudRateStringIndex = Integer.parseInt(wc.getAttribute(ISerialPortService.BAUD_RATE_ATTR)); byteSizeStringIndex = Integer.parseInt(wc.getAttribute(ISerialPortService.BYTE_SIZE_ATTR)); parityStringIndex = Integer.parseInt(wc.getAttribute(ISerialPortService.PARITY_ATTR)); stopBitsStringIndex = Integer.parseInt(wc.getAttribute(ISerialPortService.STOP_BITS_ATTR)); } Label nameLabel = new Label(comp, SWT.NONE); nameLabel.setText(Messages.NewSerialPortConnectionWizardPage_NameLabel); nameText = new Text(comp, SWT.BORDER | SWT.SINGLE); nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); nameText.setText(name); //$NON-NLS-1$ nameText.addKeyListener(new KeyListener() { @Override public void keyReleased(KeyEvent e) { updateStatus(); } @Override public void keyPressed(KeyEvent e) { } }); Label portLabel = new Label(comp, SWT.NONE); portLabel.setText(Messages.NewSerialPortConnectionWizardPage_PortLabel); portCombo = new Combo(comp, SWT.READ_ONLY); portCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); try { portNames = SerialPort.list(); } catch (IOException e) { Activator.log(e); } int index = 0; int portNameIndex = 0; for (String portName : portNames) { portCombo.add(portName); if (portName.equals(connectionPortName)) portNameIndex = index; index++; } portCombo.select(portNameIndex); portCombo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { updateStatus(); } }); Label baudRateLabel = new Label(comp, SWT.NONE); baudRateLabel.setText(Messages.NewSerialPortConnectionWizardPage_BaudRateLabel); baudRateCombo = new Combo(comp, SWT.READ_ONLY); baudRateCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); for (String baudRateStr : BaudRate.getStrings()) { baudRateCombo.add(baudRateStr); } baudRateCombo.select(baudRateStringIndex); baudRateCombo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { updateStatus(); } }); Label byteSizeLabel = new Label(comp, SWT.NONE); byteSizeLabel.setText(Messages.NewSerialPortConnectionWizardPage_ByteSizeLabel); byteSizeCombo = new Combo(comp, SWT.READ_ONLY); byteSizeCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); for (String byteSizeStr : ByteSize.getStrings()) { byteSizeCombo.add(byteSizeStr); } byteSizeCombo.select(byteSizeStringIndex); byteSizeCombo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { updateStatus(); } }); Label parityLabel = new Label(comp, SWT.NONE); parityLabel.setText(Messages.NewSerialPortConnectionWizardPage_ParityLabel); parityCombo = new Combo(comp, SWT.READ_ONLY); parityCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); for (String parityStr : Parity.getStrings()) { parityCombo.add(parityStr); } parityCombo.select(parityStringIndex); parityCombo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { updateStatus(); } }); Label stopBitsLabel = new Label(comp, SWT.NONE); stopBitsLabel.setText(Messages.NewSerialPortConnectionWizardPage_StopBitsLabel); stopBitsCombo = new Combo(comp, SWT.READ_ONLY); stopBitsCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); for (String stopBitsStr : StopBits.getStrings()) { stopBitsCombo.add(stopBitsStr); } stopBitsCombo.select(stopBitsStringIndex); stopBitsCombo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { updateStatus(); } }); updateStatus(); } private void updateStatus() { name = nameText.getText(); int portIndex = portCombo.getSelectionIndex(); portName = portIndex < 0 ? null : portNames[portIndex]; baudRateIndex = baudRateCombo.getSelectionIndex(); byteSizeIndex = byteSizeCombo.getSelectionIndex(); parityIndex = parityCombo.getSelectionIndex(); stopBitsIndex = stopBitsCombo.getSelectionIndex(); isComplete = (!name.isEmpty() && portName != null); for(SerialBlockUpdateListener listener : listeners) { listener.update(); } } public String getConnectionName() { return name; } public String getPortName() { return portName; } public int getBaudRateIndex() { return baudRateIndex; } public int getByteSizeIndex() { return byteSizeIndex; } public int getParityIndex() { return parityIndex; } public int getStopBitsIndex() { return stopBitsIndex; } public boolean isComplete() { return isComplete; } public void addUpdateListener(SerialBlockUpdateListener listener) { if (listener != null && !listeners.contains(listener)) listeners.add(listener); } public void removeUpdateListener(SerialBlockUpdateListener listener) { listeners.remove(listener); } public abstract class SerialBlockUpdateListener { public abstract void update(); } } SerialPortConnectionPropertyPage.java000066400000000000000000000053561272114001700421630ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/remote/serial/ui/******************************************************************************* * Copyright (c) 2016 QNX Software Systems, and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - initial contribution *******************************************************************************/ package org.eclipse.remote.serial.ui; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.serial.core.ISerialPortService; import org.eclipse.remote.serial.internal.ui.Activator; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.ui.IWorkbenchPropertyPage; import org.eclipse.ui.dialogs.PropertyPage; public class SerialPortConnectionPropertyPage extends PropertyPage implements IWorkbenchPropertyPage { protected SerialPortConnectionBlock block; protected IRemoteConnectionWorkingCopy workingCopy; public SerialPortConnectionPropertyPage() { super(); block = new SerialPortConnectionBlock(); } @Override protected Control createContents(Composite parent) { Composite comp = new Composite(parent, SWT.NONE); comp.setLayout(new GridLayout(2, false)); block.addUpdateListener(block.new SerialBlockUpdateListener() { @Override public void update() { setValid(block.isComplete()); } }); IRemoteConnection remoteConnection = getElement().getAdapter(IRemoteConnection.class); if (remoteConnection != null) workingCopy = remoteConnection.getWorkingCopy(); else workingCopy = null; block.createBlock(comp, workingCopy); return comp; } @Override public boolean performOk() { if (workingCopy != null) { workingCopy.setName(block.getConnectionName()); workingCopy.setAttribute(ISerialPortService.PORT_NAME_ATTR, block.getPortName()); workingCopy.setAttribute(ISerialPortService.BAUD_RATE_ATTR, Integer.toString(block.getBaudRateIndex())); workingCopy.setAttribute(ISerialPortService.BYTE_SIZE_ATTR, Integer.toString(block.getByteSizeIndex())); workingCopy.setAttribute(ISerialPortService.PARITY_ATTR, Integer.toString(block.getParityIndex())); workingCopy.setAttribute(ISerialPortService.STOP_BITS_ATTR, Integer.toString(block.getStopBitsIndex())); try { workingCopy.save(); } catch (RemoteConnectionException e) { Activator.log(e); return false; } } return true; } } org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/000077500000000000000000000000001272114001700250565ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/.classpath000066400000000000000000000005611272114001700270430ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/.gitignore000066400000000000000000000000061272114001700270420ustar00rootroot00000000000000/bin/ org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/.project000066400000000000000000000012271272114001700265270ustar00rootroot00000000000000 org.eclipse.remote.telnet.core org.eclipse.jdt.core.javabuilder org.eclipse.pde.ManifestBuilder org.eclipse.pde.SchemaBuilder org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/.settings/000077500000000000000000000000001272114001700267745ustar00rootroot00000000000000org.eclipse.jdt.core.prefs000066400000000000000000000005451272114001700337030ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/.settingseclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/META-INF/000077500000000000000000000000001272114001700262165ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/META-INF/MANIFEST.MF000066400000000000000000000012471272114001700276540ustar00rootroot00000000000000Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %bundleName Bundle-SymbolicName: org.eclipse.remote.telnet.core;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-Activator: org.eclipse.remote.telnet.internal.core.Activator Bundle-Vendor: %providerName Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.remote.telnet.core, org.eclipse.remote.telnet.internal.core;x-internal:=true Bundle-Localization: plugin Import-Package: org.eclipse.core.runtime, org.eclipse.osgi.service.debug;version="1.2.0", org.eclipse.osgi.util, org.eclipse.remote.core, org.eclipse.remote.core.exception, org.osgi.framework org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/about.html000066400000000000000000000024471272114001700270650ustar00rootroot00000000000000 About

About This Content

May 2, 2006

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/about.ini000066400000000000000000000016471272114001700267010ustar00rootroot00000000000000# about.ini # contains information about a feature # java.io.Properties file (ISO 8859-1 with "\" escapes) # "%key" are externalized strings defined in about.properties # This file does not need to be translated. # Property "aboutText" contains blurb for "About" dialog (translated) aboutText=%blurb # Property "windowImage" contains path to window icon (16x16) # needed for primary features only # Property "featureImage" contains path to feature image (32x32) featureImage=ptp_logo_icon32.png # Property "aboutImage" contains path to product image (500x330 or 115x164) # needed for primary features only # Property "appName" contains name of the application (not translated) # needed for primary features only # Property "welcomePage" contains path to welcome page (special XML-based format) # optional # Property "welcomePerspective" contains the id of the perspective in which the # welcome page is to be opened. # optional org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/about.mappings000066400000000000000000000002501272114001700277250ustar00rootroot00000000000000# about.mappings # contains fill-ins for about.properties # java.io.Properties file (ISO 8859-1 with "\" escapes) # This file does not need to be translated. 0=@build@org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/about.properties000066400000000000000000000014111272114001700303030ustar00rootroot00000000000000############################################################################### # Copyright (c) 2015 QNX Software Systems and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # QNX Software Systems - initial API and implementation ############################################################################### # NLS_MESSAGEFORMAT_NONE # NLS_ENCODING=UTF-8 blurb=Telnet Remote Services\n\ \n\ Version: {featureVersion}\n\ Build id: {0}\n\ \n\ Copyright (c) 2015 IBM Corporation, and others. All rights reserved.\n\ Visit http://www.eclipse.org/ptp\n org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/build.properties000066400000000000000000000004511272114001700302730ustar00rootroot00000000000000source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ plugin.xml,\ about.html,\ about.ini,\ about.mappings,\ about.properties,\ ptp_logo_icon32.png,\ plugin.properties org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/plugin.properties000066400000000000000000000001041272114001700304650ustar00rootroot00000000000000bundleName = Remote Serial Port Services providerName = Eclipse PTP org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/plugin.xml000066400000000000000000000026351272114001700271040ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/pom.xml000066400000000000000000000012171272114001700263740ustar00rootroot00000000000000 4.0.0 org.eclipse.remote remote-parent 2.1.0-SNAPSHOT ../../releng/org.eclipse.remote.build/pom.xml org.eclipse.remote.telnet.core eclipse-plugin 1.0.0-SNAPSHOT org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/ptp_logo_icon32.png000066400000000000000000001476271272114001700306050ustar00rootroot00000000000000PNG  IHDR VόsBIT|d pHYs  ~tEXtSoftwareAdobe Fireworks CS3F:prVWxn18cw^ mL@ApD{E**Ur ^GGo#T G6^7gfq*ND׼iu3&obkfJ꺪ouU8>iU*Vot*aYkUσaaaaRD2{ϡ㌑ @ rcR Zu-P2/ L# .nI>sN;3#7r;J-Ʒ֍,6h> j[jI4IfZ) a\4->Dg9HR]kz :! Euan+cQ0 0 ,S!UOaaɀnu鯋X﯏b3*wo6ԣjvNN^?-OQ%1 Z&&gǻUυaU~5ɟfFHmkBF)37!mkTSx}[sƲ.vVlG|KVe?U}<% 7EQSCPvdKxOw .HʁYH |MwO}}zܴ'7ƴ;؊lܘ7qo˿ѧo^ǿp49:\~w}ß卶4O{vN><3(1_D 8:#]ylMvgއlANʜ]ڴ{6[]=A6hsv:}@>mY]}Jfo[yҧC /9hӅ&lLp3-6M{ouK(/3㖘wَv|>Bٕ6fL2ѕx^ =ɰ6e &iN;e4uj5v/|AFP-PQ0„YB-iYhJηwBf%F!CڦxyPA7|ƹV7cu4l~+SH::ad ly[9CHPzHw(RC2 #sEȘ;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zjIdZ }y̪ hqLF A#&dpAnѱN929(d".t~Rj`Ógnӟs9YHX,d Z"BK@hC8j&2 Le XBB`Qˁ!2`nV:r6-׸}CtK)%CK %נH%D9c1i,@B9`dA-p#1޼~cfE'S?v 7N^ٿ$3z*FP!SPRXNh`mZCCub>sx':~NieIҗyu9N-q7m*ji=]yqA@% @-bss*0q=&)$3+AlR/_Ӭ]07я{ib}dbêqC|ѷ8"gu^Ͼmjl)'5C@i0E$$Q"ؐ$0%ve9j?{w>c?݋Ͽ1q%oϾ[m\G~oH]QbV6Z&PCAp 8#q {ԩ_`a]kGTԮ~͜ҒߔG/ɨb}߯ p-\_4˳.o/̰W_|=R*!;bQ{/Şr.xޝJ᳾rg㢁B C0Kɬz ǒِn;DN1,'sbl+֯>Nx0#+-A!`hm W`A^ztayzO^ihvGt~5gGׯBm,4;CQ+nKuuk̯=_EQo),@T|,Wka!'&WT a?|ED> me(F*B{.vS}@DNs')?"HyIENDB`org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/000077500000000000000000000000001272114001700256455ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/org/000077500000000000000000000000001272114001700264345ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/000077500000000000000000000000001272114001700300605ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/000077500000000000000000000000001272114001700313535ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnet/000077500000000000000000000000001272114001700326465ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnet/core/000077500000000000000000000000001272114001700335765ustar00rootroot00000000000000TelnetCodes.java000066400000000000000000000065211272114001700365770ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnet/core/******************************************************************************* * Copyright (c) 2005, 2015 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Fran Litterio (Wind River) - initial API and implementation * Helmut Haigermoser (Wind River) - repackaged * Ted Williams (Wind River) - repackaged into org.eclipse namespace * Michael Scharf (Wind River) - split into core, view and connector plugins * Martin Oberhuber (Wind River) - fixed copyright headers and beautified * Greg Watson (IBM) - Adapted for org.eclipse.remote *******************************************************************************/ package org.eclipse.remote.telnet.core; /** * This interface defines symbolic constants for numeric TELNET protocol command and * option codes. Any class that needs to use these constants must implement this * interface. The meanings of these constants are defined in the various TELNET RFCs * (RFC 854 to RFC 861, and others). */ interface TelnetCodes { /** Command code: Subnegotiation End. */ static final byte TELNET_SE = (byte)240; /** Command code: No-op. */ static final byte TELNET_NOP = (byte)241; /** Command code: Data Mark. */ static final byte TELNET_DM = (byte)242; /** Command code: Break. */ static final byte TELNET_BREAK = (byte)243; /** Command code: Interrupt Process. */ static final byte TELNET_IP = (byte)244; /** Command code: Abort Output. */ static final byte TELNET_AO = (byte)245; /** Command code: Are You There. */ static final byte TELNET_AYT = (byte)246; /** Command code: Erase Character. */ static final byte TELNET_EC = (byte)247; /** Command code: Erase Line. */ static final byte TELNET_EL = (byte)248; /** Command code: Go Ahead. */ static final byte TELNET_GA = (byte)249; /** Command code: Subnegotiation Begin. */ static final byte TELNET_SB = (byte)250; /** Command code: Will. */ static final byte TELNET_WILL = (byte)251; /** Command code: Won't. */ static final byte TELNET_WONT = (byte)252; /** Command code: Do. */ static final byte TELNET_DO = (byte)253; /** Command code: Don't. */ static final byte TELNET_DONT = (byte)254; /** Command code: Interpret As Command. */ static final byte TELNET_IAC = (byte)255; /** Command code: IS. */ static final byte TELNET_IS = 0; /** Command code: SEND. */ static final byte TELNET_SEND = 1; /** Option code: Transmit Binary option. */ static final byte TELNET_OPTION_TRANSMIT_BINARY = 0; /** Option code: Echo option. */ static final byte TELNET_OPTION_ECHO = 1; /** Option code: Suppress Go Ahead option. */ static final byte TELNET_OPTION_SUPPRESS_GA = 3; /** Option code: Terminal Type */ static final byte TELNET_OPTION_TERMINAL_TYPE = 24; /** Option code: Negotitate About Window Size (NAWS) */ static final byte TELNET_OPTION_NAWS = 31; } TelnetCommandShell.java000066400000000000000000000136521272114001700401130ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnet/core/******************************************************************************* * Copyright (c) 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial contribution *******************************************************************************/ package org.eclipse.remote.telnet.core; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PipedInputStream; import java.io.PipedOutputStream; import java.net.ConnectException; import java.net.InetSocketAddress; import java.net.Socket; import java.net.SocketTimeoutException; import java.net.UnknownHostException; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionHostService; import org.eclipse.remote.core.IRemoteProcess; import org.eclipse.remote.core.IRemoteProcessBuilder; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.telnet.internal.core.Logger; import org.eclipse.remote.telnet.internal.core.messages.Messages; public class TelnetCommandShell implements IRemoteProcess { private final TelnetConnection telnetConnection; private TelnetProtocol protocol; public TelnetCommandShell(IRemoteConnection remoteConnection, TelnetConnection telnetConnection) { this.telnetConnection = telnetConnection; assert(remoteConnection.getService(IRemoteConnectionHostService.class) != null); } @Override public void destroy() { if (protocol != null) { protocol.interrupt(); } } @Override public int exitValue() { return 0; } @Override public InputStream getErrorStream() { return null; } @Override public InputStream getInputStream() { if (protocol != null) { PipedOutputStream pipedOutput = new PipedOutputStream(); protocol.setClientOutputStream(pipedOutput); try { return new PipedInputStream(pipedOutput); } catch (IOException e) { return null; } } return null; } @Override public OutputStream getOutputStream() { if (protocol != null) { return protocol.getOutputStream(); } return null; } @Override public int waitFor() throws InterruptedException { if (protocol != null && protocol.isConnected()) { wait(); } return 0; } @Override public boolean isCompleted() { return protocol == null || !protocol.isAlive(); } @Override public IRemoteConnection getRemoteConnection() { return telnetConnection.getRemoteConnection(); } @Override public T getService(Class service) { return null; } @Override public boolean hasService(Class service) { return false; } @Override public IRemoteProcessBuilder getProcessBuilder() { return null; } public void connect() throws RemoteConnectionException { IRemoteConnectionHostService hostSvc = telnetConnection.getRemoteConnection() .getService(IRemoteConnectionHostService.class); // Retry the connect after a little pause in case the // remote telnet server isn't ready. ConnectExceptions might // happen if the telnet server process did not initialized itself. // This is seen especially if the telnet server is a process // providing it's input and output via a built in telnet server. int remaining = 10; while (remaining >= 0) { // Pause before we re-try if the remaining tries are less than the initial value if (remaining < 10) { try { Thread.sleep(500); } catch (InterruptedException e) { /* ignored on purpose */ } } try { int nTimeout = hostSvc.getTimeout() * 1000; String strHost = hostSvc.getHostname(); int nPort = hostSvc.getPort(); InetSocketAddress address = new InetSocketAddress(strHost, nPort); Socket socket = new Socket(); socket.connect(address, nTimeout); // If we get to this point, the connect succeeded and we will // force the remaining counter to be 0. remaining = 0; // This next call causes reads on the socket to see TCP urgent data // inline with the rest of the non-urgent data. Without this call, TCP // urgent data is silently dropped by Java. This is required for // TELNET support, because when the TELNET server sends "IAC DM", the // IAC byte is TCP urgent data. If urgent data is silently dropped, we // only see the DM, which looks like an ISO Latin-1 '�' character. socket.setOOBInline(true); socket.setKeepAlive(true); protocol = new TelnetProtocol(socket, this); protocol.start(); } catch (UnknownHostException ex) { // No re-try in case of UnknownHostException, there is no indication that // the DNS will fix itself throw new RemoteConnectionException(Messages.TelnetCommandShell_0 + ex.getMessage()); } catch (SocketTimeoutException socketTimeoutException) { // Time out occurred. No re-try in this case either. Time out can // be increased by the user. Multiplying the timeout with the remaining // counter is not desired. throw new RemoteConnectionException(socketTimeoutException.getMessage()); } catch (ConnectException connectException) { // In case of a ConnectException, do a re-try. The server could have been // simply not ready yet and the worker would give up to early. If the terminal // control is already closed (disconnected), don't print "Connection refused" errors if (remaining == 0) { throw new RemoteConnectionException(connectException.getMessage()); } } catch (Exception exception) { // Any other exception on connect. No re-try in this case either // Log the exception Logger.logException(exception); // And signal failed throw new RemoteConnectionException(exception.getMessage()); } finally { remaining--; } } } protected void terminated() { telnetConnection.terminated(this); } } TelnetConnection.java000066400000000000000000000144601272114001700376420ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnet/core/******************************************************************************* * Copyright (c) 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial contribution *******************************************************************************/ package org.eclipse.remote.telnet.core; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.remote.core.IRemoteCommandShellService; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnection.Service; import org.eclipse.remote.core.IRemoteConnectionChangeListener; import org.eclipse.remote.core.IRemoteConnectionControlService; import org.eclipse.remote.core.IRemoteConnectionHostService; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.IRemoteProcess; import org.eclipse.remote.core.RemoteConnectionChangeEvent; import org.eclipse.remote.core.exception.RemoteConnectionException; public class TelnetConnection implements IRemoteConnectionControlService, IRemoteCommandShellService, IRemoteConnectionHostService, IRemoteConnectionChangeListener { public static int DEFAULT_PORT = 23; public static int DEFAULT_TIMEOUT = 0; // Infinite public static final String HOSTNAME_ATTR = "telnet.hostname.attr"; //$NON-NLS-1$ public static final String USERNAME_ATTR = "telnet.username.attr"; //$NON-NLS-1$ public static final String PASSWORD_ATTR = "telnet.password.attr"; //$NON-NLS-1$ public static final String PORT_ATTR = "telnet.port.attr"; //$NON-NLS-1$ public static final String TIMEOUT_ATTR = "telnet.timeout.attr"; //$NON-NLS-1$ private final IRemoteConnection remoteConnection; private final List shells = Collections.synchronizedList(new ArrayList()); private boolean isOpen; private TelnetConnection(IRemoteConnection remoteConnection) { this.remoteConnection = remoteConnection; remoteConnection.addConnectionChangeListener(this); } public static class Factory implements IRemoteConnection.Service.Factory { @SuppressWarnings("unchecked") @Override public T getService(IRemoteConnection remoteConnection, Class service) { if (TelnetConnection.class.equals(service)) { return (T) new TelnetConnection(remoteConnection); } else if (IRemoteConnectionControlService.class.equals(service) || IRemoteConnectionHostService.class.equals(service) || IRemoteCommandShellService.class.equals(service)) { return (T) remoteConnection.getService(TelnetConnection.class); } return null; } } @Override public IRemoteConnection getRemoteConnection() { return remoteConnection; } @Override public IRemoteProcess getCommandShell(int flags) throws IOException { if (isOpen) { TelnetCommandShell shell = new TelnetCommandShell(remoteConnection, this); try { shell.connect(); } catch (RemoteConnectionException e) { throw new IOException(e.getMessage()); } shells.add(shell); return shell; } return null; } @Override public int getPort() { try { String portStr = remoteConnection.getAttribute(PORT_ATTR); return !portStr.isEmpty() ? Integer.parseInt(portStr) : DEFAULT_PORT; } catch (NumberFormatException e) { return -1; } } @Override public int getTimeout() { try { String timeoutStr = remoteConnection.getAttribute(TIMEOUT_ATTR); return !timeoutStr.isEmpty() ? Integer.parseInt(timeoutStr) : DEFAULT_TIMEOUT; } catch (NumberFormatException e) { return -1; } } @Override public void close() { synchronized (shells) { for (TelnetCommandShell shell : shells) { shell.destroy(); } } isOpen = false; } @Override public String getHostname() { return remoteConnection.getAttribute(HOSTNAME_ATTR); } @Override public boolean useLoginShell() { return true; } @Override public String getUsername() { return remoteConnection.getAttribute(USERNAME_ATTR); } @Override public void setHostname(String hostname) { if (remoteConnection instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) remoteConnection; wc.setAttribute(HOSTNAME_ATTR, hostname); } } @Override public void setPassphrase(String passphrase) { // Ignore } @Override public void setPassword(String password) { if (remoteConnection instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) remoteConnection; wc.setSecureAttribute(PASSWORD_ATTR, password); } } @Override public void setPort(int port) { if (remoteConnection instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) remoteConnection; wc.setAttribute(PORT_ATTR, Integer.toString(port)); } } @Override public void setTimeout(int timeout) { if (remoteConnection instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) remoteConnection; wc.setAttribute(TIMEOUT_ATTR, Integer.toString(timeout)); } } @Override public void setUseLoginShell(boolean useLogingShell) { // Ignore } @Override public void setUsePassword(boolean usePassword) { // Ignore } @Override public void setUsername(String username) { if (remoteConnection instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) remoteConnection; wc.setAttribute(USERNAME_ATTR, username); } } @Override public void open(IProgressMonitor monitor) throws RemoteConnectionException { isOpen = true; } @Override public boolean isOpen() { return isOpen; } @Override public void connectionChanged(RemoteConnectionChangeEvent event) { switch (event.getType()) { case RemoteConnectionChangeEvent.CONNECTION_OPENED: isOpen = true; break; case RemoteConnectionChangeEvent.CONNECTION_ABORTED: case RemoteConnectionChangeEvent.CONNECTION_CLOSED: isOpen = false; break; } } protected void terminated(TelnetCommandShell shell) { shells.remove(shell); } } TelnetOption.java000066400000000000000000000701131272114001700370100ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnet/core/******************************************************************************* * Copyright (c) 2005, 2015 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 * * Initial Contributors: * The following Wind River employees contributed to the Terminal component * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, * Helmut Haigermoser and Ted Williams. * * Contributors: * Michael Scharf (Wind River) - split into core, view and connector plugins * Martin Oberhuber (Wind River) - fixed copyright headers and beautified * Martin Oberhuber (Wind River) - [267181] Fix telnet option negotiation loop * Anton Leherbauer (Wind River) - [453393] Add support for copying wrapped lines without line break * Greg Watson (IBM) - Adapted for org.eclipse.remote *******************************************************************************/ package org.eclipse.remote.telnet.core; import java.io.IOException; import java.io.OutputStream; import java.util.Date; import org.eclipse.remote.telnet.internal.core.Logger; /** * This class represents a single TELNET protocol option at one endpoint of a TELNET * connection. This class encapsulates the endpoint associated with the option (local * or remote), the current state of the option (enabled or disabled), the desired state * of the option, the current state of the negotiation, an OutputStream that allows * communication with the remote endpoint, and the number of negotiations that have * started within this connection. *

* * In addition to encapsulating the above state, this class performs option negotiation * to attempt to achieve the desired option state. For some options, this class also * performs option sub-negotiation. *

* * IMPORTANT: Understanding this code requires understanding the TELNET protocol and * TELNET option processing. *

* * @author Fran Litterio (francis.litterio@windriver.com) */ class TelnetOption implements TelnetCodes { /** * This array of Strings maps an integer TELNET option code value to the symbolic * name of the option. Array elements of the form "?" represent unassigned option * values. */ protected static final String[] optionNames = { "BINARY", // 0 //$NON-NLS-1$ "ECHO", // 1 //$NON-NLS-1$ "RECONNECTION", // 2 //$NON-NLS-1$ "SUPPRESS GO AHEAD", // 3 //$NON-NLS-1$ "MSG SIZE NEGOTIATION", // 4 //$NON-NLS-1$ "STATUS", // 5 //$NON-NLS-1$ "TIMING MARK", // 6 //$NON-NLS-1$ "REMOTE CTRL TRANS+ECHO", // 7 //$NON-NLS-1$ "OUTPUT LINE WIDTH", // 8 //$NON-NLS-1$ "OUTPUT PAGE SIZE", // 9 //$NON-NLS-1$ "OUTPUT CR DISPOSITION", // 10 //$NON-NLS-1$ "OUTPUT HORIZ TABSTOPS", // 11 //$NON-NLS-1$ "OUTPUT HORIZ TAB DISPOSITION", // 12 //$NON-NLS-1$ "OUTPUT FORMFEED DISPOSITION", // 13 //$NON-NLS-1$ "OUTPUT VERTICAL TABSTOPS", // 14 //$NON-NLS-1$ "OUTPUT VT DISPOSITION", // 15 //$NON-NLS-1$ "OUTPUT LF DISPOSITION", // 16 //$NON-NLS-1$ "EXTENDED ASCII", // 17 //$NON-NLS-1$ "LOGOUT", // 18 //$NON-NLS-1$ "BYTE MACRO", // 19 //$NON-NLS-1$ "DATA ENTRY TERMINAL", // 20 //$NON-NLS-1$ "SUPDUP", // 21 //$NON-NLS-1$ "SUPDUP OUTPUT", // 22 //$NON-NLS-1$ "SEND LOCATION", // 23 //$NON-NLS-1$ "TERMINAL TYPE", // 24 //$NON-NLS-1$ "END OF RECORD", // 25 //$NON-NLS-1$ "TACACS USER IDENTIFICATION", // 26 //$NON-NLS-1$ "OUTPUT MARKING", // 27 //$NON-NLS-1$ "TERMINAL LOCATION NUMBER", // 28 //$NON-NLS-1$ "3270 REGIME", // 29 //$NON-NLS-1$ "X.3 PAD", // 30 //$NON-NLS-1$ "NEGOTIATE ABOUT WINDOW SIZE", // 31 //$NON-NLS-1$ "TERMINAL SPEED", // 32 //$NON-NLS-1$ "REMOTE FLOW CONTROL", // 33 //$NON-NLS-1$ "LINEMODE", // 34 //$NON-NLS-1$ "X DISPLAY LOCATION", // 35 //$NON-NLS-1$ "ENVIRONMENT OPTION", // 36 //$NON-NLS-1$ "AUTHENTICATION OPTION", // 37 //$NON-NLS-1$ "ENCRYPTION OPTION", // 38 //$NON-NLS-1$ "NEW ENVIRONMENT OPTION", // 39 //$NON-NLS-1$ "TN3270E", // 40 //$NON-NLS-1$ "XAUTH", // 41 //$NON-NLS-1$ "CHARSET", // 42 //$NON-NLS-1$ "REMOTE SERIAL PORT", // 43 //$NON-NLS-1$ "COM PORT CONTROL OPTION", // 44 //$NON-NLS-1$ "SUPPRESS LOCAL ECHO", // 45 //$NON-NLS-1$ "START TLS", // 46 //$NON-NLS-1$ "KERMIT", // 47 //$NON-NLS-1$ "SEND URL", // 48 //$NON-NLS-1$ "FORWARD X", // 49 //$NON-NLS-1$ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", // 50 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ // ... "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "?", "?", "?", "?", "?", "?", "?", // ... //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ // 137 "TELOPT PRAGMA LOGON", // 138 //$NON-NLS-1$ "TELOPT SSPI LOGON", // 139 //$NON-NLS-1$ "TELOPT PRAGMA HEARTBEAT", // 140 //$NON-NLS-1$ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", // 141 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ // ... "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "?", "?", "?", "?", // ... 254 //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ "EXTENDED OPTIONS LIST" // 255 //$NON-NLS-1$ }; /** * Negotiation state: Negotiation not yet started for this option. *

* * This constant and the others having similar names represent the states of a * finite state automaton (FSA) that tracks the negotiation state of this option. * The initial state is NEGOTIATION_NOT_STARTED. The state machine is as follows * (with transitions labeled with letters in parentheses): *

* *

	 *     NEGOTIATION_NOT_STARTED -----> {@link #NEGOTIATION_IN_PROGRESS}
	 *                         |    (A)      |        ^
	 *                      (C)|          (B)|        |(D)
	 *                         |             V        |
	 *                         +--------> {@link #NEGOTIATION_DONE}
	 * 
*

* * Once the FSA leaves state NEGOTIATION_NOT_STARTED, it never returns to that * state. Transition A happens when the local endpoint sends an option command * before receiving a command for the same option from the remote endpoint. *

* * Transition B happens when the local endpoint receives a reply to an option * command sent earlier by the local endpoint. Receipt of that reply terminates * the negotiation. *

* * Transition D happens after negotiation is done and "something changes" (see the * RFCs for the definition of "something changes"). Either endpoint can * re-negotiate an option after a previous negotiation, but only if some external * influence (such as the user or the OS) causes it to do so. Re-negotiation must * start more than {@link #NEGOTIATION_IGNORE_DURATION} milliseconds after the FSA * enters state NEGOTIATION_DONE or it will be ignored. This is how this client * prevents negotiation loops. *

* * Transition C happens when the local endpoint receives an option command from the * remote endpoint before sending a command for the same option. In that case, the * local endpoint replies immediately with an option command and the negotiation * terminates. *

* * Some TELNET servers (e.g., the Solaris server), after sending WILL and receiving * DONT, will reply with a superfluous WONT. Any such superfluous option command * received from the remote endpoint while the option's FSA is in state * {@link #NEGOTIATION_DONE} will be ignored by the local endpoint. */ protected static final int NEGOTIATION_NOT_STARTED = 0; /** Negotiation state: Negotiation is in progress for this option. */ protected static final int NEGOTIATION_IN_PROGRESS = 1; /** Negotiation state: Negotiation has terminated for this option. */ protected static final int NEGOTIATION_DONE = 2; /** * The number of milliseconds following the end of negotiation of this option * before which the remote endpoint can re-negotiate the option. Any option * command received from the remote endpoint before this time passes is ignored. * This is used to prevent option negotiation loops. * * @see #ignoreNegotiation() * @see #negotiationCompletionTime */ protected static final int NEGOTIATION_IGNORE_DURATION = 30000; /** * This field holds the current negotiation state for this option. */ protected int negotiationState = NEGOTIATION_NOT_STARTED; /** * This field holds the time when negotiation of this option most recently * terminated (i.e., entered state {@link #NEGOTIATION_DONE}). This is used to * determine whether an option command received from the remote endpoint after * negotiation has terminated for this option is to be ignored or interpreted as * the start of a new negotiation. * * @see #NEGOTIATION_IGNORE_DURATION */ protected Date negotiationCompletionTime = new Date(0); /** * Holds the total number of negotiations that have completed for this option. */ protected int negotiationCount = 0; /** * Holds the integer code representing the option. */ protected byte option = 0; /** * Holds the OutputStream object that allows data to be sent to the remote endpoint * of the TELNET connection. */ protected OutputStream outputStream; /** * True if this option is for the local endpoint, false for the remote endpoint. */ protected boolean local = true; /** * This field is true if the option is enabled, false if it is disabled. All * options are initially disabled until they are negotiated to be enabled. *

*/ protected boolean enabled = false; /** * This field is true if the client desires the option to be enabled, false if the * client desires the option to be disabled. This field does not represent the * remote's endpoints desire (as expressed via WILL and WONT commands) -- it * represnet the local endpoint's desire. *

* * @see #setDesired(boolean) */ protected boolean desired = false; /** * Constructor. *

* * @param option * The integer code of this option. * @param desired * Whether we desire this option to be enabled. * @param local * Whether this option is for the local or remote endpoint. * @param serverOutputStream * A stream used to negotiate with the remote endpoint. */ TelnetOption(byte option, boolean desired, boolean local, OutputStream outputStream) { this.option = option; this.desired = desired; this.local = local; this.outputStream = outputStream; } /** * @return Returns a String containing the name of the TELNET option specified in * parameter option. */ public String optionName() { return optionNames[option & 0xFF]; } /** * Returns true if this option is enabled, false if it is disabled. *

* * @return Returns true if this option is enabled, false if it is disabled. */ public boolean isEnabled() { return enabled; } /** * Enables this option if newValue is true, otherwise disables this * option. *

* * @param newValue * True if this option is to be enabled, false otherwise. */ public void setEnabled(boolean newValue) { Logger.log("Enabling " + (local ? "local" : "remote") + " option " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ optionName()); enabled = newValue; } /** * Returns true if the local endpoint desires this option to be enabled, false if * not. It is not an error for the value returned by this method to differ from * the value returned by isEnabled(). The value returned by this method can change * over time, reflecting the local endpoint's changing desire regarding the * option. *

* * NOTE: Even if this option represents a remote endpoint option, the return value * of this method represents the local endpint's desire regarding the remote * option. *

* * @return Returns true if the local endpoint desires this option to be enabled, * false if not. */ public boolean isDesired() { return desired; } /** * Sets our desired value for this option. Note that the option can be desired * when enabled is false, and the option can be undesired when * enabled is true, though the latter state should not persist, since either * endpoint can disable any option at any time. *

* * @param newValue * True if we desire this option to be enabled, false if * we desire this option to be disabled. */ public void setDesired(boolean newValue) { if (newValue) { Logger.log("Setting " + (local ? "local" : "remote") + " option " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ optionName() + " as desired."); //$NON-NLS-1$ } desired = newValue; } /** * Call this method to request that negotiation begin for this option. This method * does nothing if negotiation for this option has already started or is already * complete. If negotiation has not yet started for this option and the local * endpoint desires this option to be enabled, then we send a WILL or DO command to * the remote endpoint. */ public void negotiate() { if (negotiationState == NEGOTIATION_NOT_STARTED && desired) { if (local) { Logger.log("Starting negotiation for local option " + optionName()); //$NON-NLS-1$ sendWill(); } else { Logger.log("Starting negotiation for remote option " + optionName()); //$NON-NLS-1$ sendDo(); } negotiationState = NEGOTIATION_IN_PROGRESS; } } /** * This method is called whenever we receive a WILL command from the remote * endpoint. */ public void handleWill() { if (negotiationState == NEGOTIATION_DONE && ignoreNegotiation()) { Logger.log("Ignoring superfluous WILL command from remote endpoint."); //$NON-NLS-1$ return; } if (negotiationState == NEGOTIATION_IN_PROGRESS) { if (desired) { // We sent DO and server replied with WILL. Enable the option, and end // this negotiation. enabled = true; Logger.log("Enabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ endNegotiation(); } else { // This should never happen! We sent DONT and the server replied with // WILL. Bad server. No soup for you. Disable the option, and end // this negotiation. Logger.log("Server answered DONT with WILL!"); //$NON-NLS-1$ enabled = false; Logger.log("Disabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ endNegotiation(); } } else { if (desired) { // Server sent WILL, so we reply with DO. Enable the option, and end // this negotiation. sendDo(); enabled = true; Logger.log("Enabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ endNegotiation(); } else { // Server sent WILL, so we reply with DONT. Disable the option, and // end this negotiation. sendDont(); enabled = false; Logger.log("Disabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ endNegotiation(); } } } /** * Handles a WONT command sent by the remote endpoint for this option. The value * of desired doesn't matter in this method, because the remote endpoint is * forcing the option to be disabled. */ public void handleWont() { if (negotiationState == NEGOTIATION_DONE && ignoreNegotiation()) { Logger.log("Ignoring superfluous WONT command from remote endpoint."); //$NON-NLS-1$ return; } if (negotiationState == NEGOTIATION_IN_PROGRESS) { // We sent DO or DONT and server replied with WONT. Disable the // option, and end this negotiation. enabled = false; Logger.log("Disabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ endNegotiation(); } else { // Server sent WONT, so we reply with DONT. Disable the option, and // end this negotiation. sendDont(); enabled = false; Logger.log("Disabling remote option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ endNegotiation(); } } /** * Handles a DO command sent by the remote endpoint for this option. */ public void handleDo() { if (negotiationState == NEGOTIATION_DONE && ignoreNegotiation()) { Logger.log("Ignoring superfluous DO command from remote endpoint."); //$NON-NLS-1$ return; } if (negotiationState == NEGOTIATION_IN_PROGRESS) { if (desired) { // We sent WILL and server replied with DO. Enable the option, and end // this negotiation. enabled = true; Logger.log("Enabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ endNegotiation(); } else { // We sent WONT and server replied with DO. This should never happen! // Bad server. No soup for you. Disable the option, and end this // negotiation. Logger.log("Server answered WONT with DO!"); //$NON-NLS-1$ enabled = false; Logger.log("Disabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ endNegotiation(); } } else { if (desired) { // Server sent DO, so we reply with WILL. Enable the option, and end // this negotiation. sendWill(); enabled = true; Logger.log("Enabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ endNegotiation(); } else { // Server sent DO, so we reply with WONT. Disable the option, and end // this negotiation. sendWont(); enabled = false; Logger.log("Disabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ endNegotiation(); } } } /** * Handles a DONT command sent by the remote endpoint for this option. The value * of desired doesn't matter in this method, because the remote endpoint is * forcing the option to be disabled. */ public void handleDont() { if (negotiationState == NEGOTIATION_DONE && ignoreNegotiation()) { Logger.log("Ignoring superfluous DONT command from remote endpoint."); //$NON-NLS-1$ return; } if (negotiationState == NEGOTIATION_IN_PROGRESS) { // We sent WILL or WONT and server replied with DONT. Disable the // option, and end this negotiation. enabled = false; Logger.log("Disabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ endNegotiation(); } else { // Server sent DONT, so we reply with WONT. Disable the option, and end // this negotiation. sendWont(); enabled = false; Logger.log("Disabling local option " + optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ endNegotiation(); } } /** * This method handles a subnegotiation command received from the remote endpoint. * Currently, the only subnegotiation we handle is when the remote endpoint * commands us to send our terminal type (which is "xterm"). * * @param subnegotiationData * An array of bytes containing a TELNET * subnegotiation command received from the * remote endpoint. * @param count * The number of bytes in array * subnegotiationData to examine. */ public void handleSubnegotiation(byte[] subnegotiationData, int count) { switch (option) { case TELNET_OPTION_TERMINAL_TYPE: if (subnegotiationData[1] != TELNET_SEND) { // This should never happen! Logger.log("Invalid TERMINAL-TYPE subnegotiation command from remote endpoint: " + //$NON-NLS-1$ (subnegotiationData[1] & 0xff)); break; } // Tell the remote endpoint our terminal type is "ansi" using this sequence // of TELNET protocol bytes: // // IAC SB TERMINAL-TYPE IS x t e r m IAC SE byte[] terminalTypeData = { TELNET_IAC, TELNET_SB, TELNET_OPTION_TERMINAL_TYPE, TELNET_IS, (byte) 'x', (byte) 't', (byte) 'e', (byte) 'r', (byte) 'm', TELNET_IAC, TELNET_SE }; try { outputStream.write(terminalTypeData); } catch (IOException ex) { Logger.log("IOException sending TERMINAL-TYPE subnegotiation!"); //$NON-NLS-1$ Logger.logException(ex); } break; default: // This should never happen! Logger.log("SHOULD NOT BE REACHED: Called for option " + optionName()); //$NON-NLS-1$ break; } } /** * This method sends a subnegotiation command to the remote endpoint. * * @param subnegotiationData * An array of Objects holding data to be used * when generating the outbound subnegotiation * command. */ public void sendSubnegotiation(Object[] subnegotiationData) { switch (option) { case TELNET_OPTION_NAWS: // Get the width and height of the view and send it to the remote // endpoint using this sequence of TELNET protocol bytes: // // IAC SB NAWS // IAC SE byte[] NAWSData = { TELNET_IAC, TELNET_SB, TELNET_OPTION_NAWS, 0, 0, 0, 0, TELNET_IAC, TELNET_SE }; int width = ((Integer) subnegotiationData[0]).intValue(); int height = ((Integer) subnegotiationData[1]).intValue(); NAWSData[3] = (byte) ((width >>> 8) & 0xff); // High order byte of width. NAWSData[4] = (byte) (width & 0xff); // Low order byte of width. NAWSData[5] = (byte) ((height >>> 8) & 0xff); // High order byte of height. NAWSData[6] = (byte) (height & 0xff); // Low order byte of height. Logger.log("sending terminal size to remote endpoint: width = " + width + //$NON-NLS-1$ ", height = " + height + "."); //$NON-NLS-1$ //$NON-NLS-2$ // This final local variable is a hack to get around the fact that inner // classes cannot reference a non-final local variable in a lexically // enclosing scope. final byte[] NAWSDataFinal = NAWSData; // Send the NAWS data in a new thread. The current thread is the display // thread, and calls to write() can block, but blocking the display thread // is _bad_ (it hangs the GUI). Thread t = new Thread() { @Override public void run() { try { outputStream.write(NAWSDataFinal); } catch (IOException ex) { Logger.log("IOException sending NAWS subnegotiation!"); //$NON-NLS-1$ Logger.logException(ex); } } }; t.setDaemon(true); t.start(); break; default: // This should never happen! Logger.log("SHOULD NOT BE REACHED: Called for option " + optionName()); //$NON-NLS-1$ break; } } /** * This method returns true if there has not yet been any negotiation of this * option. * * @return Returns true if there has not yet been any negotiation of this option. */ protected boolean notYetNegotiated() { return negotiationState == NEGOTIATION_NOT_STARTED; } /** * This method terminates the current negotiation and records the time at which the * negotiation terminated. */ protected void endNegotiation() { Logger.log("Ending negotiation #" + negotiationCount + " for " + //$NON-NLS-1$ //$NON-NLS-2$ (local ? "local" : "remote") + " option " + optionName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ negotiationState = NEGOTIATION_DONE; negotiationCompletionTime.setTime(System.currentTimeMillis()); ++negotiationCount; } /** * This method determines whether or not to ignore what appears to be a new * negotiation initiated by the remote endpoint. This is needed because some * TELNET servers send superfluous option commands that a naive client might * interpret as the start of a new negotiation. If the superfluous command is not * ignored, an option negotiation loop can result (which is bad). For details * about the superfluous commands sent by some servers, see the documentation for * {@link #NEGOTIATION_NOT_STARTED}. *

* * The current implementation of this method returns true if the new negotiation * starts within NEGOTIATION_IGNORE_DURATION seconds of the end of the previous * negotiation of this option. *

* * @return Returns true if the new negotiation should be ignored, false if not. */ protected boolean ignoreNegotiation() { return (System.currentTimeMillis() - negotiationCompletionTime.getTime()) < NEGOTIATION_IGNORE_DURATION; } /** * Sends a DO command to the remote endpoint for this option. */ protected void sendDo() { Logger.log("Sending DO " + optionName()); //$NON-NLS-1$ sendCommand(TELNET_DO); } /** * Sends a DONT command to the remote endpoint for this option. */ protected void sendDont() { Logger.log("Sending DONT " + optionName()); //$NON-NLS-1$ sendCommand(TELNET_DONT); } /** * Sends a WILL command to the remote endpoint for this option. */ protected void sendWill() { Logger.log("Sending WILL " + optionName()); //$NON-NLS-1$ sendCommand(TELNET_WILL); } /** * Sends a WONT command to the remote endpoint for this option. */ protected void sendWont() { Logger.log("Sending WONT " + optionName()); //$NON-NLS-1$ sendCommand(TELNET_WONT); } /** * This method sends a WILL/WONT/DO/DONT command to the remote endpoint for this * option. */ protected void sendCommand(byte command) { byte[] data = { TELNET_IAC, 0, 0 }; data[1] = command; data[2] = option; try { outputStream.write(data); } catch (IOException ex) { Logger.log("IOException sending command " + command); //$NON-NLS-1$ Logger.logException(ex); } } } TelnetProtocol.java000066400000000000000000000612311272114001700373420ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnet/core/******************************************************************************* * Copyright (c) 2005, 2015 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Fran Litterio (Wind River) - initial API and implementation * Helmut Haigermoser (Wind River) - repackaged * Ted Williams (Wind River) - repackaged into org.eclipse namespace * Michael Scharf (Wind River) - split into core, view and connector plugins * Martin Oberhuber (Wind River) - fixed copyright headers and beautified * Michael Scharf (Wind River) - [209665] Add ability to log byte streams from terminal * Alex Panchenko (Xored) - [277061] TelnetProtocol.isConnected() should check if socket was not closed * Uwe Stieber (Wind River) - [281329] Telnet connection not handling "SocketException: Connection reset" correct * Nils Hagge (Siemens AG) - [276023] close socket streams after connection is disconnected * Greg Watson (IBM) - Adapted for org.eclipse.remote *******************************************************************************/ package org.eclipse.remote.telnet.core; import java.io.IOException; import java.io.OutputStream; import java.net.Socket; import java.net.SocketException; import java.nio.ByteBuffer; import java.nio.channels.Channels; import java.nio.channels.ClosedByInterruptException; import java.nio.channels.ReadableByteChannel; import org.eclipse.remote.telnet.internal.core.Logger; import org.eclipse.remote.telnet.internal.core.messages.Messages; /** * This class encapsulates a TELNET connection to a remote server. It processes * incoming TELNET protocol data and generates outbound TELNET protocol data. It * also manages two sets of TelnetOption objects: one for the local endpoint and * one for the remote endpoint. *

* * IMPORTANT: Understanding this code requires understanding the TELNET protocol * and TELNET option processing, as defined in the RFCs listed below. *

* * @author Fran Litterio (francis.litterio@windriver.com) * * @see RFC 854 * @see RFC 855 * @see RFC 856 * @see RFC 857 * @see RFC 858 * @see RFC 859 * @see RFC 860 * @see RFC 861 * @see RFC 1091 * @see RFC 1096 * @see RFC 1073 * @see RFC 1079 * @see RFC 1143 * @see RFC 1572 */ public class TelnetProtocol extends Thread implements TelnetCodes { /** * TELNET connection state: Initial state. */ protected static final int STATE_INITIAL = 0; /** * TELNET connection state: Last byte processed was IAC code. code. */ protected static final int STATE_IAC_RECEIVED = 1; /** * TELNET connection state: Last byte processed was WILL code. code. */ protected static final int STATE_WILL_RECEIVED = 2; /** * TELNET connection state: Last byte processed was WONT code. */ protected static final int STATE_WONT_RECEIVED = 3; /** * TELNET connection state: Last byte processed was DO code. */ protected static final int STATE_DO_RECEIVED = 4; /** * TELNET connection state: Last byte processed was DONT code. */ protected static final int STATE_DONT_RECEIVED = 5; /** * TELNET connection state: Last byte processed was SB. */ protected static final int STATE_SUBNEGOTIATION_STARTED = 6; /** * TELNET connection state: Currently receiving sub-negotiation data. */ protected static final int STATE_RECEIVING_SUBNEGOTIATION = 7; /** * Size of buffer for processing data received from remote endpoint. */ protected static final int BUFFER_SIZE = 2048; /** * Holds raw bytes received from the remote endpoint, prior to any TELNET * protocol processing. */ protected ByteBuffer rawBytes = ByteBuffer.allocateDirect(BUFFER_SIZE); /** * Holds incoming network data after the TELNET protocol bytes have been * processed and removed. */ protected byte[] processedBytes = new byte[BUFFER_SIZE]; /** * This field holds a StringBuffer containing text recently received from * the remote endpoint (after all TELNET protocol bytes have been processed * and removed). */ protected StringBuffer processedStringBuffer = new StringBuffer(BUFFER_SIZE); /** * Holds the current state of the TELNET protocol processor. */ protected int telnetState = STATE_INITIAL; /** * This field is true if the remote endpoint is a TELNET server, false if * not. We set this to true if and only if the remote endpoint sends * recognizable TELNET protocol data. We do not assume that the remote * endpoint is a TELNET server just because it is listening on port 23. This * allows us to successfully connect to a TELNET server listening on a port * other than 23. *

* * When this field first changes from false to true, we send all WILL or DO * commands to the remote endpoint. *

* * @see #telnetServerDetected() */ protected boolean remoteIsTelnetServer = false; /** * An array of TelnetOption objects representing the local endpoint's TELNET * options. The array is indexed by the numeric TELNET option code. */ protected TelnetOption[] localOptions = new TelnetOption[256]; /** * An array of TelnetOption objects representing the remote endpoint's * TELNET options. The array is indexed by the numeric TELNET option code. */ protected TelnetOption[] remoteOptions = new TelnetOption[256]; /** * An array of bytes that holds the TELNET subnegotiation command most * recently received from the remote endpoint. This array does _not_ include * the leading IAC SB bytes, nor does it include the trailing IAC SE bytes. * The first byte of this array is always a TELNET option code. */ protected byte[] receivedSubnegotiation = new byte[128]; /** * This field holds the index into array {@link #receivedSubnegotiation} of * the next unused byte. This is used by method * {@link #processTelnetProtocol(int)} when the state machine is in states * {@link #STATE_SUBNEGOTIATION_STARTED} and {@link * #STATE_RECEIVING_SUBNEGOTIATION}. */ protected int nextSubnegotiationByteIndex = 0; /** * This field is true if an error occurs while processing a subnegotiation * command. * * @see #processTelnetProtocol(int) */ protected boolean ignoreSubnegotiation = false; /** * This field holds the width of the Terminal screen in columns. */ protected int width = 0; /** * This field holds the height of the Terminal screen in rows. */ protected int height = 0; /** * This field holds a reference to the {@link TelnetCommandShell}. */ protected TelnetCommandShell shell; /** * This method holds the Socket object for the TELNET connection. */ protected Socket socket; /** * This field holds a reference to an {@link ReadableByteChannel} object used to * receive data from the remote endpoint. */ protected ReadableByteChannel inputChannel; /** * This field holds a reference to an {@link OutputStream} object used to * send data to the remote endpoint. */ protected OutputStream serverOutputStream; /** * This field holds a reference to an {@link OutputStream} object used to * send data to the client. */ protected OutputStream clientOutputStream; /** * UNDER CONSTRUCTION */ protected boolean localEcho = true; /** * This constructor just initializes some internal object state from its * arguments. */ public TelnetProtocol(Socket socket, TelnetCommandShell shell) throws IOException { super(); Logger.log("entered"); //$NON-NLS-1$ this.shell = shell; this.socket = socket; // serverInputStream = socket.getInputStream(); serverOutputStream = socket.getOutputStream(); inputChannel = Channels.newChannel(socket.getInputStream()); initializeOptions(); } public OutputStream getOutputStream() { return serverOutputStream; } public void setClientOutputStream(OutputStream stream) { clientOutputStream = stream; } /** * Returns true if the TCP connection represented by this object is * connected, false otherwise. */ public boolean isConnected() { return socket != null && socket.isConnected() && !socket.isClosed(); } /** * Returns true if the TCP connection represented by this object is * connected and the remote endpoint is a TELNET server, false otherwise. */ public boolean isRemoteTelnetServer() { return remoteIsTelnetServer; } /** * This method sets the terminal width and height to the supplied values. If * either new value differs from the corresponding old value, we initiate a * NAWS subnegotiation to inform the remote endpoint of the new terminal * size. */ public void setTerminalSize(int newWidth, int newHeight) { Logger.log("Setting new size: width = " + newWidth + ", height = " + newHeight); //$NON-NLS-1$ //$NON-NLS-2$ if (!isConnected() || !isRemoteTelnetServer()) { return; } boolean sizeChanged = false; if (newWidth != width || newHeight != height) { sizeChanged = true; } width = newWidth; height = newHeight; if (sizeChanged && remoteIsTelnetServer && localOptions[TELNET_OPTION_NAWS].isEnabled()) { Integer[] sizeData = { Integer.valueOf(width), Integer.valueOf(height) }; localOptions[TELNET_OPTION_NAWS].sendSubnegotiation(sizeData); } } /** * Returns true if local echoing is enabled for this TCP connection, false * otherwise. */ public boolean localEcho() { return localEcho; } /** * This method runs in its own thread. It reads raw bytes from the TELNET * connection socket, processes any TELNET protocol bytes (and removes * them), and passes the remaining bytes to a TerminalDisplay object for * display. */ @Override public void run() { Logger.log("Entered"); //$NON-NLS-1$ try { while (socket.isConnected()) { rawBytes.clear(); int nRawBytes = inputChannel.read(rawBytes); if (nRawBytes == -1) { // End of input on serverInputStream. Logger.log("End of input reading from socket!"); //$NON-NLS-1$ // Announce to the user that the remote endpoint has closed the // connection. if (clientOutputStream != null) { clientOutputStream.write(Messages.TelnetProtocol_0.getBytes()); } break; } // Process any TELNET protocol data that we receive. Don't // send any TELNET protocol data until we are sure the remote // endpoint is a TELNET server. int nProcessedBytes = processTelnetProtocol(nRawBytes); if (nProcessedBytes > 0 && clientOutputStream != null) { clientOutputStream.write(processedBytes, 0, nProcessedBytes); clientOutputStream.flush(); } } } catch (ClosedByInterruptException e) { // Handled by finally clause } catch (SocketException ex) { String message = ex.getMessage(); // A "socket closed" exception is normal here. It's caused by the // user clicking the disconnect button on the Terminal view toolbar. if (message != null && !message.equalsIgnoreCase("Socket closed") && !message.equalsIgnoreCase("Connection reset")) { //$NON-NLS-1$ //$NON-NLS-2$ Logger.logException(ex); } } catch (Exception ex) { Logger.logException(ex); } finally { // Tell the command shell that we have terminated shell.terminated(); try { if(inputChannel != null) { inputChannel.close(); } } catch (IOException ioe) { /* ignore */ } try { if(serverOutputStream != null) { serverOutputStream.close(); } } catch (IOException ioe) { /* ignore */ } try { if(clientOutputStream != null) { clientOutputStream.close(); } } catch (IOException ioe) { /* ignore */ } } } /** * This method initializes the localOptions[] and remoteOptions[] arrays so * that they contain references to TelnetOption objects representing our * desired state for each option. The goal is to achieve server-side * echoing, suppression of Go Aheads, and to send the local terminal type * and size to the remote endpoint. */ protected void initializeOptions() { // First, create all the TelnetOption objects in the "undesired" state. for (int i = 0; i < localOptions.length; ++i) { localOptions[i] = new TelnetOption((byte) i, false, true, serverOutputStream); } for (int i = 0; i < localOptions.length; ++i) { remoteOptions[i] = new TelnetOption((byte) i, false, false, serverOutputStream); } // Next, set some of the options to the "desired" state. The options we // desire to be enabled are as follows: // // TELNET Option Desired for Desired for // Name and Code Local Endpoint Remote Endpoint // --------------------- -------------- --------------- // Echo (1) No Yes // Suppress Go Ahead (3) Yes Yes // Terminal Type (24) Yes Yes // NAWS (31) Yes Yes // // All other options remain in the "undesired" state, and thus will be // disabled (since either endpoint can force any option to be disabled by simply // answering WILL with DONT and DO with WONT). localOptions[TELNET_OPTION_ECHO].setDesired(false); remoteOptions[TELNET_OPTION_ECHO].setDesired(true); localOptions[TELNET_OPTION_SUPPRESS_GA].setDesired(true); remoteOptions[TELNET_OPTION_SUPPRESS_GA].setDesired(true); localOptions[TELNET_OPTION_TERMINAL_TYPE].setDesired(true); remoteOptions[TELNET_OPTION_TERMINAL_TYPE].setDesired(true); localOptions[TELNET_OPTION_NAWS].setDesired(true); remoteOptions[TELNET_OPTION_NAWS].setDesired(true); } /** * Process TELNET protocol data contained in the first count bytes * of rawBytes. This function preserves its state between calls, * because a multi-byte TELNET command might be split between two (or more) * calls to this function. The state is preserved in field telnetState. * This function implements an FSA that recognizes TELNET option codes. * TELNET option sub-negotiation is delegated to instances of TelnetOption. * * @return The number of bytes remaining in the buffer after removing all * TELNET protocol bytes. */ // TELNET option state is stored in instances of TelnetOption. protected int processTelnetProtocol(int count) { // This is too noisy to leave on all the time. // Logger.log("Processing " + count + " bytes of data."); int nextProcessedByte = 0; for (int byteIndex = 0; byteIndex < count; ++byteIndex) { // It is possible for control to flow through the below code such // that nothing happens. This happens when array rawBytes[] contains no // TELNET protocol data. byte inputByte = rawBytes.get(byteIndex); int ubyte = inputByte & 0xFF; switch (telnetState) { case STATE_INITIAL: if (inputByte == TELNET_IAC) { telnetState = STATE_IAC_RECEIVED; } else { // It's not an IAC code, so just append it to // processedBytes. processedBytes[nextProcessedByte++] = inputByte; } break; case STATE_IAC_RECEIVED: switch (inputByte) { case TELNET_IAC: // Two IAC bytes in a row are translated into one byte with // the // value 0xff. processedBytes[nextProcessedByte++] = (byte) 0xff; telnetState = STATE_INITIAL; break; case TELNET_WILL: telnetState = STATE_WILL_RECEIVED; break; case TELNET_WONT: telnetState = STATE_WONT_RECEIVED; break; case TELNET_DO: telnetState = STATE_DO_RECEIVED; break; case TELNET_DONT: telnetState = STATE_DONT_RECEIVED; break; case TELNET_SB: telnetState = STATE_SUBNEGOTIATION_STARTED; break; // Commands to consume and ignore. // Data Mark (DM). This is sent by a TELNET server following an // IAC sent as TCP urgent data. It should cause the client to // skip all not yet processed non-TELNET-protocol data preceding the // DM byte. However, Java 1.4.x has no way to inform clients of // class Socket that urgent data is available, so we simply ignore the // "IAC DM" command. Since the IAC is sent as TCP urgent data, // the Socket must be put into OOB-inline mode via a call to // setOOBInline(true), otherwise the IAC is silently dropped by // Java and only the DM arrives (leaving the user to see a // spurious ISO Latin-1 character). case TELNET_DM: case TELNET_NOP: // No-op. case TELNET_GA: // Go Ahead command. Meaningless on a full-duplex link. case TELNET_IP: // Interupt Process command. Server should never send this. case TELNET_AO: // Abort Output command. Server should never send this. case TELNET_AYT: // Are You There command. Server should never send this. case TELNET_EC: // Erase Character command. Server should never send this. case TELNET_EL: // Erase Line command. Server should never send this. telnetState = STATE_INITIAL; break; default: // Unrecognized command! This should never happen. Logger.log("processTelnetProtocol: UNRECOGNIZED TELNET PROTOCOL COMMAND: " + //$NON-NLS-1$ ubyte); telnetState = STATE_INITIAL; break; } break; // For the next four cases, WILL and WONT commands affect the state // of remote options, and DO and DONT commands affect the state of // local options. case STATE_WILL_RECEIVED: Logger.log("Received WILL " + localOptions[ubyte].optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ remoteOptions[ubyte].handleWill(); telnetState = STATE_INITIAL; telnetServerDetected(); break; case STATE_WONT_RECEIVED: Logger.log("Received WONT " + localOptions[ubyte].optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ remoteOptions[ubyte].handleWont(); telnetState = STATE_INITIAL; telnetServerDetected(); break; case STATE_DO_RECEIVED: Logger.log("Received DO " + localOptions[ubyte].optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ localOptions[ubyte].handleDo(); telnetState = STATE_INITIAL; telnetServerDetected(); break; case STATE_DONT_RECEIVED: Logger.log("Received DONT " + localOptions[ubyte].optionName() + "."); //$NON-NLS-1$ //$NON-NLS-2$ localOptions[ubyte].handleDont(); telnetState = STATE_INITIAL; telnetServerDetected(); break; case STATE_SUBNEGOTIATION_STARTED: Logger.log("Starting subnegotiation for option " + //$NON-NLS-1$ localOptions[ubyte].optionName() + "."); //$NON-NLS-1$ // First, zero out the array of received subnegotiation butes. for (int i = 0; i < receivedSubnegotiation.length; ++i) { receivedSubnegotiation[i] = 0; } // Forget about any previous subnegotiation errors. ignoreSubnegotiation = false; // Then insert this input byte into the array and enter state // STATE_RECEIVING_SUBNEGOTIATION, where we will gather the // remaining subnegotiation bytes. nextSubnegotiationByteIndex = 0; receivedSubnegotiation[nextSubnegotiationByteIndex++] = inputByte; telnetState = STATE_RECEIVING_SUBNEGOTIATION; break; case STATE_RECEIVING_SUBNEGOTIATION: if (inputByte == TELNET_IAC) { // Handle double IAC bytes. From RFC 855: "if parameters // in an option 'subnegotiation' include a byte with a value // of 255, it is necessary to double this byte in accordance // the general TELNET rules." if (nextSubnegotiationByteIndex > 0 && receivedSubnegotiation[nextSubnegotiationByteIndex - 1] == TELNET_IAC) { // The last input byte we received in this // subnegotiation was IAC, so this is a double IAC. Leave the previous IAC // in the receivedSubnegotiation[] array and drop the current // one (thus translating a double IAC into a single IAC). Logger.log("Double IAC in subnegotiation translated into single IAC."); //$NON-NLS-1$ break; } // Append the IAC byte to receivedSubnegotiation[]. If there // is no room for the IAC byte, it overwrites the last byte, // because we need to know when the subnegotiation ends, and that is // marked by an "IAC SE" command. if (nextSubnegotiationByteIndex < receivedSubnegotiation.length) { receivedSubnegotiation[nextSubnegotiationByteIndex++] = inputByte; } else { receivedSubnegotiation[receivedSubnegotiation.length - 1] = inputByte; } break; } // Handle an "IAC SE" command, which marks the end of the // subnegotiation. An SE byte by itself might be a legitimate // part of the subnegotiation data, so don't do anything unless the SE // is immediately preceded by an IAC. if (inputByte == TELNET_SE && receivedSubnegotiation[nextSubnegotiationByteIndex - 1] == TELNET_IAC) { Logger.log("Found SE code marking end of subnegotiation."); //$NON-NLS-1$ // We are done receiving the subnegotiation command. Now // process it. We always use the option object stored in array // localOptions[] to process the received subnegotiation. // This is an arbitrary decision, but it is sufficient for handling // options TERMINAL-TYPE and NAWS, which are the only options that // we subnegotiate (presently). If, in the future,subnegotiations // need to be handled by option objects stored in both // localOptions[] and remoteOptions[], then some mechanism // to choose the correct option object must be implemented. // // Also, if ignoreSubnegotiation is true, there was an error // while receiving the subnegotiation, so we must not process the // command, and instead just return to the initial state. if (!ignoreSubnegotiation) { // Remove the trailing IAC byte from // receivedSubnegotiation[]. receivedSubnegotiation[nextSubnegotiationByteIndex - 1] = 0; int subnegotiatedOption = receivedSubnegotiation[0] & 0xFF; localOptions[subnegotiatedOption].handleSubnegotiation(receivedSubnegotiation, nextSubnegotiationByteIndex); } else { Logger.log("NOT CALLING handleSubnegotiation() BECAUSE OF ERRORS!"); //$NON-NLS-1$ } // Return to the initial state. telnetState = STATE_INITIAL; } // Check whether the receivedSubnegotiation[] array is full. if (nextSubnegotiationByteIndex >= receivedSubnegotiation.length) { // This should not happen. Array receivedSubnegotiation can // hold 128 bytes, and no TELNET option that we perform // subnegotiation for requires that many bytes in a subnegotiation command. // In the interest of robustness, we handle this case by ignoring all // remaining subnegotiation bytes until we receive the IAC SE // command that ends the subnegotiation. Also, we set // ignoreSubnegotiation to true to prevent a call to // handleSubnegotiation() when the IAC SE command arrives. Logger.log("SUBNEGOTIATION BUFFER FULL!"); //$NON-NLS-1$ ignoreSubnegotiation = true; } else { Logger.log("Recording subnegotiation byte " + ubyte); //$NON-NLS-1$ receivedSubnegotiation[nextSubnegotiationByteIndex++] = inputByte; } break; default: // This should _never_ happen! If it does, it means there is a // bug in this FSA. For robustness, we return to the initial state. Logger.log("INVALID TELNET STATE: " + telnetState); //$NON-NLS-1$ telnetState = STATE_INITIAL; break; } } // Return the number of bytes of processed data (i.e., number of bytes // of raw data minus TELNET control bytes). This value can be zero. return nextProcessedByte; } /** * This method is called whenever we receive a valid TELNET protocol command * from the remote endpoint. When it is called for the first time for this * connection, we negotiate all options that we desire to be enabled. *

* * This method does not negotiate options that we do not desire to be * enabled, because all options are initially disabled. *

*/ protected void telnetServerDetected() { if (!remoteIsTelnetServer) { // This block only executes once per TelnetProtocol instance. localEcho = false; Logger.log("Detected TELNET server."); //$NON-NLS-1$ remoteIsTelnetServer = true; for (TelnetOption localOption : localOptions) { if (localOption.isDesired()) { localOption.negotiate(); } } for (TelnetOption remoteOption : remoteOptions) { if (remoteOption.isDesired()) { remoteOption.negotiate(); } } } } } internal/000077500000000000000000000000001272114001700344035ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnetcore/000077500000000000000000000000001272114001700353335ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnet/internalActivator.java000066400000000000000000000030331272114001700401310ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnet/internal/core/******************************************************************************* * Copyright (c) 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial contribution *******************************************************************************/ package org.eclipse.remote.telnet.internal.core; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Status; import org.osgi.framework.BundleContext; public class Activator extends Plugin { public static final String PLUGIN_ID = "org.eclipse.remote.telnet.core"; //$NON-NLS-1$ private static Plugin plugin; @Override public void start(BundleContext bundleContext) throws Exception { plugin = this; Logger.configure(bundleContext); } @Override public void stop(BundleContext bundleContext) throws Exception { plugin = null; } public static Plugin getDefault() { return plugin; } public static void log(IStatus status) { plugin.getLog().log(status); } public static void log(Throwable e) { if (e instanceof CoreException) { log(((CoreException) e).getStatus()); } else { log(new Status(IStatus.ERROR, plugin.getBundle().getSymbolicName(), IStatus.ERROR, e.getLocalizedMessage(), e)); } } } Logger.java000066400000000000000000000164071272114001700374250ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnet/internal/core/******************************************************************************* * Copyright (c) 2005, 2015 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Fran Litterio (Wind River) - initial API and implementation * Ted Williams (Wind River) - refactored into org.eclipse namespace * Michael Scharf (Wind River) - split into core, view and connector plugins * Martin Oberhuber (Wind River) - fixed copyright headers and beautified * Greg Watson (IBM) - Adapted for org.eclipse.remote *******************************************************************************/ package org.eclipse.remote.telnet.internal.core; import java.io.FileOutputStream; import java.io.PrintStream; import java.util.Hashtable; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.osgi.service.debug.DebugOptions; import org.eclipse.osgi.service.debug.DebugOptionsListener; import org.osgi.framework.BundleContext; /** * A simple logger class. Every method in this class is static, so they can be * called from both class and instance methods. To use this class, write code * like this: *

* *

 * Logger.log("something has happened");
 * Logger.log("counter is " + counter);
 * 
* * @author Fran Litterio * */ public final class Logger implements DebugOptionsListener { public static final String TRACE_DEBUG_LOG = "org.eclipse.remote.telnet.core/debug/log"; //$NON-NLS-1$ public static final String TRACE_DEBUG_LOG_CHAR = "org.eclipse.remote.telnet.coredebug/log/char"; //$NON-NLS-1$ public static final String TRACE_DEBUG_LOG_VT100BACKEND = "org.eclipse.remote.telnet.core/debug/log/VT100Backend"; //$NON-NLS-1$ private static PrintStream logStream; private static Logger logger; private DebugOptions options; public static void configure(BundleContext context) { if (logger == null) { logger = new Logger(context); } } private Logger(BundleContext context) { Hashtable props = new Hashtable(2); props.put(DebugOptions.LISTENER_SYMBOLICNAME, Activator.PLUGIN_ID); context.registerService(DebugOptionsListener.class.getName(), this, props); } /** * Encodes a String such that non-printable control characters are * converted into user-readable escape sequences for logging. * * @param message * String to encode * @return encoded String */ public static final String encode(String message) { boolean encoded = false; StringBuffer buf = new StringBuffer(message.length() + 32); for (int i = 0; i < message.length(); i++) { char c = message.charAt(i); switch (c) { case '\\': case '\'': buf.append('\\'); buf.append(c); encoded = true; break; case '\r': buf.append('\\'); buf.append('r'); encoded = true; break; case '\n': buf.append('\\'); buf.append('n'); encoded = true; break; case '\t': buf.append('\\'); buf.append('t'); encoded = true; break; case '\f': buf.append('\\'); buf.append('f'); encoded = true; break; case '\b': buf.append('\\'); buf.append('b'); encoded = true; break; default: if (c <= '\u000f') { buf.append('\\'); buf.append('x'); buf.append('0'); buf.append(Integer.toHexString(c)); encoded = true; } else if (c >= ' ' && c < '\u007f') { buf.append(c); } else if (c <= '\u00ff') { buf.append('\\'); buf.append('x'); buf.append(Integer.toHexString(c)); encoded = true; } else { buf.append('\\'); buf.append('u'); if (c <= '\u0fff') { buf.append('0'); } buf.append(Integer.toHexString(c)); encoded = true; } } } if (encoded) { return buf.toString(); } return message; } /** * Checks if logging is enabled. * * @return true if logging is enabled. */ public static final boolean isLogEnabled() { return (logStream != null); } /** * Logs the specified message. Do not append a newline to parameter * message. This method does that for you. * * @param message * A String containing the message to log. */ public static final void log(String message) { if (logStream != null) { // Read my own stack to get the class name, method name, and line // number of // where this method was called. StackTraceElement caller = new Throwable().getStackTrace()[1]; int lineNumber = caller.getLineNumber(); String className = caller.getClassName(); String methodName = caller.getMethodName(); className = className.substring(className.lastIndexOf('.') + 1); logStream.println(className + "." + methodName + ":" + lineNumber + ": " + message); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ logStream.flush(); } } /** * Writes a stack trace for an exception to both Standard Error and to the * log file. */ public static final void logException(Exception ex) { // log in eclipse error log if (Activator.getDefault() != null) { Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.OK, ex.getMessage(), ex)); } else { ex.printStackTrace(); } // Additional Tracing for debug purposes: // Read my own stack to get the class name, method name, and line number // of where this method was called if (logStream != null) { StackTraceElement caller = new Throwable().getStackTrace()[1]; int lineNumber = caller.getLineNumber(); String className = caller.getClassName(); String methodName = caller.getMethodName(); className = className.substring(className.lastIndexOf('.') + 1); PrintStream tmpStream = System.err; if (logStream != null) { tmpStream = logStream; } tmpStream.println(className + "." + methodName + ":" + lineNumber + ": " + //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ "Caught exception: " + ex); //$NON-NLS-1$ ex.printStackTrace(tmpStream); } } @Override public void optionsChanged(DebugOptions options) { this.options = options; // Any of the three known debugging options turns on the creation of the log file boolean createLogFile = isOptionEnabled(TRACE_DEBUG_LOG) || isOptionEnabled(TRACE_DEBUG_LOG_CHAR) || isOptionEnabled(TRACE_DEBUG_LOG_VT100BACKEND); // Log only if tracing is enabled if (createLogFile && Activator.getDefault() != null) { IPath logFile = Platform.getStateLocation(Activator.getDefault().getBundle()); if (logFile != null && logFile.toFile().isDirectory()) { logFile = logFile.append("tmterminal.log"); //$NON-NLS-1$ try { logStream = new PrintStream(new FileOutputStream(logFile.toFile(), true)); } catch (Exception ex) { logStream = System.err; logStream.println("Exception when opening log file -- logging to stderr!"); //$NON-NLS-1$ ex.printStackTrace(logStream); } } } } public boolean isOptionEnabled(String option) { if (options == null) { return false; } return options.getBooleanOption(Activator.PLUGIN_ID + option, false); } } messages/000077500000000000000000000000001272114001700371425ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnet/internal/coreMessages.java000066400000000000000000000017301272114001700415550ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnet/internal/core/messages/******************************************************************************* * Copyright (c) 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial contribution *******************************************************************************/ package org.eclipse.remote.telnet.internal.core.messages; import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.remote.telnet.internal.core.messages.messages"; //$NON-NLS-1$ public static String TelnetCommandShell_0; public static String TelnetProtocol_0; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); } private Messages() { } } messages.properties000066400000000000000000000011311272114001700430630ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnet/internal/core/messages################################################################################ # Copyright (c) 2015 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 available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # IBM Corporation - initial contribution ################################################################################ TelnetCommandShell_0=Unknown host: TelnetProtocol_0=Connection closed by foreign host. org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/000077500000000000000000000000001272114001700245435ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/.classpath000066400000000000000000000005611272114001700265300ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/.gitignore000066400000000000000000000000061272114001700265270ustar00rootroot00000000000000/bin/ org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/.project000066400000000000000000000012251272114001700262120ustar00rootroot00000000000000 org.eclipse.remote.telnet.ui org.eclipse.jdt.core.javabuilder org.eclipse.pde.ManifestBuilder org.eclipse.pde.SchemaBuilder org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/.settings/000077500000000000000000000000001272114001700264615ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/.settings/org.eclipse.jdt.core.prefs000066400000000000000000000005451272114001700334470ustar00rootroot00000000000000eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/META-INF/000077500000000000000000000000001272114001700257035ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/META-INF/MANIFEST.MF000066400000000000000000000015731272114001700273430ustar00rootroot00000000000000Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %bundleName Bundle-SymbolicName: org.eclipse.remote.telnet.ui;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-Activator: org.eclipse.remote.telnet.internal.ui.Activator Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Bundle-Vendor: %providerName Bundle-Localization: plugin Import-Package: org.eclipse.core.runtime, org.eclipse.jface.dialogs, org.eclipse.jface.operation, org.eclipse.jface.resource, org.eclipse.jface.viewers, org.eclipse.jface.window, org.eclipse.jface.wizard, org.eclipse.osgi.util, org.eclipse.remote.core, org.eclipse.remote.core.exception, org.eclipse.remote.telnet.core, org.eclipse.remote.ui, org.eclipse.swt, org.eclipse.swt.events, org.eclipse.swt.graphics, org.eclipse.swt.layout, org.eclipse.swt.widgets, org.eclipse.ui.plugin, org.osgi.framework org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/about.html000066400000000000000000000024471272114001700265520ustar00rootroot00000000000000 About

About This Content

May 2, 2006

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/about.ini000066400000000000000000000016471272114001700263660ustar00rootroot00000000000000# about.ini # contains information about a feature # java.io.Properties file (ISO 8859-1 with "\" escapes) # "%key" are externalized strings defined in about.properties # This file does not need to be translated. # Property "aboutText" contains blurb for "About" dialog (translated) aboutText=%blurb # Property "windowImage" contains path to window icon (16x16) # needed for primary features only # Property "featureImage" contains path to feature image (32x32) featureImage=ptp_logo_icon32.png # Property "aboutImage" contains path to product image (500x330 or 115x164) # needed for primary features only # Property "appName" contains name of the application (not translated) # needed for primary features only # Property "welcomePage" contains path to welcome page (special XML-based format) # optional # Property "welcomePerspective" contains the id of the perspective in which the # welcome page is to be opened. # optional org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/about.mappings000066400000000000000000000002501272114001700274120ustar00rootroot00000000000000# about.mappings # contains fill-ins for about.properties # java.io.Properties file (ISO 8859-1 with "\" escapes) # This file does not need to be translated. 0=@build@org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/about.properties000066400000000000000000000013771272114001700300030ustar00rootroot00000000000000############################################################################### # Copyright (c) 2015 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 available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # IBM Corporation - initial API and implementation ############################################################################### # NLS_MESSAGEFORMAT_NONE # NLS_ENCODING=UTF-8 blurb=Telnet Remote Services\n\ \n\ Version: {featureVersion}\n\ Build id: {0}\n\ \n\ Copyright (c) 2015 IBM Corporation, and others. All rights reserved.\n\ Visit http://www.eclipse.org/ptp\n org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/build.properties000066400000000000000000000005011272114001700277540ustar00rootroot00000000000000source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ plugin.xml,\ about.html,\ about.ini,\ about.mappings,\ about.properties,\ ptp_logo_icon32.png,\ icons/,\ plugin.properties org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/icons/000077500000000000000000000000001272114001700256565ustar00rootroot00000000000000org.eclip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4}څh;lpAZ%XZ;tQ?yk1+Ƴu6[ Dc4Ɯ*dB#!}e>samhG3c^8u9󼵕⸈߂UyB;f "Yi=D =4&|C3g]~WgjhSIXU"1A5Fr4{AljwTt6</N \Rta| i>T.Wo>>xϯY{緷m,J{gg}v~)]s!?wXGFl!7U|Cnfﳅ:.@mq%臔Ru?.:aBֺE#Gg'yXDuSWNJD)21ѵVagWPqȒ s?¶@g")s\T{f3go^w:^"{d#!φt},nyWFKv„X4|VB~,˘_&fjp/WԍwaO H 3I`u1ͤ+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_Wݚw)2iTXtXML:com.adobe.xmp 1 Adobe Fireworks CS3 2015-06-15T13:52:15Z 2015-06-15T13:52:15Z image/png z{IDAT8kY?՛ ƈqL<,*, {ZlNxP A%˒xXs7!&Y6Y3dfjAQuַ~ˣO\}B _#ݝ`ΰ3 C}~#QC} A0ͰU,zED IR.^$I#$I'O"p nqkk뜞y67Lq/^H/YeeGGGb?Dc cP#TCU1**N8@cll(PQ<6x:U`YK^g~~NDlZĭ{lSZ=[Ʃ0Mi6lsrr ajqN >`|8Wajj?ꘘ MX[h4 h\ >)KK_#VeyNZevf,x~uz>,!2b  ll%2{{sX Tb?ܽy?Da$M9>>AU1Z[EyP>[[sB韸vg!{( w =9o4M6s org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/pom.xml000066400000000000000000000012151272114001700260570ustar00rootroot00000000000000 4.0.0 org.eclipse.remote remote-parent 2.1.0-SNAPSHOT ../../releng/org.eclipse.remote.build/pom.xml org.eclipse.remote.telnet.ui eclipse-plugin 1.0.0-SNAPSHOT org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/ptp_logo_icon32.png000066400000000000000000001476271272114001700302720ustar00rootroot00000000000000PNG  IHDR VόsBIT|d pHYs  ~tEXtSoftwareAdobe Fireworks CS3F:prVWxn18cw^ mL@ApD{E**Ur ^GGo#T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000000001272114001700253325ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/src/org/000077500000000000000000000000001272114001700261215ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/src/org/eclipse/000077500000000000000000000000001272114001700275455ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/src/org/eclipse/remote/000077500000000000000000000000001272114001700310405ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/src/org/eclipse/remote/telnet/000077500000000000000000000000001272114001700323335ustar00rootroot00000000000000internal/000077500000000000000000000000001272114001700340705ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/src/org/eclipse/remote/telnetui/000077500000000000000000000000001272114001700345055ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/src/org/eclipse/remote/telnet/internalActivator.java000066400000000000000000000043021272114001700373030ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/src/org/eclipse/remote/telnet/internal/ui/******************************************************************************* * Copyright (c) 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial contribution *******************************************************************************/ package org.eclipse.remote.telnet.internal.ui; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; /** * The activator class controls the plug-in life cycle */ public class Activator extends AbstractUIPlugin { // The plug-in ID public static final String PLUGIN_ID = "org.eclipse.remote.telnet.ui"; //$NON-NLS-1$ // Image keys public static final String IMG_CONNECTION_TYPE = PLUGIN_ID + ".connectionType"; //$NON-NLS-1$ // The shared instance private static Activator plugin; @Override public void start(BundleContext context) throws Exception { super.start(context); plugin = this; getImageRegistry().put(IMG_CONNECTION_TYPE, imageDescriptorFromPlugin(PLUGIN_ID, "/icons/telnet.png")); //$NON-NLS-1$ } @Override public void stop(BundleContext context) throws Exception { plugin = null; super.stop(context); } /** * Returns the shared instance * * @return the shared instance */ public static Activator getDefault() { return plugin; } public static void log(IStatus status) { plugin.getLog().log(status); } public static void log(Exception e) { if (e instanceof CoreException) { log(((CoreException) e).getStatus()); } else { log(new Status(IStatus.ERROR, PLUGIN_ID, e.getLocalizedMessage(), e)); } } public static T getService(Class service) { BundleContext context = plugin.getBundle().getBundleContext(); ServiceReference ref = context.getServiceReference(service); return ref != null ? context.getService(ref) : null; } } Messages.java000066400000000000000000000032251272114001700371210ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/src/org/eclipse/remote/telnet/internal/ui/******************************************************************************* * Copyright (c) 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial contribution *******************************************************************************/ package org.eclipse.remote.telnet.internal.ui; import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.remote.telnet.internal.ui.messages"; //$NON-NLS-1$ public static String NewSerialPortConnectionWizardPage_BaudRateLabel; public static String NewSerialPortConnectionWizardPage_ByteSizeLabel; public static String NewSerialPortConnectionWizardPage_Description; public static String NewSerialPortConnectionWizardPage_NameLabel; public static String NewSerialPortConnectionWizardPage_ParityLabel; public static String NewSerialPortConnectionWizardPage_PortLabel; public static String NewSerialPortConnectionWizardPage_StopBitsLabel; public static String NewSerialPortConnectionWizardPage_Title; public static String TelnetConnectionWizardPage_0; public static String TelnetConnectionWizardPage_1; public static String TelnetConnectionWizardPage_2; public static String TelnetConnectionWizardPage_3; public static String TelnetConnectionWizardPage_4; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); } private Messages() { } } TelnetConnectionWizard.java000066400000000000000000000057671272114001700420230ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/src/org/eclipse/remote/telnet/internal/ui/******************************************************************************* * Copyright (c) 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial contribution *******************************************************************************/ package org.eclipse.remote.telnet.internal.ui; import java.util.Set; import org.eclipse.jface.wizard.Wizard; import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionHostService; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.ui.IRemoteUIConnectionWizard; import org.eclipse.swt.widgets.Shell; public class TelnetConnectionWizard extends Wizard implements IRemoteUIConnectionWizard { private TelnetConnectionWizardPage page; private IRemoteConnectionWorkingCopy workingCopy; private final Shell shell; private final IRemoteConnectionType connectionType; public TelnetConnectionWizard(Shell shell, IRemoteConnectionType connectionType) { this.shell = shell; this.connectionType = connectionType; } @Override public void addPages() { page = new TelnetConnectionWizardPage(); if (workingCopy != null) { IRemoteConnectionHostService hostSvc = workingCopy.getService(IRemoteConnectionHostService.class); if (hostSvc != null) { page.setHost(hostSvc.getHostname()); page.setPort(hostSvc.getPort()); page.setTimeout(hostSvc.getTimeout()); } } addPage(page); } @Override public boolean performFinish() { IRemoteConnection conn = getConnection(); if (conn != null) { IRemoteConnectionHostService hostSvc = conn.getService(IRemoteConnectionHostService.class); if (hostSvc != null) { hostSvc.setHostname(page.getHost()); hostSvc.setPort(page.getPort()); hostSvc.setTimeout(page.getTimeout()); return true; } } return false; } @Override public IRemoteConnectionWorkingCopy open() { WizardDialog dialog = new WizardDialog(shell, this); dialog.setBlockOnOpen(true); if (dialog.open() == WizardDialog.OK) { return getConnection(); } return null; } @Override public IRemoteConnectionWorkingCopy getConnection() { if (workingCopy == null) { try { workingCopy = connectionType.newConnection(page.getHost()); } catch (RemoteConnectionException e) { Activator.log(e.getStatus()); } } return workingCopy; } @Override public void setConnection(IRemoteConnectionWorkingCopy connection) { workingCopy = connection; } @Override public void setConnectionName(String name) { // Ignored } @Override public void setInvalidConnectionNames(Set names) { // Ignored } } TelnetConnectionWizardPage.java000066400000000000000000000074041272114001700426060ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/src/org/eclipse/remote/telnet/internal/ui/******************************************************************************* * Copyright (c) 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial contribution *******************************************************************************/ package org.eclipse.remote.telnet.internal.ui; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.remote.telnet.core.TelnetConnection; import org.eclipse.swt.SWT; import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.KeyListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; public class TelnetConnectionWizardPage extends WizardPage { private String host; private int port = TelnetConnection.DEFAULT_PORT; private int timeout = TelnetConnection.DEFAULT_TIMEOUT; private Text hostText; private Text portText; private Text timeoutText; protected TelnetConnectionWizardPage() { super(TelnetConnectionWizardPage.class.getName()); setDescription(Messages.TelnetConnectionWizardPage_0); setTitle(Messages.TelnetConnectionWizardPage_1); } @Override public void createControl(Composite parent) { Composite comp = new Composite(parent, SWT.NONE); comp.setLayout(new GridLayout(2, false)); Label nameLabel = new Label(comp, SWT.NONE); nameLabel.setText(Messages.TelnetConnectionWizardPage_2); hostText = new Text(comp, SWT.BORDER | SWT.SINGLE); hostText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); hostText.setText(host != null ? host : ""); //$NON-NLS-1$ hostText.addKeyListener(new KeyListener() { @Override public void keyReleased(KeyEvent e) { updateStatus(); } @Override public void keyPressed(KeyEvent e) { // Ignore } }); Label portLabel = new Label(comp, SWT.NONE); portLabel.setText(Messages.TelnetConnectionWizardPage_3); portText = new Text(comp, SWT.BORDER | SWT.SINGLE); portText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); portText.setText(port < 0 ? "" : Integer.toString(port)); //$NON-NLS-1$ portText.addKeyListener(new KeyListener() { @Override public void keyReleased(KeyEvent e) { updateStatus(); } @Override public void keyPressed(KeyEvent e) { // Ignore } }); Label timeoutLabel = new Label(comp, SWT.NONE); timeoutLabel.setText(Messages.TelnetConnectionWizardPage_4); timeoutText = new Text(comp, SWT.BORDER | SWT.SINGLE); timeoutText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); timeoutText.setText(timeout < 0 ? "" : Integer.toString(timeout)); //$NON-NLS-1$ timeoutText.addKeyListener(new KeyListener() { @Override public void keyReleased(KeyEvent e) { updateStatus(); } @Override public void keyPressed(KeyEvent e) { // Ignore } }); setControl(comp); updateStatus(); } private void updateStatus() { host = hostText.getText(); try { port = Integer.parseInt(portText.getText()); } catch (NumberFormatException e) { port = -1; } try { timeout = Integer.parseInt(timeoutText.getText()); } catch (NumberFormatException e) { timeout = -1; } setPageComplete(!host.isEmpty()); } public String getHost() { return host; } public int getPort() { return port; } public int getTimeout() { return timeout; } public void setHost(String host) { this.host = host; } public void setPort(int port) { this.port = port; } public void setTimeout(int timeout) { this.timeout = timeout; } } TelnetConnectionsUI.java000066400000000000000000000063641272114001700412550ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/src/org/eclipse/remote/telnet/internal/ui/******************************************************************************* * Copyright (c) 2015 QNX Software Systems, and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - initial contribution * Greg Watson (IBM) - Adapted for telnet service *******************************************************************************/ package org.eclipse.remote.telnet.internal.ui; import java.lang.reflect.InvocationTargetException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionType.Service; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.ui.AbstractRemoteUIConnectionService; import org.eclipse.remote.ui.IRemoteUIConnectionService; import org.eclipse.remote.ui.IRemoteUIConnectionWizard; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Shell; public class TelnetConnectionsUI extends AbstractRemoteUIConnectionService { private final IRemoteConnectionType connectionType; private TelnetConnectionsUI(IRemoteConnectionType connectionType) { this.connectionType = connectionType; } public static class Factory implements IRemoteConnectionType.Service.Factory { @SuppressWarnings("unchecked") @Override public T getService(IRemoteConnectionType connectionType, Class service) { if (IRemoteUIConnectionService.class.equals(service)) { return (T) new TelnetConnectionsUI(connectionType); } return null; } } @Override public IRemoteConnectionType getConnectionType() { return connectionType; } @Override public IRemoteUIConnectionWizard getConnectionWizard(Shell shell) { return new TelnetConnectionWizard(shell, connectionType); } @Override public void openConnectionWithProgress(Shell shell, IRunnableContext context, final IRemoteConnection connection) { try { IRunnableWithProgress op = new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { connection.open(monitor); } catch (RemoteConnectionException e) { throw new InvocationTargetException(e); } if (monitor.isCanceled()) { throw new InterruptedException(); } } }; if (context != null) { context.run(true, true, op); } else { new ProgressMonitorDialog(shell).run(true, true, op); } } catch (InvocationTargetException | InterruptedException e) { Activator.log(e); } } @Override public ILabelProvider getLabelProvider() { return new DefaultLabelProvider() { @Override public Image getImage(Object element) { return Activator.getDefault().getImageRegistry().get(Activator.IMG_CONNECTION_TYPE); } }; } } messages.properties000066400000000000000000000023151272114001700404330ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.telnet.ui/src/org/eclipse/remote/telnet/internal/ui################################################################################ # Copyright (c) 2015 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 available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # IBM Corporation - initial contribution ################################################################################ NewSerialPortConnectionWizardPage_BaudRateLabel=Baud rate: NewSerialPortConnectionWizardPage_ByteSizeLabel=Data size: NewSerialPortConnectionWizardPage_Description=New serial port connection settings NewSerialPortConnectionWizardPage_NameLabel=Connection name: NewSerialPortConnectionWizardPage_ParityLabel=Parity: NewSerialPortConnectionWizardPage_PortLabel=Serial port: NewSerialPortConnectionWizardPage_StopBitsLabel=Stop bits: NewSerialPortConnectionWizardPage_Title=New Serial Port Connection TelnetConnectionWizardPage_0=New telnet connection settings TelnetConnectionWizardPage_1=New Telnet Connection TelnetConnectionWizardPage_2=Host TelnetConnectionWizardPage_3=Port: TelnetConnectionWizardPage_4=Timeout: org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/000077500000000000000000000000001272114001700232515ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/.classpath000066400000000000000000000005611272114001700252360ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/.gitignore000066400000000000000000000000051272114001700252340ustar00rootroot00000000000000/bin org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/.project000066400000000000000000000015141272114001700247210ustar00rootroot00000000000000 org.eclipse.remote.ui org.eclipse.jdt.core.javabuilder org.eclipse.pde.ManifestBuilder org.eclipse.pde.SchemaBuilder org.eclipse.pde.api.tools.apiAnalysisBuilder org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.pde.api.tools.apiAnalysisNature org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/.settings/000077500000000000000000000000001272114001700251675ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/.settings/org.eclipse.jdt.core.prefs000066400000000000000000000011131272114001700321450ustar00rootroot00000000000000eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/META-INF/000077500000000000000000000000001272114001700244115ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/META-INF/MANIFEST.MF000066400000000000000000000032141272114001700260430ustar00rootroot00000000000000Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.remote.ui;singleton:=true Bundle-Version: 2.0.0.qualifier Bundle-Activator: org.eclipse.remote.internal.ui.RemoteUIPlugin Bundle-Vendor: %pluginProvider Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.remote.internal.ui;x-internal:=true, org.eclipse.remote.internal.ui.messages;x-internal:=true, org.eclipse.remote.internal.ui.preferences;x-internal:=true, org.eclipse.remote.internal.ui.services.local;x-internal:=true, org.eclipse.remote.ui, org.eclipse.remote.ui.dialogs, org.eclipse.remote.ui.widgets Bundle-Localization: plugin Import-Package: org.eclipse.core.commands, org.eclipse.core.expressions, org.eclipse.core.filesystem, org.eclipse.core.resources, org.eclipse.core.runtime, org.eclipse.core.runtime.jobs, org.eclipse.core.runtime.preferences;version="3.3.0", org.eclipse.jface.action, org.eclipse.jface.dialogs, org.eclipse.jface.operation, org.eclipse.jface.preference, org.eclipse.jface.resource, org.eclipse.jface.util, org.eclipse.jface.viewers, org.eclipse.jface.window, org.eclipse.jface.wizard, org.eclipse.osgi.util, org.eclipse.remote.core, org.eclipse.remote.core.exception, org.eclipse.remote.internal.core.preferences, org.eclipse.remote.ui.widgets, org.eclipse.swt, org.eclipse.swt.events, org.eclipse.swt.graphics, org.eclipse.swt.layout, org.eclipse.swt.widgets, org.eclipse.ui, org.eclipse.ui.dialogs, org.eclipse.ui.handlers, org.eclipse.ui.model, org.eclipse.ui.navigator, org.eclipse.ui.plugin, org.eclipse.ui.progress, org.osgi.framework org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/about.html000066400000000000000000000024471272114001700252600ustar00rootroot00000000000000 About

About This Content

May 2, 2006

License

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/build.properties000066400000000000000000000002771272114001700264740ustar00rootroot00000000000000source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ plugin.xml,\ about.html,\ plugin.properties,\ icons/ org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/icons/000077500000000000000000000000001272114001700243645ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/icons/connection.gif000066400000000000000000000002401272114001700272060ustar00rootroot00000000000000GIF89aokպ&!,M18[wLTh5/\bx>cAIHQp#18G0>y^;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/icons/console.png000066400000000000000000000007041272114001700265350ustar00rootroot00000000000000PNG  IHDRaIDATxc`,=do^tyׄeс4P 0+:?@j7A߬pGLIio8"?H=F @Q 0H?:l@YY5k.:[Tq9AQ OY?!($G1@7a>mSɛ?b>؀ AQ Ў?b"؀w?o> ȭՀ9 kA\0oiW‹f׉5Fl?g}6DF` 30q=FrN/0_A=vkњZحxEڰ͵xo) au}6s1 ! IENDB`org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/icons/dlcl16/000077500000000000000000000000001272114001700254515ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/icons/dlcl16/new_folder.gif000066400000000000000000000005351272114001700302670ustar00rootroot00000000000000GIF89aϵ##&žy݃ߨ볙tډߖӜu}ȑܷ˷}1443Nj7ʼn6‡6w/y0u/|2w0p&!/,zpH, ciY"&aEu@ayx( i;  B''B"#B$$B+!B))B,(C*GA;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/icons/dlcl16/up_nav.gif000077500000000000000000000010631272114001700274330ustar00rootroot00000000000000GIF89azJUY[_`bef!i"i'l&l5u@|NXdiŧĶȶǷȷߖыډߖtu}ٲqŊ6z0‡543}2Nj7ʼn64†6w/u/|2z1w0p&!F,F;;DEED;!!#(24<""5>$$''7=%&&89))* *)9A,/  /:B+.  -6C13300?@@ F 0~$$''7=%&&89))* *)9A,/  /:B+.  -6C13300?@@ F 0~q&Hl!I`c6РabJ-K֠B;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/icons/ovr16/000077500000000000000000000000001272114001700253415ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/icons/ovr16/symlink_ovr.gif000066400000000000000000000002771272114001700304120ustar00rootroot00000000000000GIF89a2],EntTmSm"Cg6Tw!Created with GIMP!,' Ȣ0M PDA0IBQ)qi:/!;org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/plugin.properties000066400000000000000000000016231272114001700266670ustar00rootroot00000000000000############################################################################### # Copyright (c) 2013 IBM Corporation. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # ############################################################################### pluginName=Remote Services UI pluginProvider=Eclipse PTP RemoteDevPrefPage.name=Remote Development ConnectionsPreferencePage.name=Remote Connections ConnectionsViewCategory.name=Connections ConnectionsView.name=Connections ConnectionsContent.name=Connections NewConnectionCommand.name=New Connection DeleteConnectionCommand.name=Delete Connection ConnectionProperties.name=Connection OpenConnectionCommand.name=Open Connection CloseConnectionCommand.name=Close Connection org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/plugin.xml000066400000000000000000000210221272114001700252660ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/pom.xml000066400000000000000000000012061272114001700245650ustar00rootroot00000000000000 4.0.0 org.eclipse.remote remote-parent 2.1.0-SNAPSHOT ../../releng/org.eclipse.remote.build/pom.xml org.eclipse.remote.ui eclipse-plugin 2.0.0-SNAPSHOT org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/000077500000000000000000000000001272114001700240405ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/000077500000000000000000000000001272114001700246275ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/000077500000000000000000000000001272114001700262535ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/000077500000000000000000000000001272114001700275465ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/000077500000000000000000000000001272114001700313625ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/000077500000000000000000000000001272114001700317775ustar00rootroot00000000000000DeferredFileStore.java000066400000000000000000000200121272114001700361130ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/******************************************************************************* * Copyright (c) 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui; import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; import org.eclipse.core.filesystem.EFS; import org.eclipse.core.filesystem.IFileInfo; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.PlatformObject; import org.eclipse.core.runtime.jobs.ISchedulingRule; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.dialogs.FileSystemElement; import org.eclipse.ui.model.IWorkbenchAdapter; import org.eclipse.ui.progress.IDeferredWorkbenchAdapter; import org.eclipse.ui.progress.IElementCollector; public class DeferredFileStore implements IDeferredWorkbenchAdapter, IAdaptable { private final IFileStore fFileStore; private IFileInfo fFileInfo; private IFileInfo fTargetInfo; private ImageDescriptor fImage; private final boolean fExcludeHidden; private final DeferredFileStore fParent; public DeferredFileStore(IFileStore store, boolean exclude) { this(store, null, exclude, null); } /** * @since 7.0 */ public DeferredFileStore(IFileStore store, boolean exclude, DeferredFileStore parent) { this(store, null, exclude, parent); } /** * @since 7.0 */ public DeferredFileStore(IFileStore store, IFileInfo info, boolean exclude, DeferredFileStore parent) { fFileStore = store; fFileInfo = info; fExcludeHidden = exclude; fParent = parent; } /* * (non-Javadoc) * * @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#fetchDeferredChildren(java.lang.Object, * org.eclipse.ui.progress.IElementCollector, org.eclipse.core.runtime.IProgressMonitor) */ @Override public void fetchDeferredChildren(Object object, IElementCollector collector, IProgressMonitor monitor) { ArrayList children = new ArrayList(); try { IFileInfo[] childInfos = fFileStore.childInfos(EFS.NONE, monitor); for (IFileInfo info : childInfos) { if (!(fExcludeHidden && info.getName().startsWith("."))) { //$NON-NLS-1$ children.add(new DeferredFileStore(fFileStore.getChild(info.getName()), info, fExcludeHidden, this)); } } } catch (CoreException e) { // Ignore } if (children != null) { collector.add(children.toArray(), monitor); } collector.done(); } /** * Fetch the file info for the store. If the store is a symbolic link, fetch the file info for the target as well. */ private void fetchInfo() { if (fFileInfo == null) { fFileInfo = fFileStore.fetchInfo(); } if (fTargetInfo == null && fFileInfo.getAttribute(EFS.ATTRIBUTE_SYMLINK)) { String target = fFileInfo.getStringAttribute(EFS.ATTRIBUTE_LINK_TARGET); if (target != null) { try { URI targetUri = new URI(null, null, target, null); // Make sure target is escaped correctly URI uri = fFileStore.toURI().resolve(targetUri.getRawPath()); IFileStore store = fFileStore.getFileSystem().getStore(uri); fTargetInfo = store.fetchInfo(); } catch (URISyntaxException e) { RemoteUIPlugin.log(e); } } } } @SuppressWarnings("rawtypes") @Override public Object getAdapter(Class adapter) { if (IWorkbenchAdapter.class.equals(adapter)) { return this; } return null; } /** * Return the IWorkbenchAdapter for element or the element if it is * an instance of IWorkbenchAdapter. If it does not exist return * null. * * @param element * @return IWorkbenchAdapter or null */ protected IWorkbenchAdapter getAdapter(Object element) { return (IWorkbenchAdapter) getAdapter(element, IWorkbenchAdapter.class); } /** * If it is possible to adapt the given object to the given type, this returns the adapter. Performs the following checks: * *
    *
  1. Returns sourceObject if it is an instance of the adapter type.
  2. *
  3. If sourceObject implements IAdaptable, it is queried for adapters.
  4. *
  5. If sourceObject is not an instance of PlatformObject (which would have already done so), the adapter manager is queried * for adapters
  6. *
* * Otherwise returns null. * * @param sourceObject * object to adapt, or null * @param adapterType * type to adapt to * @return a representation of sourceObject that is assignable to the adapter type, or null if no such representation exists */ @SuppressWarnings("rawtypes") protected Object getAdapter(Object sourceObject, Class adapterType) { Assert.isNotNull(adapterType); if (sourceObject == null) { return null; } if (adapterType.isInstance(sourceObject)) { return sourceObject; } if (sourceObject instanceof IAdaptable) { IAdaptable adaptable = (IAdaptable) sourceObject; Object result = adaptable.getAdapter(adapterType); if (result != null) { // Sanity-check Assert.isTrue(adapterType.isInstance(result)); return result; } } if (!(sourceObject instanceof PlatformObject)) { Object result = Platform.getAdapterManager().getAdapter(sourceObject, adapterType); if (result != null) { return result; } } return null; } /* * (non-Javadoc) * * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object) */ @Override public Object[] getChildren(Object o) { try { IFileStore[] stores = fFileStore.childStores(EFS.NONE, null); List def = new ArrayList(); for (int i = 0; i < stores.length; i++) { if (!(fExcludeHidden && stores[i].getName().startsWith("."))) { //$NON-NLS-1$ def.add(new DeferredFileStore(stores[i], fExcludeHidden, this)); } } return def.toArray(); } catch (CoreException e) { return new Object[0]; } } /** * Get the filestore backing this object * * @return */ public IFileStore getFileStore() { return fFileStore; } /* * (non-Javadoc) * * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object) */ @Override public ImageDescriptor getImageDescriptor(Object object) { fetchInfo(); if (fImage == null) { boolean isDir = fFileInfo.isDirectory() || (fTargetInfo != null && fTargetInfo.isDirectory()); FileSystemElement element = new FileSystemElement(fFileStore.getName(), null, isDir); IWorkbenchAdapter adapter = getAdapter(element); if (adapter != null) { ImageDescriptor imageDesc = adapter.getImageDescriptor(object); if (fTargetInfo != null) { imageDesc = new OverlayImageDescriptor(imageDesc, RemoteUIImages.DESC_OVR_SYMLINK, OverlayImageDescriptor.BOTTOM_RIGHT); } fImage = imageDesc; } } return fImage; } /* * (non-Javadoc) * * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object) */ @Override public String getLabel(Object o) { return fFileStore.getName(); } /* * (non-Javadoc) * * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object) */ @Override public Object getParent(Object o) { return fParent; } /* * (non-Javadoc) * * @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#getRule(java.lang.Object) */ @Override public ISchedulingRule getRule(Object object) { return null; } /* * (non-Javadoc) * * @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#isContainer() */ @Override public boolean isContainer() { fetchInfo(); return fFileInfo.isDirectory() || (fTargetInfo != null && fTargetInfo.isDirectory()); } } DeferredFileStoreComparer.java000066400000000000000000000032331272114001700376120ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/******************************************************************************* * Copyright (c) 2013 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui; import org.eclipse.jface.viewers.IElementComparer; public class DeferredFileStoreComparer implements IElementComparer { /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IElementComparer#equals(java.lang.Object, java.lang.Object) */ @Override public boolean equals(Object o1, Object o2) { if (o1 == o2) { return true; } if (o1 == null) { return false; // o2 != null if we reach this point } if (o1.equals(o2)) { return true; } // Assume they are DeferredFileStore DeferredFileStore c1 = (o1 instanceof DeferredFileStore) ? (DeferredFileStore) o1 : null; DeferredFileStore c2 = (o2 instanceof DeferredFileStore) ? (DeferredFileStore) o2 : null; if (c1 == null || c2 == null) { return false; } return c1.getFileStore().equals(c2.getFileStore()); } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IElementComparer#hashCode(java.lang.Object) */ @Override public int hashCode(Object element) { if (element instanceof DeferredFileStore) { return ((DeferredFileStore) element).getFileStore().hashCode(); } return element.hashCode(); } } Messages.java000066400000000000000000000013131272114001700343300ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/uipackage org.eclipse.remote.internal.ui; import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.remote.internal.ui.messages"; //$NON-NLS-1$ public static String NewRemoteConnectionTypePage_LaunchTargetType; public static String NewRemoteConnectionTypePage_SelectTargetType; public static String NewRemoteConnectionWizard_0; public static String OpenTerminalHandler_OpenTerminalDesc; public static String OpenTerminalHandler_OpenTerminalTitle; public static String RemoteConnectionPropertyPage_ConnectionName; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); } private Messages() { } } OverlayImageDescriptor.java000066400000000000000000000045511272114001700372130ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/******************************************************************************* * Copyright (c) 2013 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui; import org.eclipse.jface.resource.CompositeImageDescriptor; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.swt.graphics.ImageData; import org.eclipse.swt.graphics.Point; /** * @since 7.0 */ public class OverlayImageDescriptor extends CompositeImageDescriptor { static final int DEFAULT_WIDTH = 16; static final int DEFAULT_HEIGHT = 16; public static final int TOP_LEFT = 0; public static final int TOP_RIGHT = 1; public static final int BOTTOM_LEFT = 2; public static final int BOTTOM_RIGHT = 3; private final ImageDescriptor fBase; private final ImageDescriptor fOverlay; private final int fPosition; private final int fOffset = 3; public OverlayImageDescriptor(ImageDescriptor base, ImageDescriptor overlay, int pos) { fBase = base; fOverlay = overlay; fPosition = pos; } /* * @see org.eclipse.jface.resource.CompositeImageDescriptor#drawCompositeImage(int, * int) */ @Override protected void drawCompositeImage(int width, int height) { ImageData imageData = fBase.getImageData(); if (imageData != null) { drawImage(imageData, 0, 0); } ImageData overlayData = fOverlay.getImageData(); if (overlayData != null) { Point pos = null; switch (fPosition) { case TOP_LEFT: pos = new Point(-overlayData.width / 2, -overlayData.height / 2); break; case TOP_RIGHT: pos = new Point(imageData.width - overlayData.width / 2, 0); break; case BOTTOM_LEFT: pos = new Point(0, imageData.height - overlayData.height / 2); break; case BOTTOM_RIGHT: pos = new Point(imageData.width - overlayData.width / 2, imageData.height - overlayData.height / 2); break; } drawImage(overlayData, pos.x - fOffset, pos.y - fOffset); } } @Override protected Point getSize() { return new Point(DEFAULT_WIDTH, DEFAULT_HEIGHT); } } PendingUpdateAdapter.java000066400000000000000000000050001272114001700366060ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/******************************************************************************* * Copyright (c) 2003, 2009 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.remote.internal.ui.messages.Messages; import org.eclipse.ui.model.IWorkbenchAdapter; /** * The PendingUpdateAdapter is a convenience object that can be used * by a BaseWorkbenchContentProvider that wants to show a pending update. */ public class PendingUpdateAdapter implements IWorkbenchAdapter, IAdaptable { boolean removed = false; /** * Return whether or not this has been removed from the tree. * * @return boolean */ public boolean isRemoved() { return removed; } /** * Set whether or not this has been removed from the tree. * * @param removedValue * boolean */ public void setRemoved(boolean removedValue) { this.removed = removedValue; } /** * Create a new instance of the receiver. */ public PendingUpdateAdapter() { // No initial behavior } /* * (non-Javadoc) * * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ @Override @SuppressWarnings("rawtypes") public Object getAdapter(Class adapter) { if (adapter == IWorkbenchAdapter.class) { return this; } return null; } /* * (non-Javadoc) * * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object) */ @Override public Object[] getChildren(Object o) { return new Object[0]; } /* * (non-Javadoc) * * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object) */ @Override public ImageDescriptor getImageDescriptor(Object object) { return null; } /* * (non-Javadoc) * * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object) */ @Override public String getLabel(Object o) { return Messages.PendingUpdateAdapter_Pending; } /* * (non-Javadoc) * * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object) */ @Override public Object getParent(Object o) { return null; } } RemoteContentProvider.java000077500000000000000000000047641272114001700371020ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/******************************************************************************* * Copyright (c) 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui; import org.eclipse.jface.viewers.Viewer; import org.eclipse.ui.IWorkingSet; import org.eclipse.ui.model.WorkbenchContentProvider; /** * Extension to the generic workbench content provider mechanism * to lazily determine whether an element has children. That is, * children for an element aren't fetched until the user clicks * on the tree expansion box. */ public class RemoteContentProvider extends WorkbenchContentProvider { private IWorkingSet workingSet; private RemoteTreeContentManager manager; /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, * java.lang.Object) */ @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { if (newInput != null) { manager = new RemoteTreeContentManager(this, (RemoteTreeViewer) viewer, null); } else { manager = null; } super.inputChanged(viewer, oldInput, newInput); } /* * (non-Javadoc) * * @see org.eclipse.ui.model.BaseWorkbenchContentProvider#hasChildren(java.lang.Object) */ @Override public boolean hasChildren(Object element) { if (manager != null /* && manager.isDeferredAdapter(element) */) { return manager.mayHaveChildren(element); } return super.hasChildren(element); } /** * Sets the workingSet. * * @param workingSet * The workingSet to set */ public void setWorkingSet(IWorkingSet workingSet) { this.workingSet = workingSet; } /** * Returns the workingSet. * * @return IWorkingSet */ public IWorkingSet getWorkingSet() { return workingSet; } /* * (non-Javadoc) * * @see org.eclipse.ui.model.WorkbenchContentProvider#getChildren(java.lang.Object) */ @Override public Object[] getChildren(Object element) { if (manager != null) { Object[] children = manager.getChildren(element); if (children != null) { return children; } } return super.getChildren(element); } } RemoteResourceComparator.java000077500000000000000000000027361272114001700375710ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/******************************************************************************* * Copyright (c) 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui; import org.eclipse.core.filesystem.IFileInfo; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerComparator; public class RemoteResourceComparator extends ViewerComparator { private boolean ascending = true; public RemoteResourceComparator() { super(); } public void setAscending(boolean ascending) { this.ascending = ascending; } public boolean isAscending() { return ascending; } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ @Override public int compare(Viewer viewer, Object o1, Object o2) { if (o1 instanceof IFileInfo && o2 instanceof IFileInfo) { int compareResult = ((IFileInfo) o1).getName().compareToIgnoreCase(((IFileInfo) o2).getName()); return ascending ? compareResult : -compareResult; } return super.compare(viewer, o1, o2); } } RemoteTreeContentManager.java000066400000000000000000000275771272114001700375060ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/******************************************************************************* * 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui; import java.util.ArrayList; import java.util.List; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.swt.widgets.Control; import org.eclipse.ui.IWorkbenchPartSite; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.progress.IDeferredWorkbenchAdapter; import org.eclipse.ui.progress.IElementCollector; import org.eclipse.ui.progress.IWorkbenchSiteProgressService; import org.eclipse.ui.progress.WorkbenchJob; /** * A remote content manager that merges content into a tree rather then replacing its children with a * "pending" node, and then the real children when they are available. This avoids collapsing the viewer when * a refresh is performed. This implementation is currently tied to the RemoteTreeViewer. * * @since 3.1 */ public class RemoteTreeContentManager { private final RemoteTreeViewer fViewer; private IWorkbenchSiteProgressService progressService; /** * Job to fetch children */ private final Job fFetchJob = new FetchJob(); /** * Queue of parents to fetch children for, and associated element collectors and deferred adapters. */ private final List fElementQueue = new ArrayList(); private final List fCollectors = new ArrayList(); private final List fAdapaters = new ArrayList(); /** * Fetching children is done in a single background job. This makes fetching single threaded/serial per * view. */ private class FetchJob extends Job { public FetchJob() { super("FetchJob"); //$NON-NLS-1$ setSystem(true); } /* * (non-Javadoc) * * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) */ @Override protected IStatus run(IProgressMonitor monitor) { while (!fElementQueue.isEmpty() && !monitor.isCanceled()) { Object element = null; IElementCollector collector = null; IDeferredWorkbenchAdapter adapter = null; synchronized (fElementQueue) { // could have been cancelled after entering the while loop if (fElementQueue.isEmpty()) { return Status.CANCEL_STATUS; } element = fElementQueue.remove(0); collector = fCollectors.remove(0); adapter = fAdapaters.remove(0); } adapter.fetchDeferredChildren(element, collector, monitor); } if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } return Status.OK_STATUS; } } /** * Element collector */ private class Collector implements IElementCollector { // number of children added to the tree int offset = 0; Object fParent; public Collector(Object parent) { fParent = parent; } /* * (non-Javadoc) * * @see org.eclipse.jface.progress.IElementCollector#add(java.lang.Object, * org.eclipse.core.runtime.IProgressMonitor) */ @Override public void add(Object element, IProgressMonitor monitor) { add(new Object[] { element }, monitor); } /* * (non-Javadoc) * * @see org.eclipse.jface.progress.IElementCollector#add(java.lang.Object[], * org.eclipse.core.runtime.IProgressMonitor) */ @Override public void add(Object[] elements, IProgressMonitor monitor) { Object[] filtered = fViewer.filter(elements); if (fViewer.getComparator() != null) { fViewer.getComparator().sort(fViewer, filtered); } if (filtered.length > 0) { replaceChildren(fParent, filtered, offset, monitor); offset = offset + filtered.length; } } /* * (non-Javadoc) * * @see org.eclipse.jface.progress.IElementCollector#done() */ @Override public void done() { prune(fParent, offset); } } /** * Contructs a new content manager. * * @param provider * content provider * @param viewer * viewer * @param site * part site */ public RemoteTreeContentManager(ITreeContentProvider provider, RemoteTreeViewer viewer, IWorkbenchPartSite site) { fViewer = viewer; if (site != null) { Object siteService = site.getAdapter(IWorkbenchSiteProgressService.class); if (siteService != null) { progressService = (IWorkbenchSiteProgressService) siteService; } } } /** * Create the element collector for the receiver. * * @param parent * The parent object being filled in, * @param placeholder * The adapter that will be used to indicate that results are pending, possibly null * @return IElementCollector */ protected IElementCollector createElementCollector(Object parent, PendingUpdateAdapter placeholder) { return new Collector(parent); } /** * Returns the child elements of the given element, or in the case of a deferred element, returns a * placeholder. If a deferred element is used, a job is created to fetch the children in the background. * * @param parent * The parent object. * @return Object[] or null if parent is not an instance of IDeferredWorkbenchAdapter. */ public Object[] getChildren(final Object parent) { IDeferredWorkbenchAdapter element = getAdapter(parent); if (element == null) { return null; } Object[] currentChildren = fViewer.getCurrentChildren(parent); PendingUpdateAdapter placeholder = null; if (currentChildren == null || currentChildren.length == 0) { placeholder = new PendingUpdateAdapter(); } startFetchingDeferredChildren(parent, element, placeholder); if (placeholder == null) { return currentChildren; } return new Object[] { placeholder }; } /** * Create a UIJob to replace the children of the parent in the tree viewer. * * @param parent * the parent for which children are to be replaced * @param children * the replacement children * @param offset * the offset at which to start replacing children * @param monitor * progress monitor */ protected void replaceChildren(final Object parent, final Object[] children, final int offset, IProgressMonitor monitor) { if (monitor.isCanceled()) { return; } WorkbenchJob updateJob = new WorkbenchJob("IncrementalDeferredTreeContentManager") { //$NON-NLS-1$ /* * (non-Javadoc) * * @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor) */ @Override public IStatus runInUIThread(IProgressMonitor updateMonitor) { // Cancel the job if the tree viewer got closed if (fViewer.getControl().isDisposed()) { return Status.CANCEL_STATUS; } fViewer.replace(parent, children, offset); return Status.OK_STATUS; } }; updateJob.setSystem(true); updateJob.setPriority(Job.INTERACTIVE); updateJob.schedule(); } /** * Create a UIJob to prune the children of the parent in the tree viewer, starting at the given offset. * * @param parent * the parent for which children should be pruned * @param offset * the offset at which children should be pruned. All children at and after this index will be * removed from the tree. */ protected void prune(final Object parent, final int offset) { WorkbenchJob updateJob = new WorkbenchJob("DeferredTree") { //$NON-NLS-1$ /* * (non-Javadoc) * * @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor) */ @Override public IStatus runInUIThread(IProgressMonitor updateMonitor) { // Cancel the job if the tree viewer got closed if (fViewer.getControl().isDisposed()) { return Status.CANCEL_STATUS; } fViewer.prune(parent, offset); return Status.OK_STATUS; } }; updateJob.setSystem(true); updateJob.setPriority(Job.INTERACTIVE); updateJob.schedule(); } /** * Run a job to clear the placeholder. This is used when the update for the tree is complete so that the * user is aware that no more updates are pending. * * @param placeholder */ protected void runClearPlaceholderJob(final PendingUpdateAdapter placeholder) { if (placeholder == null || placeholder.isRemoved() || !PlatformUI.isWorkbenchRunning()) { return; } // Clear the placeholder if it is still there WorkbenchJob clearJob = new WorkbenchJob("DeferredTreeContentManager_ClearJob") { //$NON-NLS-1$ /* * (non-Javadoc) * * @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor) */ @Override public IStatus runInUIThread(IProgressMonitor monitor) { if (!placeholder.isRemoved()) { Control control = fViewer.getControl(); if (control.isDisposed()) { return Status.CANCEL_STATUS; } fViewer.remove(placeholder); placeholder.setRemoved(true); } return Status.OK_STATUS; } }; clearJob.setSystem(true); clearJob.schedule(); } /* * (non-Javadoc) * * @see org.eclipse.ui.progress.DeferredTreeContentManager#getFetchJobName(java.lang.Object, * org.eclipse.ui.progress.IDeferredWorkbenchAdapter) */ protected String getFetchJobName(Object parent, IDeferredWorkbenchAdapter adapter) { return "RemoteTreeContentManager"; //$NON-NLS-1$ } /** * Return the IDeferredWorkbenchAdapter for element or the element if it is an instance of * IDeferredWorkbenchAdapter. If it does not exist return null. * * @param element * @return IDeferredWorkbenchAdapter or null */ protected IDeferredWorkbenchAdapter getAdapter(Object element) { if (element instanceof IDeferredWorkbenchAdapter) { return (IDeferredWorkbenchAdapter) element; } if (!(element instanceof IAdaptable)) { return null; } Object adapter = ((IAdaptable) element).getAdapter(IDeferredWorkbenchAdapter.class); if (adapter == null) { return null; } return (IDeferredWorkbenchAdapter) adapter; } protected void startFetchingDeferredChildren(final Object parent, final IDeferredWorkbenchAdapter adapter, PendingUpdateAdapter placeholder) { final IElementCollector collector = createElementCollector(parent, placeholder); synchronized (fElementQueue) { if (!fElementQueue.contains(parent)) { fElementQueue.add(parent); fCollectors.add(collector); fAdapaters.add(adapter); } } if (progressService == null) { fFetchJob.schedule(); } else { progressService.schedule(fFetchJob); } } /** * Provides an optimized lookup for determining if an element has children. This is required because * elements that are populated lazilly can't answer getChildren just to determine the * potential for children. Throw an AssertionFailedException if element is null. * * @param element * The Object being tested. This should not be null. * @return boolean true if there are potentially children. * @throws RuntimeException * if the element is null. */ public boolean mayHaveChildren(Object element) { // Assert.isNotNull(element, ProgressMessages.DeferredTreeContentManager_NotDeferred); IDeferredWorkbenchAdapter adapter = getAdapter(element); return adapter != null && adapter.isContainer(); } /** * Cancels any content this provider is currently fetching. */ public void cancel() { synchronized (fElementQueue) { fFetchJob.cancel(); fElementQueue.clear(); fAdapaters.clear(); fCollectors.clear(); } } } RemoteTreeViewer.java000066400000000000000000000263401272114001700360250ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/******************************************************************************* * 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Item; import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.TreeItem; import org.eclipse.swt.widgets.Widget; import org.eclipse.ui.model.IWorkbenchAdapter; import org.eclipse.ui.progress.UIJob; public class RemoteTreeViewer extends TreeViewer { private ExpansionJob fExpansionJob = null; private SelectionJob fSelectionJob = null; private class ExpansionJob extends UIJob { private Object element; private final List parents = new ArrayList(); // top down /** * Constructs a job to expand the given element. * */ public ExpansionJob() { super("Expansion"); //$NON-NLS-1$ setPriority(Job.INTERACTIVE); setSystem(true); } /* * (non-Javadoc) * * @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor) */ @Override public IStatus runInUIThread(IProgressMonitor monitor) { if (getControl().isDisposed() || element == null) { return Status.OK_STATUS; } synchronized (RemoteTreeViewer.this) { boolean allParentsExpanded = true; Iterator iterator = parents.iterator(); while (iterator.hasNext() && !monitor.isCanceled()) { Object parent = iterator.next(); Widget item = findItem(parent); if (item != null) { expandToLevel(parent, 1); } else { allParentsExpanded = false; break; } } if (allParentsExpanded) { Widget item = findItem(element); if (item != null) { if (isExpandable(element)) { expandToLevel(element, 1); } element = null; parents.clear(); return Status.OK_STATUS; } } return Status.OK_STATUS; } } public void validate(Object object) { if (element != null) { if (element.equals(object) || parents.contains(object)) { cancel(); element = null; } } } public void setDeferredExpansion(Object toExpand) { element = toExpand; parents.clear(); addAllParents(parents, element); } } private class SelectionJob extends UIJob { private IStructuredSelection selection; private Object first; private final List parents = new ArrayList(); // top down /** * Constucts a job to select the given element. * */ public SelectionJob() { super("Selection"); //$NON-NLS-1$ setPriority(Job.INTERACTIVE); setSystem(true); } /* * (non-Javadoc) * * @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor) */ @Override public IStatus runInUIThread(IProgressMonitor monitor) { if (getControl().isDisposed() || selection == null) { return Status.OK_STATUS; } synchronized (RemoteTreeViewer.this) { boolean allParentsExpanded = true; Iterator iterator = parents.iterator(); while (iterator.hasNext() && !monitor.isCanceled()) { Object parent = iterator.next(); Widget item = findItem(parent); if (item != null) { expandToLevel(parent, 1); } else { allParentsExpanded = false; break; } } if (allParentsExpanded) { if (findItem(first) != null) { setSelection(selection, true); selection = null; first = null; parents.clear(); return Status.OK_STATUS; } } return Status.OK_STATUS; } } public void setDeferredSelection(IStructuredSelection sel) { selection = sel; first = selection.getFirstElement(); parents.clear(); addAllParents(parents, first); } public void validate(Object object) { if (first != null) { if (first.equals(object) || parents.contains(object)) { cancel(); selection = null; } } } } /** * Constructs a remote tree viewer parented by the given composite. * * @param parent * parent composite */ public RemoteTreeViewer(Composite parent) { super(parent); addDisposeListener(); fExpansionJob = new ExpansionJob(); fSelectionJob = new SelectionJob(); } /** * Constructs a remote tree viewer parented by the given composite * with the given style. * * @param parent * parent composite * @param style * style bits */ public RemoteTreeViewer(Composite parent, int style) { super(parent, style); addDisposeListener(); fExpansionJob = new ExpansionJob(); fSelectionJob = new SelectionJob(); } /** * Constructs a remote tree viewer with the given tree. * * @param tree * tree widget */ public RemoteTreeViewer(Tree tree) { super(tree); addDisposeListener(); fExpansionJob = new ExpansionJob(); fSelectionJob = new SelectionJob(); } private void addDisposeListener() { getControl().addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent e) { cancelJobs(); } }); } protected void runDeferredUpdates() { if (fExpansionJob != null) { fExpansionJob.schedule(); } if (fSelectionJob != null) { fSelectionJob.schedule(); } } /** * The given element is being removed from the tree. Cancel * any deferred updates for the element. * * @param element */ protected void validateDeferredUpdates(Object element) { if (element != null) { if (fExpansionJob != null) { fExpansionJob.validate(element); } if (fSelectionJob != null) { fSelectionJob.validate(element); } } } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.AbstractTreeViewer#add(java.lang.Object, java.lang.Object) */ @Override public synchronized void add(Object parentElement, Object childElement) { super.add(parentElement, childElement); runDeferredUpdates(); } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.AbstractTreeViewer#add(java.lang.Object, java.lang.Object[]) */ @Override public synchronized void add(Object parentElement, Object[] childElements) { super.add(parentElement, childElements); runDeferredUpdates(); } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.AbstractTreeViewer#remove(java.lang.Object) */ @Override public synchronized void remove(Object element) { validateDeferredUpdates(element); super.remove(element); } /* * (non-Javadoc) * * @see org.eclipse.jface.viewers.AbstractTreeViewer#remove(java.lang.Object[]) */ @Override public synchronized void remove(Object[] elements) { for (Object element : elements) { validateDeferredUpdates(element); } super.remove(elements); } /** * Cancels any deferred updates currently scheduled/running. */ public void cancelJobs() { cancel(fSelectionJob); cancel(fExpansionJob); } public synchronized void deferExpansion(Object element) { TreeItem treeItem = (TreeItem) findItem(element); if (treeItem == null) { fExpansionJob.setDeferredExpansion(element); fExpansionJob.schedule(); } else { if (!getExpanded(treeItem)) { fExpansionJob.setDeferredExpansion(element); fExpansionJob.schedule(); } } } public synchronized void deferSelection(IStructuredSelection selection) { if (fSelectionJob == null) { fSelectionJob = new SelectionJob(); } fSelectionJob.setDeferredSelection(selection); fSelectionJob.schedule(); } public IStructuredSelection getDeferredSelection() { if (fSelectionJob != null) { return fSelectionJob.selection; } return null; } private void cancel(Job job) { if (job != null) { job.cancel(); } } private void addAllParents(List list, Object element) { if (element instanceof IAdaptable) { IAdaptable adaptable = (IAdaptable) element; IWorkbenchAdapter adapter = (IWorkbenchAdapter) adaptable.getAdapter(IWorkbenchAdapter.class); if (adapter != null) { Object parent = adapter.getParent(element); if (parent != null) { list.add(0, parent); addAllParents(list, parent); } } } } @Override public Object[] filter(Object[] elements) { return super.filter(elements); } public Object[] getCurrentChildren(Object parent) { Widget widget = findItem(parent); if (widget != null) { Item[] items = getChildren(widget); Object[] children = new Object[items.length]; for (int i = 0; i < children.length; i++) { Object data = items[i].getData(); if (data == null) { return null; } children[i] = data; } return children; } return null; } public synchronized void prune(final Object parent, final int offset) { Widget widget = findItem(parent); if (widget != null) { final Item[] currentChildren = getChildren(widget); if (offset < currentChildren.length) { preservingSelection(new Runnable() { @Override public void run() { for (int i = offset; i < currentChildren.length; i++) { if (currentChildren[i].getData() != null) { disassociate(currentChildren[i]); } currentChildren[i].dispose(); } } }); } } } public synchronized void replace(final Object parent, final Object[] children, final int offset) { preservingSelection(new Runnable() { @Override public void run() { Widget widget = findItem(parent); if (widget == null) { add(parent, children); } else { Item[] currentChildren = getChildren(widget); int pos = offset; if (pos >= currentChildren.length) { // append add(parent, children); } else { // replace for (int i = 0; i < children.length; i++) { Object child = children[i]; if (pos < currentChildren.length) { // replace Item item = currentChildren[pos]; Object data = item.getData(); if (!child.equals(data)) { // no need to cancel pending updates here, the child may have shifted up/down internalRefresh(item, child, true, true); } else { // If it's the same child, the label/content may still have changed doUpdateItem(item, child); updatePlus(item, child); } } else { // add int numLeft = children.length - i; if (numLeft > 1) { Object[] others = new Object[numLeft]; System.arraycopy(children, i, others, 0, numLeft); add(parent, others); } else { add(parent, child); } break; } pos++; } } } runDeferredUpdates(); } }); } } RemoteUIImages.java000066400000000000000000000140411272114001700354020ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/******************************************************************************* * Copyright (c) 2010,2013 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui; import java.net.URL; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.jface.action.IAction; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageRegistry; import org.eclipse.swt.graphics.Image; import org.osgi.framework.Bundle; public class RemoteUIImages { public static final IPath ICONS_PATH = new Path("icons"); //$NON-NLS-1$ private static final String NAME_PREFIX = RemoteUIPlugin.PLUGIN_ID + "."; //$NON-NLS-1$ private static ImageRegistry fgImageRegistry = new ImageRegistry(); private static final String T_ELCL = "elcl16"; //$NON-NLS-1$ private static final String T_DLCL = "dlcl16"; //$NON-NLS-1$ private static final String T_OVR = "ovr16"; //$NON-NLS-1$ /* * Keys for images available from the plug-in image registry. */ public static final String IMG_ELCL_UP_NAV = NAME_PREFIX + T_ELCL + ".up_nav.gif"; //$NON-NLS-1$ public static final String IMG_DLCL_UP_NAV = NAME_PREFIX + T_DLCL + ".up_nav.gif"; //$NON-NLS-1$ public static final String IMG_OVR_SYMLINK = NAME_PREFIX + T_OVR + ".symlink_ovr.gif"; //$NON-NLS-1$ public static final String IMG_ELCL_NEW_FOLDER = NAME_PREFIX + T_ELCL + ".new_folder.gif"; //$NON-NLS-1$ public static final String IMG_DLCL_NEW_FOLDER = NAME_PREFIX + T_DLCL + ".new_folder.gif"; //$NON-NLS-1$ public static final String IMG_DEFAULT_TYPE = NAME_PREFIX + "defaultType"; //$NON-NLS-1$ /* * Set of predefined Image Descriptors. */ public static final ImageDescriptor DESC_ELCL_UP_NAV = createManaged(T_ELCL, "up_nav.gif", IMG_ELCL_UP_NAV); //$NON-NLS-1$ public static final ImageDescriptor DESC_DLCL_UP_NAV = createManaged(T_DLCL, "up_nav.gif", IMG_ELCL_UP_NAV); //$NON-NLS-1$ public static final ImageDescriptor DESC_OVR_SYMLINK = createManaged(T_OVR, "symlink_ovr.gif", IMG_OVR_SYMLINK); //$NON-NLS-1$ public static final ImageDescriptor DESC_ELCL_NEW_FOLDER = createManaged(T_ELCL, "new_folder.gif", IMG_ELCL_NEW_FOLDER); //$NON-NLS-1$ public static final ImageDescriptor DESC_DLCL_NEW_FOLDER = createManaged(T_DLCL, "new_folder.gif", IMG_DLCL_NEW_FOLDER); //$NON-NLS-1$ public static final ImageDescriptor DESC_DEFAULT_TYPE = createManaged(ICONS_PATH.append("console.png"), IMG_DEFAULT_TYPE); //$NON-NLS-1$ /** * Returns the image managed under the given key in this registry. * * @param key * the image's key * @return the image managed under the given key */ public static Image get(String key) { return fgImageRegistry.get(key); } /** * Returns the image descriptor for the given key in this registry. Might be called in a non-UI thread. * * @param key * the image's key * @return the image descriptor for the given key */ public static ImageDescriptor getDescriptor(String key) { return fgImageRegistry.getDescriptor(key); } /** * Sets the three image descriptors for enabled, disabled, and hovered to an action. The actions * are retrieved from the *lcl16 folders. * * @param action * the action * @param iconName * the icon name */ public static void setLocalImageDescriptors(IAction action, String iconName) { setImageDescriptors(action, "lcl16", iconName); //$NON-NLS-1$ } // ---- Helper methods to access icons on the file system -------------------------------------- private static void setImageDescriptors(IAction action, String type, String relPath) { ImageDescriptor id = create("d" + type, relPath, false); //$NON-NLS-1$ if (id != null) { action.setDisabledImageDescriptor(id); } /* * id= create("c" + type, relPath, false); //$NON-NLS-1$ * if (id != null) * action.setHoverImageDescriptor(id); */ ImageDescriptor descriptor = create("e" + type, relPath, true); //$NON-NLS-1$ action.setHoverImageDescriptor(descriptor); action.setImageDescriptor(descriptor); } private static ImageDescriptor createManaged(IPath path, String key) { ImageDescriptor desc = createImageDescriptor(RemoteUIPlugin.getDefault().getBundle(), path, true); fgImageRegistry.put(key, desc); return desc; } private static ImageDescriptor createManaged(String prefix, String name, String key) { ImageDescriptor image = create(prefix, name, true); fgImageRegistry.put(key, image); return image; } /* * Creates an image descriptor for the given prefix and name in the JDT UI bundle. The path can * contain variables like $NL$. * If no image could be found, useMissingImageDescriptor decides if either * the 'missing image descriptor' is returned or null. * or null. */ private static ImageDescriptor create(String prefix, String name, boolean useMissingImageDescriptor) { IPath path = ICONS_PATH.append(prefix).append(name); return createImageDescriptor(RemoteUIPlugin.getDefault().getBundle(), path, useMissingImageDescriptor); } /* * Creates an image descriptor for the given path in a bundle. The path can contain variables * like $NL$. * If no image could be found, useMissingImageDescriptor decides if either * the 'missing image descriptor' is returned or null. * Added for 3.1.1. */ public static ImageDescriptor createImageDescriptor(Bundle bundle, IPath path, boolean useMissingImageDescriptor) { URL url = FileLocator.find(bundle, path, null); if (url != null) { return ImageDescriptor.createFromURL(url); } if (useMissingImageDescriptor) { return ImageDescriptor.getMissingImageDescriptor(); } return null; } } RemoteUIPlugin.java000066400000000000000000000052021272114001700354320ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/uipackage org.eclipse.remote.internal.ui; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.remote.internal.ui.messages.Messages; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; /** * The activator class controls the plug-in life cycle */ public class RemoteUIPlugin extends AbstractUIPlugin { // The plug-in ID public static final String PLUGIN_ID = "org.eclipse.remote.ui"; //$NON-NLS-1$ // The shared instance private static RemoteUIPlugin plugin; /** * Returns the shared instance * * @return the shared instance */ public static RemoteUIPlugin getDefault() { return plugin; } /** * Get unique identifier for this plugin * * @since 7.0 */ public static String getUniqueIdentifier() { if (getDefault() == null) { return PLUGIN_ID; } return getDefault().getBundle().getSymbolicName(); } /** * Generate a log message given an IStatus object * * @param status * IStatus object * @since 5.0 */ public static void log(IStatus status) { getDefault().getLog().log(status); } /** * Generate a log message * * @param msg * message to log * @since 5.0 */ public static void log(String msg) { log(new Status(IStatus.ERROR, getDefault().getBundle().getSymbolicName(), IStatus.ERROR, msg, null)); } /** * Generate a log message for an exception * * @param e * exception used to generate message * @since 5.0 */ public static void log(Throwable e) { log(new Status(IStatus.ERROR, getDefault().getBundle().getSymbolicName(), IStatus.ERROR, Messages.PTPRemoteUIPlugin_3, e)); } /** * Return the OSGi service with the given service interface. * * @param service service interface * @return the specified service or null if it's not registered */ public static T getService(Class service) { BundleContext context = plugin.getBundle().getBundleContext(); ServiceReference ref = context.getServiceReference(service); return ref != null ? context.getService(ref) : null; } /** * The constructor */ public RemoteUIPlugin() { } /* * (non-Javadoc) * * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext ) */ @Override public void start(BundleContext context) throws Exception { super.start(context); plugin = this; } /* * (non-Javadoc) * * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext ) */ @Override public void stop(BundleContext context) throws Exception { plugin = null; super.stop(context); } } ServicePropertyTester.java000066400000000000000000000040341272114001700371200ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/uipackage org.eclipse.remote.internal.ui; import org.eclipse.core.expressions.PropertyTester; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionControlService; import org.eclipse.remote.core.IRemoteConnectionType; public class ServicePropertyTester extends PropertyTester { @Override @SuppressWarnings("unchecked") public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { if (receiver instanceof IRemoteConnection) { IRemoteConnection connection = (IRemoteConnection) receiver; if (property.equals("hasConnectionTypeService")) { //$NON-NLS-1$ if (args.length > 0 && args[0] instanceof String) { String serviceName = (String) args[0]; try { Class service = Class.forName(serviceName); return connection.getConnectionType().hasService((Class) service); } catch (ClassNotFoundException e) { return false; } } } else if (property.equals("hasConnectionService")) { //$NON-NLS-1$ if (args.length > 0 && args[0] instanceof String) { String serviceName = (String) args[0]; try { Class service = Class.forName(serviceName); return connection.hasService((Class) service); } catch (ClassNotFoundException e) { return false; } } } else if (property.equals("canDelete")) { //$NON-NLS-1$ return connection.getConnectionType().canRemove(); } else if (property.equals("canOpen")) { //$NON-NLS-1$ IRemoteConnectionControlService controlService = connection.getService(IRemoteConnectionControlService.class); if (controlService != null) { return !connection.isOpen(); } else { return false; } } else if (property.equals("canClose")) { //$NON-NLS-1$ IRemoteConnectionControlService controlService = connection.getService(IRemoteConnectionControlService.class); if (controlService != null) { return connection.isOpen(); } else { return false; } } } return false; } } messages.properties000066400000000000000000000005601272114001700356460ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/uiNewRemoteConnectionTypePage_LaunchTargetType=Connection Type NewRemoteConnectionTypePage_SelectTargetType=Select type of connection to create. NewRemoteConnectionWizard_0=Connection Type OpenTerminalHandler_OpenTerminalDesc=A real terminal would open now OpenTerminalHandler_OpenTerminalTitle=Open Terminal RemoteConnectionPropertyPage_ConnectionName=Connection Name: org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/messages/000077500000000000000000000000001272114001700336065ustar00rootroot00000000000000Messages.java000066400000000000000000000112111272114001700361350ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/messages/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui.messages; import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.remote.internal.ui.messages.messages"; //$NON-NLS-1$ public static String AbstractRemoteUIConnectionManager_Connection_Error; public static String AbstractRemoteUIConnectionManager_Could_not_open_connection; public static String ConnectionsPreferencePage_Add; public static String ConnectionsPreferencePage_closed; public static String ConnectionsPreferencePage_Close; public static String ConnectionsPreferencePage_Confirm_Actions; public static String ConnectionsPreferencePage_Connection_Name; public static String ConnectionsPreferencePage_Edit; public static String ConnectionsPreferencePage_Host; public static String ConnectionsPreferencePage_open; public static String ConnectionsPreferencePage_Open; public static String ConnectionsPreferencePage_Remote_Services; public static String ConnectionsPreferencePage_Remove; public static String ConnectionsPreferencePage_Status; public static String ConnectionsPreferencePage_There_are_unsaved_changes; public static String ConnectionsPreferencePage_This_connection_contains_unsaved_changes; public static String ConnectionsPreferencePage_User; public static String LocalUIConnectionManager_0; public static String LocalUIConnectionManager_1; public static String LocalUIConnectionManager_2; public static String LocalUIConnectionManager_3; public static String PendingUpdateAdapter_Pending; public static String PTPRemoteUIPlugin_3; public static String PTPRemoteUIPlugin_4; public static String RemoteConnectionWidget_Connection_Type; public static String RemoteConnectionWidget_Connection_Name; public static String RemoteConnectionWidget_Local; public static String RemoteConnectionWidget_New; public static String RemoteConnectionWidget_Remote; public static String RemoteConnectionWidget_selectConnection; public static String RemoteConnectionWidget_selectConnectionType; public static String RemoteDevelopmentPreferencePage_Default_connection_type; public static String RemoteDirectoryWidget_0; public static String RemoteDirectoryWidget_1; public static String RemoteDirectoryWidget_2; public static String RemoteDirectoryWidget_3; public static String RemoteFileWidget_Browse; public static String RemoteFileWidget_File; public static String RemoteFileWidget_Restore_Default; public static String RemoteFileWidget_Select_File; public static String RemoteResourceBrowser_resourceTitle; public static String RemoteResourceBrowser_fileTitle; public static String RemoteResourceBrowser_directoryTitle; public static String RemoteResourceBrowser_resourceLabel; public static String RemoteResourceBrowser_fileLabel; public static String RemoteResourceBrowser_directoryLabel; public static String RemoteResourceBrowser_connectonLabel; public static String RemoteResourceBrowser_newConnection; public static String RemoteResourceBrowser_NewFolder; public static String RemoteResourceBrowser_Show_hidden_files; public static String RemoteResourceBrowser_UpOneLevel; public static String RemoteResourceBrowserWidget_0; public static String RemoteResourceBrowserWidget_1; public static String RemoteResourceBrowserWidget_2; public static String RemoteResourceBrowserWidget_3; public static String RemoteResourceBrowserWidget_4; public static String RemoteResourceBrowserWidget_New_Folder; public static String RemoteResourceBrowserWidget_Unable_to_create_new_folder; public static String RemoteUIServices_Configuring_remote_services; public static String RemoteUIServicesProxy_1; public static String RemoteUIServicesProxy_2; public static String CloseConnectionHandler_0; public static String CloseConnectionHandler_1; public static String DeleteRemoteConnectionHandler_ConfirmDeleteMessage; public static String DeleteRemoteConnectionHandler_DeleteConnectionTitle; public static String OpenConnectionHandler_0; public static String OpenConnectionHandler_1; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); } private Messages() { } } messages.properties000066400000000000000000000100451272114001700374540ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/messages############################################################################### # 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 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ############################################################################### AbstractRemoteUIConnectionManager_Could_not_open_connection=Could not open connection AbstractRemoteUIConnectionManager_Connection_Error=Connection Error ConnectionsPreferencePage_Add=Add ConnectionsPreferencePage_Close=Close ConnectionsPreferencePage_closed=closed ConnectionsPreferencePage_Confirm_Actions=Confirm Actions ConnectionsPreferencePage_Connection_Name=Connection Name ConnectionsPreferencePage_Edit=Edit ConnectionsPreferencePage_Host=Host ConnectionsPreferencePage_open=open ConnectionsPreferencePage_Open=Open ConnectionsPreferencePage_Remote_Services=Remote Services: ConnectionsPreferencePage_Remove=Remove ConnectionsPreferencePage_Status=Status ConnectionsPreferencePage_There_are_unsaved_changes=There are unsaved changes that must be saved before proceeding. Do you wish to save the changes? ConnectionsPreferencePage_This_connection_contains_unsaved_changes=This connection contains unsaved changes which must be saved before the connection can be opened. Do you wish to save the changes? ConnectionsPreferencePage_User=User LocalUIConnectionManager_0=Connection Error LocalUIConnectionManager_1=Could not open connection LocalUIConnectionManager_2=Can not create local connection LocalUIConnectionManager_3=It is not possible to create a connection for the local connection provider. Select a different remote provider first. PendingUpdateAdapter_Pending=Pending... PTPRemoteUIPlugin_3=Internal Error PTPRemoteUIPlugin_4=Initializing remote services RemoteConnectionWidget_Connection_Type=Connection Type: RemoteConnectionWidget_Connection_Name=Connection name: RemoteConnectionWidget_Local=Local RemoteConnectionWidget_New=New... RemoteConnectionWidget_Remote=Remote RemoteConnectionWidget_selectConnection=Please select a connection RemoteConnectionWidget_selectConnectionType=Please select a connection type RemoteDevelopmentPreferencePage_Default_connection_type=Default connection type RemoteDirectoryWidget_0=Select Directory RemoteDirectoryWidget_1=Directory: RemoteDirectoryWidget_2=Browse... RemoteDirectoryWidget_3=Restore Default RemoteFileWidget_Browse=Browse... RemoteFileWidget_File=File: RemoteFileWidget_Restore_Default=Restore Default RemoteFileWidget_Select_File=Select File RemoteResourceBrowser_resourceTitle=Browse Resource RemoteResourceBrowser_fileTitle=Browse File RemoteResourceBrowser_directoryTitle=Browse Directory RemoteResourceBrowser_resourceLabel=Selected resource: RemoteResourceBrowser_fileLabel=Selected file: RemoteResourceBrowser_directoryLabel=Selected directory: RemoteResourceBrowser_connectonLabel=Connection: RemoteResourceBrowser_newConnection=New... RemoteResourceBrowser_NewFolder=New folder RemoteResourceBrowser_Show_hidden_files=Show hidden files RemoteResourceBrowser_UpOneLevel=Up one level RemoteResourceBrowserWidget_0=validate input RemoteResourceBrowserWidget_1=Enter Folder Name RemoteResourceBrowserWidget_2=Folder name: RemoteResourceBrowserWidget_3=Folder already exists RemoteResourceBrowserWidget_4=Please enter a folder name RemoteResourceBrowserWidget_New_Folder=New Folder RemoteResourceBrowserWidget_Unable_to_create_new_folder=Unable to create new folder RemoteUIServices_Configuring_remote_services=Configuring remote services... RemoteUIServicesProxy_1=Missing {0} attribute RemoteUIServicesProxy_2=Failed to instantiate factory: {0} in type: {1} in plugin: {2} CloseConnectionHandler_0=Closing connections CloseConnectionHandler_1=Error closing connections DeleteRemoteConnectionHandler_ConfirmDeleteMessage=Delete connection DeleteRemoteConnectionHandler_DeleteConnectionTitle=Delete Connection OpenConnectionHandler_0=Opening connections OpenConnectionHandler_1=Error opening connections preferences/000077500000000000000000000000001272114001700342215ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/uiConnectionsPreferencePage.java000066400000000000000000000467731272114001700421630ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/preferences/******************************************************************************* * Copyright (c) 2009, 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * Patrick Tasse - [462499] set viewer comparator * Bernd Hufmann - [462709] Display Host and User per connection *******************************************************************************/ package org.eclipse.remote.internal.ui.preferences; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.preference.PreferencePage; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.ColumnLayoutData; import org.eclipse.jface.viewers.ColumnWeightData; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ILabelProviderListener; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.ITableLabelProvider; import org.eclipse.jface.viewers.TableLayout; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerComparator; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionControlService; import org.eclipse.remote.core.IRemoteConnectionHostService; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.IRemotePreferenceConstants; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.core.preferences.Preferences; import org.eclipse.remote.internal.ui.RemoteUIPlugin; import org.eclipse.remote.internal.ui.messages.Messages; import org.eclipse.remote.ui.IRemoteUIConnectionService; import org.eclipse.remote.ui.IRemoteUIConnectionWizard; import org.eclipse.remote.ui.widgets.RemoteConnectionWidget; import org.eclipse.swt.SWT; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; /** * This class implements a preference page which can be used to view a list of * JSch connections, create new connections or to delete existing connections. * */ public class ConnectionsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { private class ConnectionContentProvider implements IStructuredContentProvider { @Override public void dispose() { // Nothing to do } @Override public Object[] getElements(Object inputElement) { return fWorkingCopies.values().toArray(new IRemoteConnection[fWorkingCopies.size()]); } @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { // Nothing to do } } private class ConnectionLabelProvider implements ITableLabelProvider, ILabelProvider { @Override public void addListener(ILabelProviderListener listener) { // Nothing to do } @Override public void dispose() { // Nothing to do } @Override public Image getColumnImage(Object element, int columnIndex) { return null; } @Override public String getColumnText(Object element, int columnIndex) { IRemoteConnection connection = getOriginalIfClean((IRemoteConnection) element); switch (columnIndex) { case 0: return connection.isOpen() ? Messages.ConnectionsPreferencePage_open : Messages.ConnectionsPreferencePage_closed; case 1: return connection.getName(); case 2: if (connection.hasService(IRemoteConnectionHostService.class)) { return connection.getService(IRemoteConnectionHostService.class).getHostname(); } break; case 3: if (connection.hasService(IRemoteConnectionHostService.class)) { return connection.getService(IRemoteConnectionHostService.class).getUsername(); } break; } return null; } @Override public boolean isLabelProperty(Object element, String property) { return false; } @Override public Image getImage(Object element) { return null; } @Override public String getText(Object element) { /* * This interface is used by the default ViewerComparator. */ IRemoteConnection connection = (IRemoteConnection) element; return connection.getName(); } @Override public void removeListener(ILabelProviderListener listener) { // Nothing to do } } /** * Handle widget selection events for this page * */ private class EventHandler extends SelectionAdapter { /* * (non-Javadoc) * * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent) */ @Override public void widgetSelected(SelectionEvent e) { Object source; source = e.getSource(); if (source == fAddButton) { addConnection(); } else if (source == fEditButton) { editConnection(); } else if (source == fRemoveButton) { removeConnections(); } else if (source == fOpenButton) { toggleConnection(); } else if (source == fCloseButton) { toggleConnection(); } else if (source == fConnectionTable) { selectConnection(); } else if (source == fServicesCombo) { String id = fServiceIDs[fServicesCombo.getSelectionIndex()]; selectServices(id); } } } private final String[] fTableColumnHeaders = { Messages.ConnectionsPreferencePage_Status, Messages.ConnectionsPreferencePage_Connection_Name, Messages.ConnectionsPreferencePage_Host, Messages.ConnectionsPreferencePage_User }; private final ColumnLayoutData[] fTableColumnLayouts = { new ColumnWeightData(15), new ColumnWeightData(35), new ColumnWeightData(30), new ColumnWeightData(20) }; private Combo fServicesCombo; private Button fAddButton; private Button fEditButton; private Button fRemoveButton; private Button fOpenButton; private Button fCloseButton; private Table fConnectionTable; private TableViewer fConnectionViewer; private EventHandler fEventHandler; private String[] fServiceIDs; private boolean fIsDirty; private IRemoteConnection fSelectedConnection; private IRemoteConnectionType fConnectionType; private IRemoteUIConnectionService fUIConnectionManager; private final Map fWorkingCopies = new HashMap(); private static final String DEFAULT_CONNECTION_NAME = "Remote Host"; //$NON-NLS-1$ public ConnectionsPreferencePage() { super(); } public ConnectionsPreferencePage(String title) { super(title); } public ConnectionsPreferencePage(String title, ImageDescriptor image) { super(title, image); } /** * Add a new connection */ private void addConnection() { if (fIsDirty) { MessageDialog dialog = new MessageDialog(getShell(), Messages.ConnectionsPreferencePage_Confirm_Actions, null, Messages.ConnectionsPreferencePage_There_are_unsaved_changes, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0); if (dialog.open() == 1) { return; } performOk(); } if (fUIConnectionManager != null) { IRemoteUIConnectionWizard wizard = fUIConnectionManager.getConnectionWizard(getShell()); if (wizard != null) { wizard.setConnectionName(initialConnectionName()); wizard.setInvalidConnectionNames(invalidConnectionNames()); IRemoteConnectionWorkingCopy conn = wizard.open(); if (conn != null) { fWorkingCopies.put(conn.getName(), conn); if (!fConnectionViewer.getTable().isDisposed()) { fConnectionViewer.refresh(); } fIsDirty = true; } } } } /** * Create the contents for this page * * @param parent * - The parent widget for the client area */ @Override protected Control createContents(Composite parent) { return createWidgets(parent); } /** * Create the widgets for this page * * @param parent * The parent widget for the client area * @return */ private Control createWidgets(Composite parent) { fEventHandler = new EventHandler(); Composite selectComp = new Composite(parent, SWT.NONE); selectComp.setLayout(new GridLayout(2, false)); selectComp.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); Label label = new Label(selectComp, SWT.NONE); label.setText(Messages.ConnectionsPreferencePage_Remote_Services); label.setLayoutData(new GridData()); fServicesCombo = new Combo(selectComp, SWT.READ_ONLY); label.setLayoutData(new GridData()); IRemoteServicesManager manager = RemoteUIPlugin.getService(IRemoteServicesManager.class); List services = manager.getRemoteConnectionTypes(); String[] names = new String[services.size()]; fServiceIDs = new String[services.size()]; { int i = 0; for (IRemoteConnectionType s : services) { names[i] = s.getName(); fServiceIDs[i] = s.getId(); i++; } } fServicesCombo.addSelectionListener(fEventHandler); fServicesCombo.setItems(names); Composite preferencePane = new Composite(parent, SWT.NONE); preferencePane.setLayout(new GridLayout(2, false)); fConnectionTable = new Table(preferencePane, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER); GridData data = new GridData(GridData.FILL_BOTH); data.widthHint = 425; data.heightHint = fConnectionTable.getItemHeight(); data.horizontalSpan = 1; fConnectionTable.setLayoutData(data); fConnectionTable.setFont(parent.getFont()); fConnectionTable.addSelectionListener(fEventHandler); fConnectionTable.addMouseListener(new MouseListener() { @Override public void mouseDoubleClick(MouseEvent e) { if (fSelectedConnection != null) { IRemoteConnection original = getOriginalIfClean(fSelectedConnection); if (original.isOpen()) { editConnection(); } } } @Override public void mouseDown(MouseEvent e) { // Nothing } @Override public void mouseUp(MouseEvent e) { // Nothing } }); TableLayout tableLayout = new TableLayout(); fConnectionTable.setLayout(tableLayout); fConnectionTable.setHeaderVisible(true); fConnectionTable.setLinesVisible(true); for (int i = 0; i < fTableColumnHeaders.length; i++) { tableLayout.addColumnData(fTableColumnLayouts[i]); TableColumn column = new TableColumn(fConnectionTable, SWT.NONE, i); column.setResizable(fTableColumnLayouts[i].resizable); column.setText(fTableColumnHeaders[i]); } fConnectionViewer = new TableViewer(fConnectionTable); fConnectionViewer.setContentProvider(new ConnectionContentProvider()); fConnectionViewer.setLabelProvider(new ConnectionLabelProvider()); fConnectionViewer.setComparator(new ViewerComparator()); fConnectionViewer.setInput(this); Composite buttonPane = new Composite(preferencePane, SWT.NONE); buttonPane.setLayout(new GridLayout(1, false)); buttonPane.setLayoutData(new GridData(GridData.FILL_VERTICAL)); buttonPane.setFont(preferencePane.getFont()); fAddButton = new Button(buttonPane, SWT.PUSH); setButtonLayoutData(fAddButton); fAddButton.setText(Messages.ConnectionsPreferencePage_Add); fAddButton.addSelectionListener(fEventHandler); fEditButton = new Button(buttonPane, SWT.PUSH); setButtonLayoutData(fEditButton); fEditButton.setText(Messages.ConnectionsPreferencePage_Edit); fEditButton.addSelectionListener(fEventHandler); fEditButton.setEnabled(false); fRemoveButton = new Button(buttonPane, SWT.PUSH); setButtonLayoutData(fRemoveButton); fRemoveButton.setText(Messages.ConnectionsPreferencePage_Remove); fRemoveButton.addSelectionListener(fEventHandler); fRemoveButton.setEnabled(false); fOpenButton = new Button(buttonPane, SWT.PUSH); setButtonLayoutData(fOpenButton); fOpenButton.setText(Messages.ConnectionsPreferencePage_Open); fOpenButton.addSelectionListener(fEventHandler); fOpenButton.setEnabled(false); fCloseButton = new Button(buttonPane, SWT.PUSH); setButtonLayoutData(fCloseButton); fCloseButton.setText(Messages.ConnectionsPreferencePage_Close); fCloseButton.addSelectionListener(fEventHandler); fCloseButton.setEnabled(false); if (fServiceIDs.length > 0) { String id = Preferences.getString(IRemotePreferenceConstants.PREF_CONNECTION_TYPE_ID); if ("".equals(id)) { //$NON-NLS-1$ id = fServiceIDs[0]; } for (int i = 0; i < fServiceIDs.length; i++) { if (id.equals(fServiceIDs[i])) { fServicesCombo.select(i); } } selectServices(id); } return preferencePane; } /** * Edit an existing service configuration */ private void editConnection() { if (fSelectedConnection != null) { IRemoteConnectionWorkingCopy copy; if (fSelectedConnection instanceof IRemoteConnectionWorkingCopy) { copy = (IRemoteConnectionWorkingCopy) fSelectedConnection; } else { copy = fSelectedConnection.getWorkingCopy(); } IRemoteUIConnectionWizard wizard = fUIConnectionManager.getConnectionWizard(getShell()); if (wizard != null) { wizard.setConnection(copy); wizard.setInvalidConnectionNames(invalidConnectionNames()); IRemoteConnectionWorkingCopy conn = wizard.open(); if (conn != null && conn.isDirty()) { fWorkingCopies.put(copy.getName(), copy); fConnectionViewer.refresh(); fIsDirty = true; } } } } @Override public void init(IWorkbench workbench) { // Do nothing } private String initialConnectionName() { String name = RemoteConnectionWidget.DEFAULT_CONNECTION_NAME; int count = 2; while (fWorkingCopies.containsKey(name)) { name = DEFAULT_CONNECTION_NAME + " " + count++; //$NON-NLS-1$ } return name; } private void initWorkingConnections() { fWorkingCopies.clear(); for (IRemoteConnection conn : fConnectionType.getConnections()) { fWorkingCopies.put(conn.getName(), conn); } } private Set invalidConnectionNames() { return fWorkingCopies.keySet(); } @Override protected void performDefaults() { initWorkingConnections(); fIsDirty = false; fConnectionViewer.refresh(); super.performDefaults(); } /** * Delete service configurations when Ok button is pressed * * @return Status from superclass indicating if Ok processing is to continue */ @Override public boolean performOk() { if (fIsDirty) { updateConnections(); fIsDirty = false; } return super.performOk(); } /** * Remove the selected service configuration from the set of service * configurations */ private void removeConnections() { TableItem[] items = fConnectionTable.getSelection(); if (items.length > 0) { for (TableItem item : items) { fWorkingCopies.remove(((IRemoteConnection) item.getData()).getName()); } fConnectionViewer.refresh(); fIsDirty = true; fConnectionTable.deselectAll(); fSelectedConnection = null; } updateEnablement(); } /** * Record the selected connection and enable the buttons. */ private void selectConnection() { TableItem[] selection = fConnectionTable.getSelection(); if (selection.length > 0) { fSelectedConnection = (IRemoteConnection) selection[0].getData(); } else { fSelectedConnection = null; } updateEnablement(); } private void selectServices(String id) { IRemoteServicesManager manager = RemoteUIPlugin.getService(IRemoteServicesManager.class); fConnectionType = manager.getConnectionType(id); if (fConnectionType != null) { fUIConnectionManager = fConnectionType.getService(IRemoteUIConnectionService.class); initWorkingConnections(); fConnectionViewer.refresh(); fAddButton.setEnabled(fConnectionType.canAdd()); } fIsDirty = false; } /** * Toggle the connection */ private void toggleConnection() { TableItem[] items = fConnectionTable.getSelection(); if (items.length > 0) { IRemoteConnection conn = getOriginalIfClean((IRemoteConnection) items[0].getData()); if (conn.hasService(IRemoteConnectionControlService.class) && conn.isOpen()) { conn.close(); } else { if (conn instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) conn; if (wc.isDirty()) { MessageDialog dialog = new MessageDialog(getShell(), Messages.ConnectionsPreferencePage_Confirm_Actions, null, Messages.ConnectionsPreferencePage_This_connection_contains_unsaved_changes, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0); if (dialog.open() == 1) { return; } try { conn = wc.save(); } catch (RemoteConnectionException e) { RemoteUIPlugin.log(e); } /* * Replace working copy with original so that the correct version will be used in the future */ fWorkingCopies.put(conn.getName(), conn); } } IRemoteUIConnectionService mgr = conn.getConnectionType().getService(IRemoteUIConnectionService.class); if (mgr != null) { mgr.openConnectionWithProgress(getShell(), null, conn); } } fConnectionViewer.refresh(); updateEnablement(); } } /** * Update the connection manager with changes to the connections. */ private void updateConnections() { /* * Remove any deleted connections */ for (IRemoteConnection conn : fConnectionType.getConnections()) { if (!fWorkingCopies.containsKey(conn.getName()) && (!conn.hasService(IRemoteConnectionControlService.class) || !conn.isOpen())) { try { fConnectionType.removeConnection(conn); } catch (RemoteConnectionException e) { // Ignore } } } /* * Save any added/edited connections */ for (IRemoteConnection conn : fWorkingCopies.values()) { if (conn instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) conn; if (wc.isDirty()) { try { wc.save(); } catch (RemoteConnectionException e) { RemoteUIPlugin.log(e); } } } } initWorkingConnections(); } private void updateEnablement() { fEditButton.setEnabled(false); fRemoveButton.setEnabled(false); fOpenButton.setEnabled(false); fCloseButton.setEnabled(false); if (fSelectedConnection != null) { IRemoteConnection conn = getOriginalIfClean(fSelectedConnection); if (conn.hasService(IRemoteConnectionControlService.class)) { if (!conn.isOpen()) { fEditButton.setEnabled(conn.getConnectionType().canEdit()); fRemoveButton.setEnabled(conn.getConnectionType().canRemove()); fOpenButton.setEnabled(true); } else { fCloseButton.setEnabled(true); } } else { fEditButton.setEnabled(conn.getConnectionType().canEdit()); } } } /** * Get the original connection if the working copy is not dirty * * @param conn * @return */ private IRemoteConnection getOriginalIfClean(IRemoteConnection conn) { if (conn instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) conn; if (!wc.isDirty()) { return wc.getOriginal(); } } return conn; } } PreferencesAdapter.java000066400000000000000000000151421272114001700406310ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/preferences/******************************************************************************* * Copyright (c) 2000, 2006 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui.preferences; import org.eclipse.core.runtime.ListenerList; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.remote.internal.core.preferences.Preferences; /** * Adapts {@link org.eclipse.core.runtime.IEclipsePreferences} to {@link org.eclipse.jface.preference.IPreferenceStore} * * @since 3.0 */ public class PreferencesAdapter implements IPreferenceStore { /** * Property change listener. Listens for events of type * {@link org.eclipse.core.runtime.IEclipsePreferences.PreferenceChangeEvent} and fires a * {@link org.eclipse.jface.util.PropertyChangeEvent} on the adapter with arguments from the received event. */ private class PreferenceChangeListener implements IPreferenceChangeListener { /* * @see org.eclipse.core.runtime.Preferences.IPropertyChangeListener# propertyChange * (org.eclipse.core.runtime.Preferences.PropertyChangeEvent) */ public void preferenceChange(IEclipsePreferences.PreferenceChangeEvent event) { firePropertyChangeEvent(event.getKey(), event.getOldValue(), event.getNewValue()); } } /** Listeners on the adapter */ private final ListenerList fListeners = new ListenerList(ListenerList.IDENTITY); /** Listener on the adapted Preferences */ private final PreferenceChangeListener fListener = new PreferenceChangeListener(); /** True iff no events should be forwarded */ private boolean fSilent; /** True if any preferences have changed */ private boolean fNeedsSaving = false; /** * Initialize with the given Preferences. * * @param preferences * The preferences to wrap. * @since 4.0 */ public PreferencesAdapter() { Preferences.addPreferenceChangeListener(fListener); } /** * {@inheritDoc} */ public void addPropertyChangeListener(IPropertyChangeListener listener) { fListeners.add(listener); } /** * {@inheritDoc} */ public void removePropertyChangeListener(IPropertyChangeListener listener) { fListeners.remove(listener); } /** * {@inheritDoc} */ public boolean contains(String name) { return Preferences.contains(name); } /** * {@inheritDoc} */ public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) { fNeedsSaving = true; if (!fSilent) { PropertyChangeEvent event = new PropertyChangeEvent(this, name, oldValue, newValue); Object[] listeners = fListeners.getListeners(); for (Object listener : listeners) { ((IPropertyChangeListener) listener).propertyChange(event); } } } /** * {@inheritDoc} */ public boolean getBoolean(String name) { return Preferences.getBoolean(name); } /** * {@inheritDoc} */ public boolean getDefaultBoolean(String name) { return Preferences.getDefaultBoolean(name, false); } /** * {@inheritDoc} */ public double getDefaultDouble(String name) { return Preferences.getDefaultDouble(name, 0.0); } /** * {@inheritDoc} */ public float getDefaultFloat(String name) { return Preferences.getDefaultFloat(name, 0.0f); } /** * {@inheritDoc} */ public int getDefaultInt(String name) { return Preferences.getDefaultInt(name, 0); } /** * {@inheritDoc} */ public long getDefaultLong(String name) { return Preferences.getDefaultLong(name, 0L); } /** * {@inheritDoc} */ public String getDefaultString(String name) { return Preferences.getDefaultString(name, ""); //$NON-NLS-1$ } /** * {@inheritDoc} */ public double getDouble(String name) { return Preferences.getDouble(name); } /** * {@inheritDoc} */ public float getFloat(String name) { return Preferences.getFloat(name); } /** * {@inheritDoc} */ public int getInt(String name) { return Preferences.getInt(name); } /** * {@inheritDoc} */ public long getLong(String name) { return Preferences.getLong(name); } /** * {@inheritDoc} */ public String getString(String name) { return Preferences.getString(name); } /** * {@inheritDoc} */ public boolean isDefault(String name) { return Preferences.isDefault(name); } /** * {@inheritDoc} */ public boolean needsSaving() { return fNeedsSaving; } /** * {@inheritDoc} */ public void putValue(String name, String value) { try { fSilent = true; Preferences.setString(name, value); } finally { fSilent = false; } } /** * {@inheritDoc} */ public void setDefault(String name, double value) { Preferences.setDefaultDouble(name, value); } /** * {@inheritDoc} */ public void setDefault(String name, float value) { Preferences.setDefaultFloat(name, value); } /** * {@inheritDoc} */ public void setDefault(String name, int value) { Preferences.setDefaultInt(name, value); } /** * {@inheritDoc} */ public void setDefault(String name, long value) { Preferences.setDefaultLong(name, value); } /** * {@inheritDoc} */ public void setDefault(String name, String defaultObject) { Preferences.setDefaultString(name, defaultObject); } /** * {@inheritDoc} */ public void setDefault(String name, boolean value) { Preferences.setDefaultBoolean(name, value); } /** * {@inheritDoc} */ public void setToDefault(String name) { Preferences.setToDefault(name); } /** * {@inheritDoc} */ public void setValue(String name, double value) { Preferences.setDouble(name, value); } /** * {@inheritDoc} */ public void setValue(String name, float value) { Preferences.setFloat(name, value); } /** * {@inheritDoc} */ public void setValue(String name, int value) { Preferences.setInt(name, value); } /** * {@inheritDoc} */ public void setValue(String name, long value) { Preferences.setLong(name, value); } /** * {@inheritDoc} */ public void setValue(String name, String value) { Preferences.setString(name, value); } /** * {@inheritDoc} */ public void setValue(String name, boolean value) { Preferences.setBoolean(name, value); } } RemoteDevelopmentPreferencePage.java000066400000000000000000000044421272114001700433220ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/preferences/******************************************************************************* * Copyright (c) 2012 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui.preferences; import java.util.ArrayList; import java.util.List; import org.eclipse.jface.preference.ComboFieldEditor; import org.eclipse.jface.preference.FieldEditorPreferencePage; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemotePreferenceConstants; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.internal.ui.RemoteUIPlugin; import org.eclipse.remote.internal.ui.messages.Messages; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; /** * @since 4.1 * */ public class RemoteDevelopmentPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { public RemoteDevelopmentPreferencePage() { super(GRID); setPreferenceStore(new PreferencesAdapter()); } @Override public void init(IWorkbench workbench) { // Do nothing } @Override protected void createFieldEditors() { List namesAndValues = new ArrayList(); String[] nameAndValue = new String[2]; nameAndValue[0] = "None"; //$NON-NLS-1$ nameAndValue[1] = ""; //$NON-NLS-1$ namesAndValues.add(nameAndValue); IRemoteServicesManager manager = RemoteUIPlugin.getService(IRemoteServicesManager.class); for (IRemoteConnectionType service : manager.getRemoteConnectionTypes()) { nameAndValue = new String[2]; nameAndValue[0] = service.getName(); nameAndValue[1] = service.getId(); namesAndValues.add(nameAndValue); } addField(new ComboFieldEditor(IRemotePreferenceConstants.PREF_CONNECTION_TYPE_ID, Messages.RemoteDevelopmentPreferencePage_Default_connection_type, namesAndValues.toArray(new String[namesAndValues .size()][2]), getFieldEditorParent())); } } org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/services/000077500000000000000000000000001272114001700336225ustar00rootroot00000000000000local/000077500000000000000000000000001272114001700346355ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/servicesLocalUIConnectionService.java000066400000000000000000000033541272114001700423360ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/services/local/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui.services.local; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionType.Service; import org.eclipse.remote.ui.AbstractRemoteUIConnectionService; import org.eclipse.remote.ui.IRemoteUIConnectionService; import org.eclipse.remote.ui.IRemoteUIConnectionWizard; import org.eclipse.swt.widgets.Shell; public class LocalUIConnectionService extends AbstractRemoteUIConnectionService { private IRemoteConnectionType connectionType; public LocalUIConnectionService(IRemoteConnectionType connectionType) { this.connectionType = connectionType; } @Override public IRemoteUIConnectionWizard getConnectionWizard(Shell shell) { // we don't do this return null; } public static class Factory implements IRemoteConnectionType.Service.Factory { @SuppressWarnings("unchecked") @Override public T getService(IRemoteConnectionType connectionType, Class service) { if (IRemoteUIConnectionService.class.equals(service)) { return (T) new LocalUIConnectionService(connectionType); } return null; } } @Override public IRemoteConnectionType getConnectionType() { return connectionType; } } LocalUIFileService.java000066400000000000000000000103101272114001700411040ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/services/local/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui.services.local; import java.io.File; import java.util.Arrays; import java.util.List; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionType.Service; import org.eclipse.remote.ui.IRemoteUIFileService; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.DirectoryDialog; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Shell; public class LocalUIFileService implements IRemoteUIFileService { private final IRemoteConnectionType connectionType; private IRemoteConnection connection = null; public LocalUIFileService(IRemoteConnectionType connectionType) { this.connectionType = connectionType; } public static class Factory implements IRemoteConnectionType.Service.Factory { @SuppressWarnings("unchecked") @Override public T getService(IRemoteConnectionType connectionType, Class service) { if (IRemoteUIFileService.class.equals(service)) { return (T) new LocalUIFileService(connectionType); } return null; } } @Override public IRemoteConnectionType getConnectionType() { return connectionType; } /* * (non-Javadoc) * * @see * org.eclipse.remote.core.IRemoteFileManager#browseDirectory(org.eclipse * .swt.widgets.Shell, java.lang.String, java.lang.String) */ @Override public String browseDirectory(Shell shell, String message, String filterPath, int flags) { DirectoryDialog dialog = new DirectoryDialog(shell); dialog.setText(message); if (filterPath != null) { File path = new File(filterPath); if (path.exists()) { dialog.setFilterPath(path.isFile() ? path.getParent() : filterPath); } } String path = dialog.open(); if (path == null) { return null; } return path; } /* * (non-Javadoc) * * @see * org.eclipse.remote.core.IRemoteFileManager#browseFile(org.eclipse * .swt.widgets.Shell, java.lang.String, java.lang.String) */ @Override public String browseFile(Shell shell, String message, String filterPath, int flags) { FileDialog dialog = new FileDialog(shell, SWT.SINGLE); dialog.setText(message); if (filterPath != null) { File path = new File(filterPath); if (path.exists()) { dialog.setFilterPath(path.isFile() ? path.getParent() : filterPath); } } String path = dialog.open(); if (path == null) { return null; } return path; } /* * (non-Javadoc) * * @see * org.eclipse.remote.core.IRemoteFileManager#browseFile(org.eclipse * .swt.widgets.Shell, java.lang.String, java.lang.String) */ @Override public List browseFiles(Shell shell, String message, String filterPath, int flags) { FileDialog dialog = new FileDialog(shell, SWT.MULTI); dialog.setText(message); if (filterPath != null) { File path = new File(filterPath); if (path.exists()) { dialog.setFilterPath(path.isFile() ? path.getParent() : filterPath); } } String path = dialog.open(); if (path == null) { return null; } return Arrays.asList(dialog.getFileNames()); } /* * (non-Javadoc) * * @see org.eclipse.remote.ui.IRemoteUIFileManager#getConnection() */ @Override public IRemoteConnection getConnection() { return connection; } /* * (non-Javadoc) * * @see * org.eclipse.remote.ui.IRemoteUIFileManager#setConnection(org.eclipse * .remote.core.IRemoteConnection) */ @Override public void setConnection(IRemoteConnection connection) { this.connection = connection; } /* * (non-Javadoc) * * @see * org.eclipse.remote.ui.IRemoteUIFileManager#showConnections(boolean) */ @Override public void showConnections(boolean enable) { // Not implemented } } org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/views/000077500000000000000000000000001272114001700331345ustar00rootroot00000000000000CloseConnectionHandler.java000066400000000000000000000044621272114001700403110ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/viewspackage org.eclipse.remote.internal.ui.views; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionControlService; import org.eclipse.remote.internal.ui.RemoteUIPlugin; import org.eclipse.remote.internal.ui.messages.Messages; import org.eclipse.ui.handlers.HandlerUtil; public class CloseConnectionHandler extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection(); if (selection != null && selection instanceof IStructuredSelection) { // Get the manageable connections from the selection final List connections = new ArrayList(); @SuppressWarnings("unchecked") Iterator i = ((IStructuredSelection) selection).iterator(); while (i.hasNext()) { Object obj = i.next(); if (obj instanceof IRemoteConnection) { IRemoteConnection connection = (IRemoteConnection) obj; connections.add(connection); } } new Job(Messages.CloseConnectionHandler_0) { @Override protected IStatus run(IProgressMonitor monitor) { List status = new ArrayList<>(); for (IRemoteConnection connection : connections) { IRemoteConnectionControlService controlService = connection .getService(IRemoteConnectionControlService.class); if (controlService != null) { controlService.close(); } } if (status.isEmpty()) { return Status.OK_STATUS; } else { return new MultiStatus(RemoteUIPlugin.PLUGIN_ID, 1, status.toArray(new IStatus[status.size()]), Messages.CloseConnectionHandler_1, null); } } }.schedule(); } return Status.OK_STATUS; } } DeleteRemoteConnectionHandler.java000066400000000000000000000057051272114001700416230ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/views/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui.views; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.ui.RemoteUIPlugin; import org.eclipse.remote.internal.ui.messages.Messages; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.handlers.HandlerUtil; public class DeleteRemoteConnectionHandler extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection(); if (selection != null && selection instanceof IStructuredSelection) { // Get the manageable connections from the selection List connections = new ArrayList(); @SuppressWarnings("unchecked") Iterator i = ((IStructuredSelection) selection).iterator(); while (i.hasNext()) { Object obj = i.next(); if (obj instanceof IRemoteConnection) { IRemoteConnection connection = (IRemoteConnection) obj; IRemoteConnectionType connectionType = connection.getConnectionType(); if (connectionType.canRemove()) { connections.add(connection); } } } // Confirm the delete String message = Messages.DeleteRemoteConnectionHandler_ConfirmDeleteMessage; for (IRemoteConnection connection : connections) { message += " " + connection.getName(); //$NON-NLS-1$ } message += "?"; //$NON-NLS-1$ if (MessageDialog.openConfirm(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.DeleteRemoteConnectionHandler_DeleteConnectionTitle, message)) { for (IRemoteConnection connection : connections) { IRemoteConnectionType connectionType = connection.getConnectionType(); try { connectionType.removeConnection(connection); } catch (RemoteConnectionException e) { RemoteUIPlugin.log(e.getStatus()); } } } } return Status.OK_STATUS; } } NewRemoteConnectionHandler.java000066400000000000000000000014011272114001700411370ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/viewspackage org.eclipse.remote.internal.ui.views; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.Status; import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; public class NewRemoteConnectionHandler extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { NewRemoteConnectionWizard wizard = new NewRemoteConnectionWizard(); Shell parent = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); WizardDialog dialog = new WizardDialog(parent, wizard); dialog.open(); return Status.OK_STATUS; } } NewRemoteConnectionTypePage.java000066400000000000000000000071731272114001700413140ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/views/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui.views; import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.internal.ui.Messages; import org.eclipse.remote.internal.ui.RemoteUIPlugin; import org.eclipse.remote.ui.IRemoteUIConnectionService; import org.eclipse.remote.ui.IRemoteUIConnectionWizard; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableItem; /** * @since 2.0 API tooling made me put this in even though it's an internal package... */ public class NewRemoteConnectionTypePage extends WizardPage { private Table table; private IRemoteUIConnectionWizard nextWizard; public NewRemoteConnectionTypePage() { super("NewLaunchTargetTypePage"); //$NON-NLS-1$ setTitle(Messages.NewRemoteConnectionTypePage_LaunchTargetType); setDescription(Messages.NewRemoteConnectionTypePage_SelectTargetType); } public IRemoteUIConnectionWizard getNextWizard() { return nextWizard; } @Override public void createControl(Composite parent) { Composite comp = new Composite(parent, SWT.NONE); comp.setLayout(new GridLayout()); table = new Table(comp, SWT.SINGLE | SWT.BORDER); GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); table.setLayoutData(data); setPageComplete(false); IRemoteServicesManager remoteManager = RemoteUIPlugin.getService(IRemoteServicesManager.class); for (IRemoteConnectionType connectionType : remoteManager.getAllConnectionTypes()) { if (!connectionType.canAdd()) continue; IRemoteUIConnectionService connService = connectionType.getService(IRemoteUIConnectionService.class); if (connService == null) continue; IRemoteUIConnectionWizard wizard = connService.getConnectionWizard(parent.getShell()); if (wizard == null) continue; TableItem item = new TableItem(table, SWT.NONE); item.setText(connectionType.getName()); item.setData(wizard); Image icon = connService.getLabelProvider().getImage(connectionType); if (icon != null) { item.setImage(icon); } // TODO select the last selected entry table.select(0); setPageComplete(true); } table.addSelectionListener(new SelectionAdapter() { @Override public void widgetDefaultSelected(SelectionEvent e) { widgetSelected(e); getContainer().showPage(getNextPage()); } }); setControl(comp); } @Override public boolean canFlipToNextPage() { return isPageComplete(); } @Override public IWizardPage getNextPage() { nextWizard = (IRemoteUIConnectionWizard) table.getSelection()[0].getData(); if (nextWizard != null) { nextWizard.addPages(); IWizardPage[] pages = nextWizard.getPages(); if (pages.length > 0) { return pages[0]; } } return super.getNextPage(); } } NewRemoteConnectionWizard.java000066400000000000000000000035101272114001700410250ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/views/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Doug Schaefer *******************************************************************************/ package org.eclipse.remote.internal.ui.views; import org.eclipse.jface.wizard.Wizard; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.ui.Messages; import org.eclipse.remote.internal.ui.RemoteUIPlugin; import org.eclipse.remote.ui.IRemoteUIConnectionWizard; /** * @since 2.0 */ public class NewRemoteConnectionWizard extends Wizard { private final NewRemoteConnectionTypePage typePage; public NewRemoteConnectionWizard() { setWindowTitle(Messages.NewRemoteConnectionWizard_0); typePage = new NewRemoteConnectionTypePage(); setForcePreviousAndNextButtons(true); } @Override public void addPages() { addPage(typePage); } @Override public boolean performFinish() { IRemoteUIConnectionWizard nextWizard = typePage.getNextWizard(); if (nextWizard != null) { IRemoteConnectionWorkingCopy wc = nextWizard.getConnection(); try { wc.save(); } catch (RemoteConnectionException e) { RemoteUIPlugin.log(e); return false; } return true; } else { // what happened? return false; } } @Override public boolean canFinish() { // don't allow to finish since we need to activate actual connection wizard page return false; } } OpenConnectionHandler.java000066400000000000000000000047421272114001700401460ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/viewspackage org.eclipse.remote.internal.ui.views; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionControlService; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.ui.RemoteUIPlugin; import org.eclipse.remote.internal.ui.messages.Messages; import org.eclipse.ui.handlers.HandlerUtil; public class OpenConnectionHandler extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection(); if (selection != null && selection instanceof IStructuredSelection) { // Get the manageable connections from the selection final List connections = new ArrayList(); @SuppressWarnings("unchecked") Iterator i = ((IStructuredSelection) selection).iterator(); while (i.hasNext()) { Object obj = i.next(); if (obj instanceof IRemoteConnection) { IRemoteConnection connection = (IRemoteConnection) obj; connections.add(connection); } } new Job(Messages.OpenConnectionHandler_0) { @Override protected IStatus run(IProgressMonitor monitor) { List status = new ArrayList<>(); for (IRemoteConnection connection : connections) { IRemoteConnectionControlService controlService = connection .getService(IRemoteConnectionControlService.class); if (controlService != null) { try { controlService.open(monitor); } catch (RemoteConnectionException e) { status.add(e.getStatus()); } } } if (status.isEmpty()) { return Status.OK_STATUS; } else { return new MultiStatus(RemoteUIPlugin.PLUGIN_ID, 1, status.toArray(new IStatus[status.size()]), Messages.OpenConnectionHandler_1, null); } } }.schedule(); } return Status.OK_STATUS; } } RemoteConnectionPropertyPage.java000066400000000000000000000027131272114001700415400ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/viewspackage org.eclipse.remote.internal.ui.views; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.internal.ui.Messages; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.dialogs.PropertyPage; public class RemoteConnectionPropertyPage extends PropertyPage { @Override protected Control createContents(Composite parent) { Composite comp = new Composite(parent, SWT.NONE); comp.setLayout(new GridLayout(2, false)); IRemoteConnection connection = null; Object element = getElement(); if (element instanceof IRemoteConnection) { connection = (IRemoteConnection) element; } else if (element instanceof IAdaptable) { connection = (IRemoteConnection) ((IAdaptable) element).getAdapter(IRemoteConnection.class); } if (connection != null) { Label nameLabel = new Label(comp, SWT.NONE); nameLabel.setText(Messages.RemoteConnectionPropertyPage_ConnectionName); Text nameText = new Text(comp, SWT.BORDER); nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); nameText.setText(connection.getName()); } return comp; } @Override public boolean performOk() { // TODO, change the name if it needs changing return true; } } RemoteConnectionsActionProvider.java000066400000000000000000000010601272114001700422240ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/viewspackage org.eclipse.remote.internal.ui.views; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.window.SameShellProvider; import org.eclipse.ui.dialogs.PropertyDialogAction; import org.eclipse.ui.navigator.CommonActionProvider; public class RemoteConnectionsActionProvider extends CommonActionProvider { @Override public void fillContextMenu(IMenuManager menu) { // Property menu menu.add(new PropertyDialogAction(new SameShellProvider(getActionSite().getViewSite().getShell()), getActionSite().getStructuredViewer())); } } RemoteConnectionsContentProvider.java000066400000000000000000000050131272114001700424230ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/views/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui.views; import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.Viewer; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.RemoteConnectionChangeEvent; import org.eclipse.remote.core.IRemoteConnectionChangeListener; import org.eclipse.remote.core.IRemoteServicesManager; public class RemoteConnectionsContentProvider implements ITreeContentProvider, IRemoteConnectionChangeListener { private IRemoteServicesManager remoteServicesManager; private Viewer viewer; @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { this.viewer = viewer; if (newInput instanceof IRemoteServicesManager) { if (remoteServicesManager != null) { // remove us as a listener on the old manager remoteServicesManager.removeRemoteConnectionChangeListener(this); } remoteServicesManager = (IRemoteServicesManager) newInput; remoteServicesManager.addRemoteConnectionChangeListener(this); } } @Override public void connectionChanged(RemoteConnectionChangeEvent event) { // Refresh the viewer on the UI thread viewer.getControl().getDisplay().asyncExec(new Runnable() { @Override public void run() { viewer.refresh(); } }); } @Override public void dispose() { if (remoteServicesManager != null) { remoteServicesManager.removeRemoteConnectionChangeListener(this); } } @Override public Object[] getElements(Object inputElement) { return remoteServicesManager.getAllRemoteConnections().toArray(); } @Override public Object[] getChildren(Object parentElement) { // Connections have no children by default return new Object[0]; } @Override public Object getParent(Object element) { if (element instanceof IRemoteConnection) { return remoteServicesManager; } else { return null; } } @Override public boolean hasChildren(Object element) { if (element instanceof IRemoteServicesManager) { return true; } else { return false; } } } RemoteConnectionsView.java000066400000000000000000000017111272114001700402110ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/internal/ui/views/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.internal.ui.views; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.internal.ui.RemoteUIPlugin; import org.eclipse.ui.navigator.CommonNavigator; public class RemoteConnectionsView extends CommonNavigator { @Override protected Object getInitialInput() { // the remote services manager is the root object return RemoteUIPlugin.getService(IRemoteServicesManager.class); } } org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/000077500000000000000000000000001272114001700301635ustar00rootroot00000000000000AbstractRemoteUIConnectionService.java000066400000000000000000000072231272114001700374710ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/******************************************************************************* * Copyright (c) 2013 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.ui; import java.lang.reflect.InvocationTargetException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.ui.RemoteUIImages; import org.eclipse.remote.internal.ui.RemoteUIPlugin; import org.eclipse.remote.internal.ui.messages.Messages; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Shell; /** * Abstract base class for providing UI connection manager services. * @since 2.0 */ public abstract class AbstractRemoteUIConnectionService implements IRemoteUIConnectionService { @Override public void openConnectionWithProgress(final Shell shell, IRunnableContext context, final IRemoteConnection connection) { if (!connection.isOpen()) { IRunnableWithProgress op = new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { connection.open(monitor); } catch (RemoteConnectionException e) { throw new InvocationTargetException(e); } if (monitor.isCanceled()) { throw new InterruptedException(); } } }; try { if (context != null) { context.run(true, true, op); } else { new ProgressMonitorDialog(shell).run(true, true, op); } } catch (InvocationTargetException e) { ErrorDialog.openError(shell, Messages.AbstractRemoteUIConnectionManager_Connection_Error, Messages.AbstractRemoteUIConnectionManager_Could_not_open_connection, new Status(IStatus.ERROR, RemoteUIPlugin.PLUGIN_ID, e.getCause().getMessage())); } catch (InterruptedException e) { ErrorDialog.openError(shell, Messages.AbstractRemoteUIConnectionManager_Connection_Error, Messages.AbstractRemoteUIConnectionManager_Could_not_open_connection, new Status(IStatus.ERROR, RemoteUIPlugin.PLUGIN_ID, e.getMessage())); } } } protected static class DefaultLabelProvider extends LabelProvider { @Override public String getText(Object element) { if (element instanceof IRemoteConnection) { return ((IRemoteConnection) element).getName(); } else if (element instanceof IRemoteConnectionType) { return ((IRemoteConnectionType) element).getName(); } else { return super.getText(element); } } @Override public Image getImage(Object element) { if (element instanceof IRemoteConnection || element instanceof IRemoteConnectionType) { return RemoteUIImages.get(RemoteUIImages.IMG_DEFAULT_TYPE); } return super.getImage(element); } } @Override public ILabelProvider getLabelProvider() { return new DefaultLabelProvider(); } } IRemoteUIConnectionService.java000066400000000000000000000045651272114001700361240ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.ui; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.swt.widgets.Shell; /** * Interface for providing connection management operations in the UI. Clients can call these methods to open generic dialogs for * operations on connections. * @since 2.0 */ public interface IRemoteUIConnectionService extends IRemoteConnectionType.Service { /** * ID for the command to start the new connection wizard. */ public static final String NEW_CONNECTION_COMMAND = "org.eclipse.remote.ui.command.newConnection"; //$NON-NLS-1$ /** * Create a wizard for adding or editing connections. The implementation can choose to do this in any way, but typically will * use a dialog or wizard. * * @param shell * shell used to display dialogs * @return connection wizard */ public IRemoteUIConnectionWizard getConnectionWizard(Shell shell); /** * Attempt to open a connection using a progress monitor. Can be called on either open or closed connections, and will * initialize the remote services if necessary. Users should check connection.isOpen() on return to determine if the connection * was actually opened. * * @param shell * shell used to display dialogs * @param context * runnable context for displaying progress indicator. Can be null. * @param connection * connection to open */ public void openConnectionWithProgress(Shell shell, IRunnableContext context, IRemoteConnection connection); /** * Return the label provider that provides the text and base image for the connection type * and connections of that type. * * @return label provider */ public ILabelProvider getLabelProvider(); } IRemoteUIConnectionWizard.java000066400000000000000000000041131272114001700357510ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/******************************************************************************* * Copyright (c) 2013 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.ui; import java.util.Set; import org.eclipse.jface.wizard.IWizard; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; /** * Interface for creating and editing connections in the UI. */ public interface IRemoteUIConnectionWizard extends IWizard { /** * Open configuration wizard allowing the user to enter information about a connection. If the user confirms the information is * correct (e.g. selects OK in a dialog) then a working copy of the connection is returned. If the user discards the * information, then null is returned. * * @return connection working copy or null if the wizard is canceled */ IRemoteConnectionWorkingCopy open(); /** * Get the connection being edited. * * @return connection being edited * @since 2.0 */ IRemoteConnectionWorkingCopy getConnection(); /** * Set a connection containing the information to be edited by the wizard. Setting this value overrides the * {@link #setConnectionName(String)} method. * * @param connection * connection used to initialize the wizard */ void setConnection(IRemoteConnectionWorkingCopy connection); /** * Set the initial name of the connection. * * @param name * initial connection name */ void setConnectionName(String name); /** * Supply a set of connection names that are invalid. The dialog should display an error if the user trys to select a name from * the set. * * @param names * set of invalid connections names */ void setInvalidConnectionNames(Set names); } IRemoteUIConstants.java000066400000000000000000000017021272114001700344460ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/******************************************************************************* * Copyright (c) 2009 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.ui; /** * Constants use by UI operations. */ public interface IRemoteUIConstants { /** * A constant indicating that no bits are set. */ public static int NONE = 0; /** * A constant used to indicate a dialog used for opening files. */ public static int OPEN = 1 << 1; /** * A constant used to indicate a dialog should be used for saving files. */ public static int SAVE = 1 << 2; } IRemoteUIFileService.java000066400000000000000000000073701272114001700347010ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/******************************************************************************* * 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 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.ui; import java.util.List; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.swt.widgets.Shell; /** * Interface for providing file management operations in the UI. Clients can call these methods to open generic dialogs for * operations on remote resources. * * @since 2.0 */ public interface IRemoteUIFileService extends IRemoteConnectionType.Service { /** * Browse for a remote directory. The return value is the path of the * directory on the remote system. * * Equivalent to {@link org.eclipse.swt.widgets.DirectoryDialog}. * * @param shell * workbench shell * @param message * message to display in dialog * @param initialPath * initial path to use when displaying files * @param flags * option settings for dialog (not currently used) * valid values are NONE (@see IRemoteUIConstants) * @return the path to the directory relative to the remote system or null * if the browser was cancelled */ public String browseDirectory(Shell shell, String message, String initialPath, int flags); /** * Browse for a remote file. The return value is the path of the file on * the remote system. * * Equivalent to {@link org.eclipse.swt.widgets.FileDialog}. * * @param shell * workbench shell * @param message * message to display in dialog * @param initialPath * initial path to use when displaying files * @param flags * options settings for dialog * valid values are NONE, SAVE, or OPEN (@see IRemoteUIConstants) * @return the path to the file relative to the remote system or null if the * browser was cancelled */ public String browseFile(Shell shell, String message, String initialPath, int flags); /** * Browse for a set of remote files. The return value is a list of paths * of the files on the remote system. * * Equivalent to {@link org.eclipse.swt.widgets.FileDialog}. * * @param shell * workbench shell * @param message * message to display in dialog * @param initialPath * initial path to use when displaying files * @param flags * options settings for dialog (@see IRemoteUIConstants) * valid values are NONE, SAVE, or OPEN (@see IRemoteUIConstants) * @return list of paths to the files relative to the remote system or null if the * browser was cancelled */ public List browseFiles(Shell shell, String message, String initialPath, int flags); /** * Get the last connection that was selected in the browser. * * @return selected connection */ public IRemoteConnection getConnection(); /** * Set the connection to use for file browsing. The connection must support the IRemoteFileService service or it will be * ignored. * * @param connection * connection to use for file browsing */ public void setConnection(IRemoteConnection connection); /** * Show a list of available connections if possible. * * @param enable * enable connection list */ public void showConnections(boolean enable); } RemoteConnectionsLabelProvider.java000066400000000000000000000064521272114001700370670ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX Software Systems - initial API and implementation *******************************************************************************/ package org.eclipse.remote.ui; import org.eclipse.jface.resource.CompositeImageDescriptor; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.internal.ui.RemoteUIPlugin; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.ui.ISharedImages; import org.eclipse.ui.PlatformUI; /** * A label provider to show the test and base image for remote connections. * It calls out to the connection type services to get the text and images for * the types of the connections. * * @since 2.0 */ public class RemoteConnectionsLabelProvider extends LabelProvider { @Override public String getText(Object element) { if (element instanceof IRemoteConnection) { IRemoteConnectionType type = ((IRemoteConnection) element).getConnectionType(); IRemoteUIConnectionService uiService = type.getService(IRemoteUIConnectionService.class); if (uiService != null) { return uiService.getLabelProvider().getText(element); } else { return ((IRemoteConnection) element).getName(); } } else { return super.getText(element); } } @Override public Image getImage(Object element) { if (element instanceof IRemoteConnection) { IRemoteConnection connection = (IRemoteConnection) element; IRemoteConnectionType type = connection.getConnectionType(); IRemoteUIConnectionService uiService = type.getService(IRemoteUIConnectionService.class); if (uiService != null) { final Image baseImage = uiService.getLabelProvider().getImage(element); if (connection.isOpen()) { return baseImage; } else { String closedId = "closed." + type.getId(); //$NON-NLS-1$ Image closedImage = RemoteUIPlugin.getDefault().getImageRegistry().get(closedId); if (closedImage == null) { final Image errorImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEC_FIELD_ERROR); ImageDescriptor desc = new CompositeImageDescriptor() { @Override protected Point getSize() { Rectangle bounds = baseImage.getBounds(); return new Point(bounds.width, bounds.height); } @Override protected void drawCompositeImage(int width, int height) { drawImage(baseImage.getImageData(), 0, 0); int y = baseImage.getBounds().height - errorImage.getBounds().height; drawImage(errorImage.getImageData(), 0, y); } }; closedImage = desc.createImage(); RemoteUIPlugin.getDefault().getImageRegistry().put(closedId, closedImage); } return closedImage; } } } return super.getImage(element); } } org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/dialogs/000077500000000000000000000000001272114001700316055ustar00rootroot00000000000000RemoteResourceBrowser.java000066400000000000000000000251161272114001700367050ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/dialogs/******************************************************************************* * Copyright (c) 2008,2013 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.ui.dialogs; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.operation.ModalContext; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.wizard.ProgressMonitorPart; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteFileService; import org.eclipse.remote.internal.ui.messages.Messages; import org.eclipse.remote.ui.widgets.RemoteResourceBrowserWidget; import org.eclipse.swt.SWT; import org.eclipse.swt.events.FocusEvent; import org.eclipse.swt.events.FocusListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Shell; /** * Generic file/directory browser for remote resources. * * A directory browser (DIRECTORY_BROWSER) only allows selection of directories. * A file browser (FILE_BROWSER) allows selection of files and directories, but the ok button is only enabled when a file is * selected. * A resource browser (FILE_BROWSER|DIRECTORY_BROWSER) allows selection of files and directories. This is the default. * * To select multiple resources, set the style to SWT.MULTI. * * @author greg * */ public class RemoteResourceBrowser extends Dialog implements IRunnableContext { public static final String EMPTY_STRING = ""; //$NON-NLS-1$ public static final int FILE_BROWSER = 0x01; public static final int DIRECTORY_BROWSER = 0x02; private final static int widthHint = 400; private Button fOkButton; private RemoteResourceBrowserWidget fResourceBrowserWidget; private ProgressMonitorPart fProgressMonitor; private int fBrowserType; private String fDialogTitle; private boolean fShowHiddenCheckbox = true; private boolean fShowNewFolderButton = true; private boolean fShowConnections = false; private boolean fShowLocalSelection = false; private String fInitialPath; private IRemoteConnection fConnection; private int fBrowserStyle = SWT.SINGLE; public RemoteResourceBrowser(Shell parent, int style) { super(parent); setShellStyle(SWT.RESIZE | getShellStyle()); if (style != SWT.NONE) { fBrowserStyle = style; } setTitle(Messages.RemoteResourceBrowser_resourceTitle); setType(FILE_BROWSER | DIRECTORY_BROWSER); } /* * (non-Javadoc) * * @see * org.eclipse.jface.dialogs.Dialog#createButton(org.eclipse.swt.widgets * .Composite, int, java.lang.String, boolean) */ @Override protected Button createButton(Composite parent, int id, String label, boolean defaultButton) { Button button = super.createButton(parent, id, label, defaultButton); if (id == IDialogConstants.OK_ID) { fOkButton = button; } return button; } /* * (non-Javadoc) * * @see * org.eclipse.jface.dialogs.Dialog#createContents(org.eclipse.swt.widgets * .Composite) */ @Override protected Control createContents(Composite parent) { Control contents = super.createContents(parent); if (fDialogTitle == null) { if (fBrowserType == DIRECTORY_BROWSER) { setTitle(Messages.RemoteResourceBrowser_directoryTitle); } else if (fBrowserType == FILE_BROWSER) { setTitle(Messages.RemoteResourceBrowser_fileTitle); } } else { setTitle(fDialogTitle); } if (fInitialPath != null) { fResourceBrowserWidget.setInitialPath(fInitialPath); } if (fConnection != null) { fResourceBrowserWidget.setConnection(fConnection); } updateDialog(); return contents; } /* * (non-Javadoc) * * @see * org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets * .Composite) */ @Override protected Control createDialogArea(Composite parent) { Composite main = (Composite) super.createDialogArea(parent); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); gd.widthHint = widthHint; main.setLayoutData(gd); main.setLayout(new GridLayout(1, true)); int options = 0; if (fConnection == null || fShowConnections) { options |= RemoteResourceBrowserWidget.SHOW_CONNECTIONS; } if (fBrowserType == DIRECTORY_BROWSER) { options |= RemoteResourceBrowserWidget.DIRECTORY_BROWSER; } else if (fBrowserType == FILE_BROWSER) { options |= RemoteResourceBrowserWidget.FILE_BROWSER; } else { options |= RemoteResourceBrowserWidget.FILE_BROWSER | RemoteResourceBrowserWidget.DIRECTORY_BROWSER; } if (fShowHiddenCheckbox) { options |= RemoteResourceBrowserWidget.SHOW_HIDDEN_CHECKBOX; } if (fShowNewFolderButton) { options |= RemoteResourceBrowserWidget.SHOW_NEW_FOLDER_BUTTON; } if (fShowLocalSelection) { options |= RemoteResourceBrowserWidget.SHOW_LOCAL_SELECTION; } fResourceBrowserWidget = new RemoteResourceBrowserWidget(main, fBrowserStyle, options); fResourceBrowserWidget.addSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { updateDialog(); } }); fResourceBrowserWidget.addFocusListener(new FocusListener() { @Override public void focusGained(FocusEvent e) { getShell().setDefaultButton(null); // allow text widget to receive SWT.DefaultSelection event } @Override public void focusLost(FocusEvent e) { getShell().setDefaultButton(fOkButton); } }); fResourceBrowserWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); if (fConnection != null) { fResourceBrowserWidget.setConnection(fConnection); } Composite monitorComposite = new Composite(main, SWT.NULL); GridLayout layout = new GridLayout(); layout.marginHeight = 0; layout.marginWidth = 0; layout.numColumns = 2; monitorComposite.setLayout(layout); monitorComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fProgressMonitor = new ProgressMonitorPart(monitorComposite, new GridLayout(), true); GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, true); fProgressMonitor.setLayoutData(gridData); monitorComposite.setVisible(false); fResourceBrowserWidget.setRunnableContext(this); return main; } /** * Get the connection that was selected * * @return selected connection */ public IRemoteConnection getConnection() { if (fResourceBrowserWidget != null) { return fResourceBrowserWidget.getConnection(); } return null; } /** * Get the resources that was selected. * * @return selected resource or null if no resource is selected */ public IFileStore getResource() { if (fResourceBrowserWidget != null) { return fResourceBrowserWidget.getResource(); } return null; } /** * Get the resources that were selected. * * @return selected resources */ public List getResources() { if (fResourceBrowserWidget != null) { return fResourceBrowserWidget.getResources(); } return new ArrayList(); } /* * (non-Javadoc) * * @see org.eclipse.jface.operation.IRunnableContext#run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress) */ @Override public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { fProgressMonitor.attachToCancelComponent(null); fProgressMonitor.getParent().setVisible(true); try { ModalContext.run(runnable, fork, fProgressMonitor, getShell().getDisplay()); } finally { fProgressMonitor.getParent().setVisible(false); fProgressMonitor.removeFromCancelComponent(null); } } /** * Set the connection for the browser. The connection must support the IRemoteFileService service or this method will have no * effect. * * @param connection * connection that supports the IRemoteFileService service */ public void setConnection(IRemoteConnection connection) { if (connection != null && connection.hasService(IRemoteFileService.class)) { fConnection = connection; } } /** * Set the initial path to start browsing. This will be set in the browser * text field, and in a future version should expand the browser to this * location if it exists. * * @param path */ public void setInitialPath(String path) { fInitialPath = path; } /** * Set the fDialogTitle of the dialog. * * @param title */ public void setTitle(String title) { fDialogTitle = title; if (fDialogTitle == null) { fDialogTitle = ""; //$NON-NLS-1$ } Shell shell = getShell(); if ((shell != null) && !shell.isDisposed()) { shell.setText(fDialogTitle); } } /** * Set the type of browser. Can be either a file browser (allows selection * of files), a directory browser (allows selection of directories), or * a resource browser (allows selection of files and directories). */ public void setType(int type) { fBrowserType = type; } /** * Show available connections on browser if possible (default disabled). * * @param enable */ public void showConnections(boolean enable) { fShowConnections = enable; } /** * Enable a checkbox to show hidden files (default enabled) * * @param showHidden */ public void showHiddenCheckbox(boolean showHidden) { fShowHiddenCheckbox = showHidden; } /** * Enable selection of local files * * @param showNewFolderButton */ public void showLocalSelection(boolean showLocalSelection) { fShowLocalSelection = showLocalSelection; } /** * Enable a button to create new folders (default enabled) * * @param showNewFolderButton */ public void showNewFolderButton(boolean showNewFolderButton) { fShowNewFolderButton = showNewFolderButton; } private void updateDialog() { if (fOkButton != null) { IFileStore resource = getResource(); boolean enabled = getConnection() != null && resource != null; if (enabled && fBrowserType == FILE_BROWSER) { enabled &= !resource.fetchInfo().isDirectory(); } fOkButton.setEnabled(enabled); } } } org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/widgets/000077500000000000000000000000001272114001700316315ustar00rootroot00000000000000RemoteConnectionWidget.java000066400000000000000000000514321272114001700370410ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/widgets/******************************************************************************* * Copyright (c) 2011 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Greg Watson - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.ui.widgets; import java.util.Collections; import java.util.Comparator; import java.util.List; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.ListenerList; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.IRemotePreferenceConstants; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.internal.core.preferences.Preferences; import org.eclipse.remote.internal.ui.RemoteUIPlugin; import org.eclipse.remote.internal.ui.messages.Messages; import org.eclipse.remote.ui.IRemoteUIConnectionService; import org.eclipse.remote.ui.IRemoteUIConnectionWizard; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; /** * Widget to allow the user to select a service provider and connection. Provides a "New" button to create a new connection. * * If title is supplied then the widget will be placed in a group. * * @since 5.0 * */ public class RemoteConnectionWidget extends Composite { /** * Listener for widget selected events. Allows the events to be enabled/disabled. * */ protected class WidgetListener implements SelectionListener { /** State of the listener (enabled/disabled). */ private boolean listenerEnabled = true; /** * Disable listener, received events shall be ignored. */ public void disable() { setEnabled(false); } protected void doWidgetDefaultSelected(SelectionEvent e) { // Default empty implementation. } /** * Enable the listener to handle events. */ public void enable() { setEnabled(true); } /** * Test if the listener is enabled. */ public synchronized boolean isEnabled() { return listenerEnabled; } /** * Set listener enabled state * * @param enabled */ public synchronized void setEnabled(boolean enabled) { listenerEnabled = enabled; } @Override public void widgetDefaultSelected(SelectionEvent e) { if (isEnabled()) { widgetSelected(e); } } @Override public void widgetSelected(SelectionEvent e) { if (isEnabled()) { Object source = e.getSource(); if (source == fConnectionTypeCombo) { handleConnectionTypeSelected(null); } else if (source == fConnectionCombo) { handleConnectionSelected(); } else if (source == fNewConnectionButton) { handleNewRemoteConnectionSelected(); } else if (source == fLocalButton) { handleButtonSelected(); } else if (source == fRemoteButton) { handleButtonSelected(); } } } } public static final String DEFAULT_CONNECTION_NAME = "Remote Host"; //$NON-NLS-1$ /** * Force the use of the connection type combo, regardless of the PREF_CONNECTION_TYPE preference setting. * * @since 2.0 */ public static int FLAG_FORCE_CONNECTION_TYPE_SELECTION = 1 << 0; /** * Do not provide a selection for local services. */ public static int FLAG_NO_LOCAL_SELECTION = 1 << 1; private Combo fConnectionTypeCombo; private Button fLocalButton; private Button fRemoteButton; private final Combo fConnectionCombo; private final Button fNewConnectionButton; private List fConnectionTypes; private IRemoteConnection fSelectedConnection; private IRemoteServicesManager fRemoteServicesManager = RemoteUIPlugin.getService(IRemoteServicesManager.class); private IRemoteConnectionType fDefaultConnectionType; private boolean fSelectionListernersEnabled = true; private boolean fEnabled = true; private final ListenerList fSelectionListeners = new ListenerList(); private final WidgetListener fWidgetListener = new WidgetListener(); /** * Constructor * * @param parent * parent composite * @param style * style or SWT.NONE * @param title * if a title is supplied then the widget will be placed in a group. Can be null. * @param flags * a combination of flags that modify the behavior of the widget. */ public RemoteConnectionWidget(Composite parent, int style, String title, int flags) { this(parent, style, title, flags, null, null); } /** * Constructor * * @param parent * parent composite * @param style * style or SWT.NONE * @param title * if a title is supplied then the widget will be placed in a group. Can be null. * @param flags * a combination of flags that modify the behavior of the widget. * @param context * runnable context, or null * @param connnectionTypes * list of connection types to select from * @since 2.0 */ public RemoteConnectionWidget(Composite parent, int style, String title, int flags, IRunnableContext context) { this(parent, style, title, flags, context, null); } /** * Constructor * * @param parent * parent composite * @param style * style or SWT.NONE * @param title * if a title is supplied then the widget will be placed in a group. Can be null. * @param flags * a combination of flags that modify the behavior of the widget. * @param connnectionTypes * list of connection types to select from * @since 2.0 */ public RemoteConnectionWidget(Composite parent, int style, String title, int flags, List connectionTypes) { this(parent, style, title, flags, null, connectionTypes); } /** * Constructor * * @param parent * parent composite * @param style * style or SWT.NONE * @param title * if a title is supplied then the widget will be placed in a group. Can be null. * @param flags * a combination of flags that modify the behavior of the widget. * @param context * runnable context, or null * @param connnectionTypes * list of connection types to select from * @since 2.0 */ public RemoteConnectionWidget(Composite parent, int style, String title, int flags, IRunnableContext context, List connectionTypes) { super(parent, style); if (connectionTypes != null) { // Just present the connections that are provided flags |= FLAG_FORCE_CONNECTION_TYPE_SELECTION | FLAG_NO_LOCAL_SELECTION; } Composite body = this; GridLayout layout = new GridLayout(1, false); layout.marginHeight = 0; layout.marginWidth = 0; layout.numColumns = 4; setLayout(layout); setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); if (title != null) { Group group = new Group(this, SWT.NONE); group.setText(title); GridLayout groupLayout = new GridLayout(1, false); groupLayout.marginHeight = 0; groupLayout.marginWidth = 0; groupLayout.numColumns = 4; group.setLayout(groupLayout); group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); layout.numColumns = 1; body = group; } fRemoteServicesManager = RemoteUIPlugin.getService(IRemoteServicesManager.class); if (connectionTypes != null) { // No default if the list of connection types was supplied fConnectionTypes = connectionTypes; } else { fConnectionTypes = fRemoteServicesManager.getRemoteConnectionTypes(); String id = Preferences.getString(IRemotePreferenceConstants.PREF_CONNECTION_TYPE_ID); if (id != null) { fDefaultConnectionType = fRemoteServicesManager.getConnectionType(id); } } /* * Check if we need a connection type combo, or we should just use the default provider */ if ((flags & FLAG_FORCE_CONNECTION_TYPE_SELECTION) != 0) { Label label = new Label(body, SWT.NONE); label.setText(Messages.RemoteConnectionWidget_Connection_Type); label.setLayoutData(new GridData()); fConnectionTypeCombo = new Combo(body, SWT.DROP_DOWN | SWT.READ_ONLY); GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false); gd.horizontalSpan = 3; fConnectionTypeCombo.setLayoutData(gd); fConnectionTypeCombo.addSelectionListener(fWidgetListener); fConnectionTypeCombo.setFocus(); } if ((flags & FLAG_NO_LOCAL_SELECTION) == 0 && (flags & FLAG_FORCE_CONNECTION_TYPE_SELECTION) == 0) { fLocalButton = new Button(body, SWT.RADIO); fLocalButton.setText(Messages.RemoteConnectionWidget_Local); fLocalButton.setLayoutData(new GridData()); fLocalButton.addSelectionListener(fWidgetListener); fLocalButton.setSelection(false); fRemoteButton = new Button(body, SWT.RADIO); fRemoteButton.setText(Messages.RemoteConnectionWidget_Remote); fRemoteButton.setLayoutData(new GridData()); fRemoteButton.addSelectionListener(fWidgetListener); } else { Label remoteLabel = new Label(body, SWT.NONE); remoteLabel.setText(Messages.RemoteConnectionWidget_Connection_Name); remoteLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); } fConnectionCombo = new Combo(body, SWT.DROP_DOWN | SWT.READ_ONLY); fConnectionCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); fConnectionCombo.addSelectionListener(fWidgetListener); if (fDefaultConnectionType != null) { fConnectionCombo.setFocus(); } fConnectionCombo.setEnabled(false); fNewConnectionButton = new Button(body, SWT.PUSH); fNewConnectionButton.setText(Messages.RemoteConnectionWidget_New); fNewConnectionButton.setLayoutData(new GridData()); fNewConnectionButton.addSelectionListener(fWidgetListener); if (fConnectionTypeCombo != null) { initializeConnectionTypeCombo(); } handleConnectionTypeSelected(null); if (fLocalButton != null) { handleButtonSelected(); } } /** * Adds the listener to the collection of listeners who will be notified when the user changes the receiver's selection, by * sending it one of the messages defined in the SelectionListener interface. *

* widgetSelected is called when the user changes the service provider or connection. *

* * @param listener * the listener which should be notified */ public void addSelectionListener(SelectionListener listener) { fSelectionListeners.add(listener); } /** * Limit the connection types that will be used when displaying valid connections. Only connection types that support * connections with supplied services will be displayed in the connection type combo, and only connections from these connection * types will be displayed in the connection combo. * * @param services * list of services {@link IRemoteConnection.Service} * @since 2.0 */ @SafeVarargs public final void filterConnections(Class... services) { fConnectionTypes = fRemoteServicesManager.getConnectionTypesSupporting(services); if (fConnectionTypeCombo != null) { initializeConnectionTypeCombo(); } handleConnectionTypeSelected(null); } /** * Get the new button from the widget * * @return button * @since 7.0 */ public Button getButton() { return fNewConnectionButton; } /** * Get the connection that is currently selected in the widget, or null if there is no selected connection. * * @return selected connection */ public IRemoteConnection getConnection() { return fSelectedConnection; } private IRemoteConnectionType getSelectedConnectionType() { if (fConnectionTypeCombo != null) { int selectionIndex = fConnectionTypeCombo.getSelectionIndex(); if (fConnectionTypes.size() > 0 && selectionIndex > 0) { return fConnectionTypes.get(selectionIndex - 1); } } if (fDefaultConnectionType != null) { return fDefaultConnectionType; } return null; } private IRemoteUIConnectionService getUIConnectionManager() { IRemoteConnectionType services = getSelectedConnectionType(); if (services != null) { return services.getService(IRemoteUIConnectionService.class); } return null; } private void handleButtonSelected() { fRemoteButton.setSelection(!fLocalButton.getSelection()); updateEnablement(); handleConnectionSelected(); } /** * Handle the section of a new connection. Update connection option buttons appropriately. * * @throws CoreException */ protected void handleConnectionSelected() { final boolean enabled = fWidgetListener.isEnabled(); fWidgetListener.disable(); IRemoteConnection selectedConnection = null; if (fLocalButton != null && fLocalButton.getSelection()) { selectedConnection = fRemoteServicesManager.getLocalConnectionType().getConnections().get(0); } else { int currentSelection = fConnectionCombo.getSelectionIndex(); if (currentSelection > 0) { String connectionName = fConnectionCombo.getItem(currentSelection); selectedConnection = getSelectedConnectionType().getConnection(connectionName); } } if (selectedConnection == null || fSelectedConnection == null || !selectedConnection.getName().equals(fSelectedConnection.getName())) { fSelectedConnection = selectedConnection; Event evt = new Event(); evt.widget = this; notifyListeners(new SelectionEvent(evt)); } fWidgetListener.setEnabled(enabled); } /** * Handle creation of a new connection by pressing the 'New...' button. Calls handleRemoteServicesSelected() to update the * connection combo with the new connection. * * TODO should probably select the new connection * * @throws CoreException */ protected void handleNewRemoteConnectionSelected() { if (getUIConnectionManager() != null) { IRemoteUIConnectionWizard wizard = getUIConnectionManager().getConnectionWizard(getShell()); if (wizard != null) { wizard.setConnectionName(initialConnectionName()); IRemoteConnectionWorkingCopy conn = wizard.open(); if (conn != null) { try { handleConnectionTypeSelected(conn.save()); handleConnectionSelected(); } catch (CoreException e) { RemoteUIPlugin.log(e); } } } } } /** * Handle selection of a new connection type from the connection type combo. Handles the special case where the * connection type combo is null and a local connection is supplied. In this case, the selected connection type is not changed. * * The assumption is that this will trigger a call to the selection handler for the connection combo. * * @param conn * connection to select as current. If conn is null, select the first item in the list. * @throws CoreException * @since 2.0 */ protected void handleConnectionTypeSelected(IRemoteConnection conn) { final boolean enabled = fWidgetListener.isEnabled(); fWidgetListener.disable(); try { IRemoteConnectionType selectedConnectionType = getSelectedConnectionType(); if (conn != null) { selectedConnectionType = conn.getConnectionType(); } /* * If a connection was supplied, set its connection type in the combo. Otherwise use the currently selected * service. */ if (fDefaultConnectionType == null && conn != null) { for (int index = 0; index < fConnectionTypes.size(); index++) { if (fConnectionTypes.get(index).getId().equals(selectedConnectionType.getId())) { fConnectionTypeCombo.select(index + 1); break; } } } fConnectionCombo.removeAll(); fConnectionCombo.add(Messages.RemoteConnectionWidget_selectConnection); if (selectedConnectionType == null) { fConnectionCombo.select(0); fConnectionCombo.setEnabled(false); fNewConnectionButton.setEnabled(false); handleConnectionSelected(); } else { fConnectionCombo.setEnabled(true); /* * Populate the connection combo and select the connection */ int selected = 0; int offset = 1; List sorted = selectedConnectionType.getConnections(); Collections.sort(sorted, new Comparator() { @Override public int compare(IRemoteConnection o1, IRemoteConnection o2) { return o1.getName().compareTo(o2.getName()); } }); for (IRemoteConnection s : sorted) { fConnectionCombo.add(s.getName()); if (conn != null && s.getName().equals(conn.getName())) { selected = offset; } offset++; } fConnectionCombo.select(selected); handleConnectionSelected(); /* * Enable 'new' button if new connections are supported */ fNewConnectionButton.setEnabled(selectedConnectionType.canAdd()); } } finally { fWidgetListener.setEnabled(enabled); } } private String initialConnectionName() { String name = DEFAULT_CONNECTION_NAME; int count = 1; while (getSelectedConnectionType().getConnection(name) != null) { name = DEFAULT_CONNECTION_NAME + " " + count++; //$NON-NLS-1$ } return name; } /** * Initialize the contents of the connection type combo. Keeps an array of connection types that matches the combo elements. * Returns the id of the selected element. * * @since 2.0 */ protected void initializeConnectionTypeCombo() { final boolean enabled = fWidgetListener.isEnabled(); fWidgetListener.disable(); fConnectionTypeCombo.removeAll(); int offset = 1; int defIndex = 0; fConnectionTypeCombo.add(Messages.RemoteConnectionWidget_selectConnectionType); for (int i = 0; i < fConnectionTypes.size(); i++) { fConnectionTypeCombo.add(fConnectionTypes.get(i).getName()); if (fDefaultConnectionType != null && fConnectionTypes.get(i).equals(fDefaultConnectionType)) { defIndex = i + offset; } } if (fConnectionTypes.size() > 0) { fConnectionTypeCombo.select(defIndex); } fWidgetListener.setEnabled(enabled); } /* * (non-Javadoc) * * @see org.eclipse.swt.widgets.Control#isEnabled() */ @Override public boolean isEnabled() { return fEnabled; } private void notifyListeners(SelectionEvent e) { if (fSelectionListernersEnabled) { for (Object listener : fSelectionListeners.getListeners()) { ((SelectionListener) listener).widgetSelected(e); } } } /** * Remove a listener that will be notified when one of the widget's controls are selected * * @param listener * listener to remove */ public void removeSelectionListener(SelectionListener listener) { fSelectionListeners.remove(listener); } /** * Set the connection that should be selected in the widget. * * @param connection * connection to select * @throws CoreException */ public void setConnection(IRemoteConnection connection) { fSelectionListernersEnabled = false; if (fLocalButton != null && connection != null && connection.getConnectionType() == fRemoteServicesManager.getLocalConnectionType()) { fLocalButton.setSelection(true); handleButtonSelected(); } else { handleConnectionTypeSelected(connection); } handleConnectionSelected(); updateEnablement(); fSelectionListernersEnabled = true; } /** * Set the connection that should be selected in the widget. * * @param id * connection type id * @param name * connection name * @throws CoreException * @since 6.0 */ public void setConnection(String id, String name) { IRemoteConnectionType connectionType = fRemoteServicesManager.getConnectionType(id); if (connectionType != null) { IRemoteConnection connection = connectionType.getConnection(name); if (connection != null) { setConnection(connection); } } } /* * (non-Javadoc) * * @see org.eclipse.swt.widgets.Control#setEnabled(boolean) */ @Override public void setEnabled(boolean enabled) { fEnabled = enabled; updateEnablement(); } private void updateEnablement() { if (fDefaultConnectionType != null) { boolean isRemote = true; if (fLocalButton != null) { fLocalButton.setEnabled(fEnabled); fRemoteButton.setEnabled(fEnabled); isRemote = !fLocalButton.getSelection(); } fConnectionCombo.setEnabled(fEnabled && isRemote); fNewConnectionButton.setEnabled(fEnabled && isRemote && fDefaultConnectionType.canAdd()); } else { IRemoteConnectionType services = getSelectedConnectionType(); fConnectionCombo.setEnabled(fEnabled && services != null); fNewConnectionButton.setEnabled(fEnabled && services != null && services.canAdd()); if (fConnectionTypeCombo != null) { fConnectionTypeCombo.setEnabled(fEnabled); } } } } RemoteDirectoryWidget.java000066400000000000000000000211531272114001700367030ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/widgets/******************************************************************************* * Copyright (c) 2009 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Mike Kucera (IBM) - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.ui.widgets; import java.util.HashMap; import java.util.Map; import org.eclipse.core.runtime.ListenerList; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteFileService; import org.eclipse.remote.core.IRemoteProcessService; import org.eclipse.remote.internal.ui.messages.Messages; import org.eclipse.remote.ui.IRemoteUIConnectionService; import org.eclipse.remote.ui.IRemoteUIFileService; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; /** * Widget to allow the user to select a remote directory. Provides a "Browse" * button that uses the currently specified connection and a "Restore Default" * button to revert to the initial setting. * * If title is supplied then the widget will be placed in a group. * * The browse message can be modified using {@link #setBrowseMessage(String)} * */ public class RemoteDirectoryWidget extends Composite { private final Text text; private final Button browseButton; private final Button defaultButton; private final String fDefaultPath = null; private String fBrowseMessage = Messages.RemoteDirectoryWidget_0; private IRemoteConnection fRemoteConnection; private final ListenerList modifyListeners = new ListenerList(); private final Map previousSelections = new HashMap(); public RemoteDirectoryWidget(Composite parent, int style, String title, String defaultPath) { super(parent, style); GridLayout layout = new GridLayout(1, false); layout.marginHeight = 0; layout.marginWidth = 0; setLayout(layout); setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); Composite body = this; if (title != null) { Group group = new Group(this, SWT.NONE); group.setText(title); group.setLayout(new GridLayout(1, false)); group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); body = group; } Composite textComp = new Composite(body, SWT.NONE); textComp.setLayout(new GridLayout(2, false)); textComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); Label label = new Label(textComp, SWT.NONE); label.setText(Messages.RemoteDirectoryWidget_1); text = new Text(textComp, SWT.BORDER); GridData data = new GridData(SWT.FILL, SWT.FILL, true, false); text.setLayoutData(data); text.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { String path = text.getText(); setSavedPath(path); notifyListeners(e); } }); Composite buttonComp = new Composite(body, SWT.NONE); buttonComp.setLayout(new GridLayout(2, true)); GridData buttonCompData = new GridData(SWT.FILL, SWT.FILL, false, false); buttonCompData.horizontalAlignment = SWT.END; buttonComp.setLayoutData(buttonCompData); browseButton = new Button(buttonComp, SWT.NONE); browseButton.setText(Messages.RemoteDirectoryWidget_2); GridData browseButtonData = new GridData(SWT.BEGINNING, SWT.FILL, false, false); browseButtonData.widthHint = 110; browseButton.setLayoutData(browseButtonData); browseButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { browse(); } }); defaultButton = new Button(buttonComp, SWT.NONE); defaultButton.setText(Messages.RemoteDirectoryWidget_3); GridData defaultButtonData = new GridData(SWT.BEGINNING, SWT.FILL, false, false); defaultButtonData.widthHint = 110; defaultButton.setLayoutData(defaultButtonData); defaultButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { restoreDefault(fDefaultPath); } }); if (defaultPath != null) { text.setText(defaultPath); } updateBrowseButton(); } /** * Add a listener that will be notified when the directory path is modified. * * @param listener * listener to add */ public void addModifyListener(ModifyListener listener) { modifyListeners.add(listener); } /** * Get the directory location path. This path will be relative to the remote * machine. * * @return directory location path */ public String getLocationPath() { return text.getText(); } /** * Remove a listener that will be notified when the directory path is * modified. * * @param listener * listener to remove */ public void removeModifyListener(ModifyListener listener) { modifyListeners.remove(listener); } /** * Set the message that will be displayed in the remote directory browser * dialog. * * @param message * message to be displayed */ public void setBrowseMessage(String message) { fBrowseMessage = message; } /** * Set the remote connection to use for browsing for the remote directory. * * The connection type must provide the IRemoteUIConnectionService and IRemoteUIFileService services and the connection must * support the IRemoteFileService service. If any of these conditions are not met, this method will do nothing. * * @param conn * remote connection * @since 4.0 */ public void setConnection(IRemoteConnection conn) { if (conn == null) { throw new NullPointerException(); } if (conn.hasService(IRemoteFileService.class) && conn.getConnectionType().hasService(IRemoteUIConnectionService.class) && conn.getConnectionType().hasService(IRemoteUIFileService.class) && !conn.equals(fRemoteConnection)) { fRemoteConnection = conn; String path = getSavedPath(); restoreDefault(path); updateBrowseButton(); } } /** * Set the initial remote location that will be displayed in the widget. * * @param path */ public void setLocationPath(String path) { if (path != null && !path.equals(getLocationPath())) { text.setText(path); } } private void browse() { IRemoteUIConnectionService connMgr = getUIConnectionManager(); if (connMgr != null) { connMgr.openConnectionWithProgress(getShell(), null, fRemoteConnection); } if (fRemoteConnection.isOpen()) { IRemoteUIFileService fileMgr = getUIFileManager(); if (fileMgr != null) { fileMgr.setConnection(fRemoteConnection); String path = fileMgr.browseDirectory(getShell(), fBrowseMessage, "", 0); //$NON-NLS-1$ if (path != null) { setLocationPath(path); } } } } private String getSavedPath() { if (fRemoteConnection != null) { return previousSelections.get(fRemoteConnection.getConnectionType().getId() + "." + fRemoteConnection.getName()); //$NON-NLS-1$ } return null; } private IRemoteUIFileService getUIFileManager() { if (fRemoteConnection != null) { return fRemoteConnection.getConnectionType().getService(IRemoteUIFileService.class); } return null; } private IRemoteUIConnectionService getUIConnectionManager() { if (fRemoteConnection != null) { return fRemoteConnection.getConnectionType().getService(IRemoteUIConnectionService.class); } return null; } private void notifyListeners(ModifyEvent e) { for (Object listener : modifyListeners.getListeners()) { ((ModifyListener) listener).modifyText(e); } } private void restoreDefault(String path) { if (path == null && fRemoteConnection != null) { IRemoteProcessService processService = fRemoteConnection.getService(IRemoteProcessService.class); if (processService != null) { path = processService.getWorkingDirectory().toString(); } } if (path == null) { path = ""; //$NON-NLS-1$ } setLocationPath(path); // modify event listener updates map } private void setSavedPath(String path) { if (fRemoteConnection != null) { previousSelections.put(fRemoteConnection.getConnectionType().getId() + "." + fRemoteConnection.getName(), path); //$NON-NLS-1$ } } private void updateBrowseButton() { browseButton.setEnabled(getUIFileManager() != null); } } RemoteFileWidget.java000066400000000000000000000215531272114001700356220ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/widgets/******************************************************************************* * Copyright (c) 2009 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Mike Kucera (IBM) - Initial API and implementation *******************************************************************************/ package org.eclipse.remote.ui.widgets; import java.util.HashMap; import java.util.Map; import org.eclipse.core.runtime.ListenerList; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteFileService; import org.eclipse.remote.core.IRemoteProcessService; import org.eclipse.remote.internal.ui.messages.Messages; import org.eclipse.remote.ui.IRemoteUIConnectionService; import org.eclipse.remote.ui.IRemoteUIFileService; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; /** * Widget to allow the user to select a remote file. Provides a "Browse" * button that uses the currently specified connection and a "Restore Default" * button to revert to the initial setting. * * If GROUP_FLAG is set, then the widget will be placed in a group. * If RESTORE_BUTTON_FLAG is set, then a "Restore Default" button will be added * * If defaultPath is not null, then the initial path will be set to its value. * * The browse message can be modified using {@link #setBrowseMessage(String)} * */ public class RemoteFileWidget extends Composite { public static int GROUP_FLAG = 0x01; public static int RESTORE_BUTTON_FLAG = 0x02; private final Label fLabel; private final Text fText; private final Button fBrowseButton; private Button fDefaultButton; private String fDefaultPath; private String fBrowseMessage = Messages.RemoteFileWidget_Select_File; private IRemoteConnection fRemoteConnection; private final ListenerList fModifyListeners = new ListenerList(); private final Map fPreviousSelections = new HashMap(); public RemoteFileWidget(Composite parent, int style, int flags, String title, String defaultPath) { super(parent, style); GridLayout layout = new GridLayout(4, false); layout.marginHeight = 0; layout.marginWidth = 0; setLayout(layout); Composite body = this; if ((flags & GROUP_FLAG) != 0) { Group group = new Group(this, SWT.NONE); group.setText(title); group.setLayout(new GridLayout(1, false)); group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); body = group; } fLabel = new Label(body, SWT.NONE); fLabel.setText(Messages.RemoteFileWidget_File); fLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); fText = new Text(body, SWT.BORDER); fText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); fText.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { String path = fText.getText(); setSavedPath(path); notifyListeners(e); } }); fBrowseButton = new Button(body, SWT.NONE); fBrowseButton.setText(Messages.RemoteFileWidget_Browse); GridData browseButtonData = new GridData(SWT.LEFT, SWT.CENTER, false, false); browseButtonData.widthHint = 110; fBrowseButton.setLayoutData(browseButtonData); fBrowseButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { browse(); } }); if ((flags & RESTORE_BUTTON_FLAG) != 0) { fDefaultButton = new Button(body, SWT.NONE); fDefaultButton.setText(Messages.RemoteFileWidget_Restore_Default); GridData defaultButtonData = new GridData(SWT.LEFT, SWT.CENTER, false, false); defaultButtonData.widthHint = 110; fDefaultButton.setLayoutData(defaultButtonData); fDefaultButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { restoreDefault(fDefaultPath); } }); } if (defaultPath != null) { fDefaultPath = defaultPath; fText.setText(defaultPath); } updateBrowseButton(); } /** * Add a listener that will be notified when the file path is modified. * * @param listener * listener to add */ public void addModifyListener(ModifyListener listener) { fModifyListeners.add(listener); } private void browse() { IRemoteUIConnectionService connMgr = getUIConnectionManager(); if (connMgr != null) { connMgr.openConnectionWithProgress(getShell(), null, fRemoteConnection); } if (fRemoteConnection.isOpen()) { IRemoteUIFileService fileMgr = getUIFileManager(); if (fileMgr != null) { fileMgr.setConnection(fRemoteConnection); String path = fileMgr.browseFile(getShell(), fBrowseMessage, "", 0); //$NON-NLS-1$ if (path != null) { setLocationPath(path); } } } } /** * Get the file location path. This path will be relative to the remote * machine. * * @return file location path */ public String getLocationPath() { return fText.getText(); } private String getSavedPath() { if (fRemoteConnection != null) { return fPreviousSelections.get(fRemoteConnection.getConnectionType().getId() + "." + fRemoteConnection.getName()); //$NON-NLS-1$ } return null; } private IRemoteUIConnectionService getUIConnectionManager() { if (fRemoteConnection != null) { return fRemoteConnection.getConnectionType().getService(IRemoteUIConnectionService.class); } return null; } private IRemoteUIFileService getUIFileManager() { if (fRemoteConnection != null) { return fRemoteConnection.getConnectionType().getService(IRemoteUIFileService.class); } return null; } private void notifyListeners(ModifyEvent e) { for (Object listener : fModifyListeners.getListeners()) { ((ModifyListener) listener).modifyText(e); } } /** * Remove a listener that will be notified when the file path is * modified. * * @param listener * listener to remove */ public void removeModifyListener(ModifyListener listener) { fModifyListeners.remove(listener); } private void restoreDefault(String path) { if (path == null && fRemoteConnection != null) { IRemoteProcessService processService = fRemoteConnection.getService(IRemoteProcessService.class); if (processService != null) { path = processService.getWorkingDirectory().toString(); } } if (path == null) { path = ""; //$NON-NLS-1$ } setLocationPath(path); // modify event listener updates map } /** * Set the message that will be displayed in the remote file browser * dialog. * * @param message * message to be displayed */ public void setBrowseMessage(String message) { fBrowseMessage = message; } /** * Set the remote connection to use for browsing for the remote file. * * The connection type must provide the IRemoteUIConnectionService and IRemoteUIFileService services and the connection must * support the IRemoteFileService service. If any of these conditions are not met, this method will do nothing. * * @param conn * remote connection * @since 4.0 */ public void setConnection(IRemoteConnection conn) { if (conn == null) { throw new NullPointerException(); } if (conn.hasService(IRemoteFileService.class) && conn.getConnectionType().hasService(IRemoteUIConnectionService.class) && conn.getConnectionType().hasService(IRemoteUIFileService.class) && !conn.equals(fRemoteConnection)) { fRemoteConnection = conn; String path = getSavedPath(); restoreDefault(path); updateBrowseButton(); } } @Override public void setEnabled(boolean enabled) { if (!fText.isDisposed()) { fText.setEnabled(enabled); } if (!fBrowseButton.isDisposed()) { fBrowseButton.setEnabled(enabled); } } /** * Set the label to be displayed * * @param label */ public void setLabel(String label) { if (fLabel != null && !fLabel.isDisposed()) { fLabel.setText(label); } } /** * Set the initial remote location that will be displayed in the widget. * * @param path */ public void setLocationPath(String path) { if (path != null && !path.equals(getLocationPath())) { fText.setText(path); } } private void setSavedPath(String path) { if (fRemoteConnection != null) { fPreviousSelections.put(fRemoteConnection.getConnectionType().getId() + "." + fRemoteConnection.getName(), path); //$NON-NLS-1$ } } private void updateBrowseButton() { fBrowseButton.setEnabled(getUIFileManager() != null); } } RemoteResourceBrowserWidget.java000066400000000000000000000637721272114001700401070ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/widgets/******************************************************************************* * Copyright (c) 2008, 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM - Initial API and implementation * Martin Oberhuber - [468889] Support Eclipse older than Mars *******************************************************************************/ package org.eclipse.remote.ui.widgets; import java.lang.reflect.InvocationTargetException; import java.net.URI; import java.util.ArrayList; import java.util.List; import org.eclipse.core.filesystem.EFS; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.ListenerList; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.dialogs.IInputValidator; import org.eclipse.jface.dialogs.InputDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.DoubleClickEvent; import org.eclipse.jface.viewers.IDoubleClickListener; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TreePath; import org.eclipse.jface.viewers.TreeSelection; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteFileService; import org.eclipse.remote.core.IRemoteProcessService; import org.eclipse.remote.core.RemoteServicesUtils; import org.eclipse.remote.internal.ui.DeferredFileStore; import org.eclipse.remote.internal.ui.DeferredFileStoreComparer; import org.eclipse.remote.internal.ui.PendingUpdateAdapter; import org.eclipse.remote.internal.ui.RemoteContentProvider; import org.eclipse.remote.internal.ui.RemoteResourceComparator; import org.eclipse.remote.internal.ui.RemoteTreeViewer; import org.eclipse.remote.internal.ui.RemoteUIImages; import org.eclipse.remote.internal.ui.RemoteUIPlugin; import org.eclipse.remote.internal.ui.messages.Messages; import org.eclipse.remote.ui.IRemoteUIConnectionService; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.TraverseEvent; import org.eclipse.swt.events.TraverseListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.model.WorkbenchLabelProvider; import org.eclipse.ui.progress.UIJob; /** * Generic file/directory browser for remote resources. * * @author greg * */ public class RemoteResourceBrowserWidget extends Composite { /** * Delayed input dialog uses {@link ValidateJob} to create an InputDialog that only validates it's text field after an * appropriate timeout has occurred. This is to prevent excessive network traffic when checking the existence of a remote * directory on a target system. * * Due to the timing of the validation, it is possible to close the dialog prior to the validation completing. However since the * validation is only used to check for the existence of a remote file/directory, the worst that can happen is that the user * will not be notified that the directory already exists. * */ private class DelayedInputDialog extends InputDialog { public DelayedInputDialog(Shell parentShell, String dialogTitle, String dialogMessage, String initialValue, IInputValidator validator) { super(parentShell, dialogTitle, dialogMessage, initialValue, validator); } @Override protected void buttonPressed(int buttonId) { /* * Cancel the job as soon as the dialog is closed to avoid SWTException */ fValidateJob.cancel(); super.buttonPressed(buttonId); } protected void doValidate() { super.validateInput(); } @Override protected void validateInput() { fValidateJob.cancel(); if (!getText().getText().equals("")) { //$NON-NLS-1$ fValidateJob.schedule(VALIDATE_DELAY); } else { super.validateInput(); } } } /** * Validation job that will call the {@link DelayedInputDialog#doValidate()} method when run. The job should be scheduled with a * delay to limit the frequency of validation. */ private class ValidateJob extends UIJob { private DelayedInputDialog fDialog; public ValidateJob() { super(Messages.RemoteResourceBrowserWidget_0); setSystem(true); } @Override public IStatus runInUIThread(IProgressMonitor monitor) { fDialog.doValidate(); return Status.OK_STATUS; } public void setDialog(DelayedInputDialog dialog) { fDialog = dialog; } } private static final int VALIDATE_DELAY = 100; private final ValidateJob fValidateJob = new ValidateJob(); /** * Browse for files */ public static final int FILE_BROWSER = 0x01; /** * Browse for directories (files are not shown) */ public static final int DIRECTORY_BROWSER = 0x02; /** * Show local selection button */ public static final int SHOW_LOCAL_SELECTION = 0x04; /** * Display checkbox to show/hide hidden files */ public static final int SHOW_HIDDEN_CHECKBOX = 0x10; /** * Display button to create new folders */ public static final int SHOW_NEW_FOLDER_BUTTON = 0x20; /** * Display widget to select a connection */ public static final int SHOW_CONNECTIONS = 0x40; @SuppressWarnings("unused") private static final int minimumWidth = 200; private static final int heightHint = 300; private RemoteTreeViewer fTreeViewer; private Text fRemotePathText; private Button fUpButton; private Button fNewFolderButton; private Button fShowHiddenButton; private RemoteConnectionWidget fRemoteConnectionWidget; private String fDialogTitle; private String fDialogLabel; private boolean fShowHidden; private final List fResources = new ArrayList(); private String fResource; private String fInitialPath; private IPath fRootPath; private IRemoteFileService fFileMgr; private IRemoteConnection fConnection; private final ListenerList fSelectionListeners = new ListenerList(); private int fOptionFlags = FILE_BROWSER | SHOW_HIDDEN_CHECKBOX | SHOW_NEW_FOLDER_BUTTON; private IRunnableContext fRunnableContext; public RemoteResourceBrowserWidget(Composite parent, int style, int flags) { super(parent, style); setTitle(Messages.RemoteResourceBrowser_resourceTitle); if (flags != 0) { fOptionFlags = flags; } setType(); GridLayout layout = new GridLayout(1, false); layout.marginHeight = 0; layout.marginWidth = 0; setLayout(layout); final Composite mainComp = new Composite(this, SWT.NONE); mainComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); mainComp.setLayout(new GridLayout(1, false)); if ((fOptionFlags & SHOW_CONNECTIONS) != 0) { fRemoteConnectionWidget = new RemoteConnectionWidget(mainComp, SWT.NONE, "", //$NON-NLS-1$ (fOptionFlags & SHOW_LOCAL_SELECTION) == 0 ? RemoteConnectionWidget.FLAG_NO_LOCAL_SELECTION : 0); fRemoteConnectionWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); // Must happen before adding selection listener as this will trigger selection event fRemoteConnectionWidget.filterConnections(IRemoteFileService.class); fRemoteConnectionWidget.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { try { connectionSelected(); } catch (CoreException e) { RemoteUIPlugin.log(e.getStatus()); } updateEnablement(); notifySelectionChangedListeners(new SelectionChangedEvent(fTreeViewer, new ISelection() { @Override public boolean isEmpty() { return true; } })); } }); } Composite textComp = new Composite(mainComp, SWT.NONE); layout = new GridLayout(4, false); layout.marginHeight = 0; layout.marginWidth = 0; textComp.setLayout(layout); textComp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); Label label = new Label(textComp, SWT.NONE); label.setText(fDialogLabel); label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); fRemotePathText = new Text(textComp, SWT.BORDER | SWT.SINGLE); fRemotePathText.addTraverseListener(new TraverseListener() { @Override public void keyTraversed(TraverseEvent e) { if (e.detail == SWT.TRAVERSE_RETURN) { e.doit = false; } } }); fRemotePathText.addSelectionListener(new SelectionAdapter() { @Override public void widgetDefaultSelected(SelectionEvent e) { fRemotePathText.setSelection(fRemotePathText.getText().length()); setRoot(fRemotePathText.getText()); } }); fRemotePathText.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { fResource = fRemotePathText.getText().trim(); } }); GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false); // gd.minimumWidth = minimumWidth; fRemotePathText.setLayoutData(gd); fUpButton = new Button(textComp, SWT.PUSH | SWT.FLAT); fUpButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); fUpButton.setImage(RemoteUIImages.get(RemoteUIImages.IMG_ELCL_UP_NAV)); fUpButton.setToolTipText(Messages.RemoteResourceBrowser_UpOneLevel); fUpButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (!fRootPath.isRoot()) { setRoot(fRootPath.removeLastSegments(1).toString()); } } }); if ((fOptionFlags & SHOW_NEW_FOLDER_BUTTON) != 0) { // new folder: See Bug 396334 fNewFolderButton = new Button(textComp, SWT.PUSH | SWT.FLAT); fNewFolderButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); fNewFolderButton.setImage(RemoteUIImages.get(RemoteUIImages.IMG_ELCL_NEW_FOLDER)); fNewFolderButton.setToolTipText(Messages.RemoteResourceBrowser_NewFolder); fNewFolderButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { ISelection selection = fTreeViewer.getSelection(); if (!selection.isEmpty()) { if (selection instanceof TreeSelection) { TreePath[] treePaths = ((TreeSelection) selection).getPaths(); /* * There should only be one path */ if (treePaths.length > 0) { TreePath treePath = treePaths[0]; if (treePath.getLastSegment() instanceof DeferredFileStore) { DeferredFileStore element = ((DeferredFileStore) treePath.getLastSegment()); String path = toPath(element.getFileStore().toURI()); String newPath = createNewFolder(path); if (newPath != null) { fTreeViewer.expandToLevel(element, 1); fTreeViewer.refresh(element); Object[] children = element.getChildren(null); for (Object child : children) { if (child instanceof DeferredFileStore && newPath.equals(((DeferredFileStore) child).getFileStore().getName())) { fTreeViewer.deferSelection(new StructuredSelection(child)); } } } } } } } else { DeferredFileStore root = (DeferredFileStore) fTreeViewer.getInput(); String path = toPath(root.getFileStore().toURI()); String newPath = createNewFolder(path); if (newPath != null) { fTreeViewer.refresh(); fTreeViewer.getTree().setFocus(); Object[] children = root.getChildren(null); for (Object child : children) { if (child instanceof DeferredFileStore && newPath.equals(((DeferredFileStore) child).getFileStore().getName())) { fTreeViewer.deferSelection(new StructuredSelection(child)); } } } } } }); } else { gd = new GridData(SWT.LEFT, SWT.CENTER, false, false); gd.horizontalSpan = 2; fUpButton.setLayoutData(gd); } if ((style & SWT.MULTI) == SWT.MULTI) { fTreeViewer = new RemoteTreeViewer(mainComp, SWT.MULTI | SWT.BORDER); } else { fTreeViewer = new RemoteTreeViewer(mainComp, SWT.SINGLE | SWT.BORDER); } gd = new GridData(SWT.FILL, SWT.FILL, true, true); // see bug 158380 gd.heightHint = Math.max(parent.getSize().y, heightHint); fTreeViewer.getTree().setLayoutData(gd); fTreeViewer.setUseHashlookup(true); fTreeViewer.setComparer(new DeferredFileStoreComparer()); fTreeViewer.setComparator(new RemoteResourceComparator()); fTreeViewer.setContentProvider(new RemoteContentProvider()); fTreeViewer.setLabelProvider(new WorkbenchLabelProvider()); fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (!selection.isEmpty() && selection instanceof IStructuredSelection) { IStructuredSelection ss = (IStructuredSelection) selection; fResources.clear(); for (Object currentSelection : ss.toArray()) { if (currentSelection instanceof DeferredFileStore) { IFileStore store = ((DeferredFileStore) currentSelection).getFileStore(); fResources.add(store); } } if (fResources.size() > 0) { fRemotePathText.setText(toPath(fResources.get(0).toURI())); } updateEnablement(); notifySelectionChangedListeners(event); } } }); fTreeViewer.addDoubleClickListener(new IDoubleClickListener() { @Override public void doubleClick(DoubleClickEvent event) { IStructuredSelection s = (IStructuredSelection) event.getSelection(); Object o = s.getFirstElement(); if (fTreeViewer.isExpandable(o)) { fTreeViewer.setExpandedState(o, !fTreeViewer.getExpandedState(o)); } } }); /* * Only add filter if we are a directory browser. File and resource browsers show everything. */ int mask = FILE_BROWSER|DIRECTORY_BROWSER; if ((fOptionFlags & mask) != mask // Avoid filter on resource browsers. && (fOptionFlags & DIRECTORY_BROWSER) != 0) { fTreeViewer.addFilter(new ViewerFilter() { @Override public boolean select(Viewer viewer, Object parentElement, Object element) { if ((element instanceof DeferredFileStore)) { return ((DeferredFileStore) element).isContainer(); } return element instanceof PendingUpdateAdapter; } }); } if ((fOptionFlags & SHOW_HIDDEN_CHECKBOX) != 0) { fShowHiddenButton = new Button(mainComp, SWT.CHECK); fShowHiddenButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); fShowHiddenButton.setText(Messages.RemoteResourceBrowser_Show_hidden_files); fShowHiddenButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { fShowHidden = fShowHiddenButton.getSelection(); setRoot(fRootPath.toString()); } }); } updateEnablement(); } private String toPath(URI uri) { return getConnection().getService(IRemoteFileService.class).toPath(uri); } /** * Add a listener that will be notified when the selection is changed. * * @param listener * listener to add */ public void addSelectionChangedListener(ISelectionChangedListener listener) { fSelectionListeners.add(listener); } /** * Change the viewers input. Called when a new connection is selected. * * @param conn * new connection * @return true if input successfully changed */ private boolean changeInput(final IRemoteConnection conn) { if (conn == null) { setRoot(null); return true; } IRemoteUIConnectionService uiMgr = conn.getConnectionType().getService(IRemoteUIConnectionService.class); if (uiMgr != null) { uiMgr.openConnectionWithProgress(getShell(), getRunnableContext(), conn); } if (!conn.isOpen()) { return false; } fFileMgr = conn.getService(IRemoteFileService.class); if (fFileMgr != null) { /* * Note: the call to findInitialPath must happen before the * fTreeViewer input is set or the fTreeViewer fails. No idea why this * is. */ IRemoteProcessService processService = conn.getService(IRemoteProcessService.class); if (processService != null) { String cwd = processService.getWorkingDirectory(); IPath initial = findInitialPath(cwd, fInitialPath); // TODO: not platform independent - needs IRemotePath setRoot(initial.toString()); } fConnection = conn; return true; } return false; } /** * When a new connection is selected, make sure it is open before using it. * * @throws CoreException */ private void connectionSelected() throws CoreException { /* * Make sure the connection is open before we try and read from the * connection. */ final IRemoteConnection conn = fRemoteConnectionWidget.getConnection(); if (!changeInput(conn)) { /* * Reset combo back to the previous selection */ fRemoteConnectionWidget.setConnection(fConnection); } } /** * @return */ private String createNewFolder(final String parent) { final String[] name = new String[1]; name[0] = null; try { IRunnableWithProgress runnable = new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) { SubMonitor progress = SubMonitor.convert(monitor, 10); String baseName = "newfolder"; //$NON-NLS-1$ final IFileStore path = fConnection.getService(IRemoteFileService.class).getResource(parent); IFileStore child = path.getChild(baseName); int count = 1; try { while (!progress.isCanceled() && child.fetchInfo(EFS.NONE, progress.newChild(1)).exists()) { progress.setWorkRemaining(10); child = path.getChild(baseName + " (" + count++ + ")"); //$NON-NLS-1$//$NON-NLS-2$ } } catch (final CoreException e) { Display.getDefault().syncExec(new Runnable() { @Override public void run() { ErrorDialog.openError(getShell(), Messages.RemoteResourceBrowserWidget_New_Folder, Messages.RemoteResourceBrowserWidget_Unable_to_create_new_folder, e.getStatus()); } }); } final IFileStore basePath = child; final String[] userPath = new String[1]; Display.getDefault().syncExec(new Runnable() { @Override public void run() { DelayedInputDialog dialog = new DelayedInputDialog(getShell(), Messages.RemoteResourceBrowserWidget_1, Messages.RemoteResourceBrowserWidget_2, basePath.getName(), new IInputValidator() { @Override public String isValid(String newText) { if (!newText.equals("")) { //$NON-NLS-1$ IFileStore newPath = path.getChild(newText); if (newPath.fetchInfo().exists()) { return Messages.RemoteResourceBrowserWidget_3; } } else { return Messages.RemoteResourceBrowserWidget_4; } return null; } }); fValidateJob.setDialog(dialog); if (dialog.open() == Dialog.OK) { userPath[0] = dialog.getValue(); } } }); if (userPath[0] != null) { try { IFileStore newPath = path.getChild(userPath[0]); if (!progress.isCanceled()) { newPath.mkdir(EFS.SHALLOW, progress.newChild(10)); name[0] = newPath.getName(); } } catch (final CoreException e) { Display.getDefault().syncExec(new Runnable() { @Override public void run() { ErrorDialog.openError(getShell(), Messages.RemoteResourceBrowserWidget_New_Folder, Messages.RemoteResourceBrowserWidget_Unable_to_create_new_folder, e.getStatus()); } }); } } } }; getRunnableContext().run(true, true, runnable); } catch (InvocationTargetException e) { // Ignore, return null } catch (InterruptedException e) { // Ignore, return null } return name[0]; } /** * Determine the initial path for the browser. If the initial path is not * supplied or does not exist on the remote machine, then the initial path * will be the cwd. * * @param cwd * @param initialPath * @return initial path */ private IPath findInitialPath(String cwd, String initialPath) { if (initialPath != null) { IPath path = RemoteServicesUtils.posixPath(initialPath); if (!path.isAbsolute()) { path = RemoteServicesUtils.posixPath(cwd).append(path); } if (fFileMgr.getResource(path.toString()).fetchInfo().exists()) { return path; } } return RemoteServicesUtils.posixPath(cwd); } /** * Get the connection that was selected * * @return selected connection */ public IRemoteConnection getConnection() { return fConnection; } /** * Get a resource that corresponds to the text field * * @return resource corresponding to the text field * @since 1.1 */ public IFileStore getResource() { if (fResource != null) { if (!fResource.equals("") && getConnection() != null) { //$NON-NLS-1$ return getConnection().getService(IRemoteFileService.class).getResource(fResource); } } return null; } /** * Get the resources that were selected. * * @return selected resources */ public List getResources() { return fResources; } public IRunnableContext getRunnableContext() { if (fRunnableContext == null) { return new ProgressMonitorDialog(getShell()); } return fRunnableContext; } private void notifySelectionChangedListeners(SelectionChangedEvent e) { for (Object listener : fSelectionListeners.getListeners()) { ((ISelectionChangedListener) listener).selectionChanged(e); } } /** * Remove a listener that will be notified when the selection is changed * * @param listener * listener to remove */ public void removeSelectionChangedListener(ISelectionChangedListener listener) { fSelectionListeners.remove(listener); } /** * Set the connection for the browser. The connection must support the IRemoteFileService service or this method will have no * effect. * * @param connection * connection that supports the IRemoteFileService service */ public void setConnection(IRemoteConnection connection) { if (connection.hasService(IRemoteFileService.class)) { changeInput(connection); if (fRemoteConnectionWidget != null) { fRemoteConnectionWidget.setConnection(connection); } updateEnablement(); } } /** * Set the initial path to start browsing. This will be set in the browser * text field, and in a future version should expand the browser to this * location if it exists. * * NOTE: This must be called *before* {@link #setConnection(IRemoteConnection)} to have any effect. * * @param path */ public void setInitialPath(String path) { fInitialPath = path; updateEnablement(); } /** * Set the root directory for the browser. This will also update the text * field with the path. If the path is null, the browser will be set to the initial state. * * @param path * path of root directory or null */ private void setRoot(String path) { fResources.clear(); fRootPath = null; if (path == null) { fTreeViewer.setInput(null); } else if (fFileMgr != null) { IFileStore root = fFileMgr.getResource(path); fTreeViewer.setInput(new DeferredFileStore(root, !fShowHidden)); fRemotePathText.setText(path); fRemotePathText.setSelection(fRemotePathText.getText().length()); fResources.add(root); fRootPath = RemoteServicesUtils.posixPath(path); } } public void setRunnableContext(IRunnableContext context) { fRunnableContext = context; } /** * Set the fDialogTitle of the dialog. * * @param title */ public void setTitle(String title) { fDialogTitle = title; if (fDialogTitle == null) { fDialogTitle = ""; //$NON-NLS-1$ } Shell shell = getShell(); if ((shell != null) && !shell.isDisposed()) { shell.setText(fDialogTitle); } } /** * Set the type of browser. Can be either a file browser (allows selection * of files only) or a directory browser (allows selection of directories only), or * both files and directories. */ public void setType() { if ((fOptionFlags & DIRECTORY_BROWSER) == 0) { fDialogLabel = Messages.RemoteResourceBrowser_fileLabel; setTitle(Messages.RemoteResourceBrowser_fileTitle); } else if ((fOptionFlags & FILE_BROWSER) == 0) { fDialogLabel = Messages.RemoteResourceBrowser_directoryLabel; setTitle(Messages.RemoteResourceBrowser_directoryTitle); } else { fDialogLabel = Messages.RemoteResourceBrowser_resourceLabel; setTitle(Messages.RemoteResourceBrowser_resourceTitle); } } private void updateEnablement() { boolean upEnabled = false; boolean newFolderEnabled = false; boolean connectionOpen = fConnection != null && fConnection.isOpen(); if (connectionOpen) { if (fResources.size() == 1) { IFileStore store = fResources.get(0); /* * Assume that we have already called fetchInfo() on the file store, so this should * effectively be a noop. */ if (store.fetchInfo().isDirectory()) { newFolderEnabled = true; } if (store.getParent() != null) { upEnabled = true; } } } if (fUpButton != null) { fUpButton.setEnabled(upEnabled); } if (fNewFolderButton != null) { fNewFolderButton.setEnabled(newFolderEnabled); } if (fRemotePathText != null) { fRemotePathText.setEnabled(connectionOpen); } if (fTreeViewer != null) { fTreeViewer.getTree().setEnabled(connectionOpen); } if (fShowHiddenButton != null) { fShowHiddenButton.setEnabled(connectionOpen); } } } org.eclipse.remote-R2_1_0/features/000077500000000000000000000000001272114001700173135ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/features/org.eclipse.remote-feature/000077500000000000000000000000001272114001700244505ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/features/org.eclipse.remote-feature/.project000066400000000000000000000005751272114001700261260ustar00rootroot00000000000000 org.eclipse.remote-feature org.eclipse.pde.FeatureBuilder org.eclipse.pde.FeatureNature org.eclipse.remote-R2_1_0/features/org.eclipse.remote-feature/build.properties000066400000000000000000000002051272114001700276620ustar00rootroot00000000000000bin.includes = feature.xml,\ feature.properties,\ eclipse_update_120.jpg,\ epl-v10.html org.eclipse.remote-R2_1_0/features/org.eclipse.remote-feature/eclipse_update_120.jpg000066400000000000000000000522771272114001700305370ustar00rootroot00000000000000JFIFHHExifMM*bj(1r2iHHAdobe Photoshop CS Windows2005:06:17 09:55:47xx&(.kHHJFIFHH Adobe_CMAdobed            xx"?   3!1AQa"q2B#$Rb34rC%Scs5&DTdE£t6UeuF'Vfv7GWgw5!1AQaq"2B#R3$brCScs4%&5DTdEU6teuFVfv'7GWgw ?I!")Jh*AZRRʉi *d!I$JRI$I$$I)I!"U6PKtwpWOdؕpCfS%*^; vxmgEml>Klz DFWioZMԒqv 5'.'I4򠅖6yU?I| 2(e>s<;B]NI潡2:rI$S8m>#&fXC Lqi@#vJ:+P%q>[hk?IŽqoMWZ\Q7"ʡuQS6㪵}*R AIJK) qOw௬PF(K^HuJI)LJ_-ExKF)&ۺ^"ւ8gou@g>i?><#ɾE*12˿yڕ2R.P%Klz DFWioZMԒqv 5'.'I4򠅖6yU?I| 2(e>s<;B]NI潡2:rI$S8m>#&fXC Lqi@#vJ:+P%q>[hk?IŽqoMWZ\Q7"ʡuQS6㪵}*R AIJK) qOw௬PF(K^HuJI)LJ_-ExKF)&ۺ^"ւ8gou@g>i?><#ɾE*12˿yڕ2R.P% 1 120 120 1 72/1 72/1 2 2005-06-17T09:55:47-05:00 2005-06-17T09:55:47-05:00 2005-06-17T09:55:47-05:00 Adobe Photoshop CS Windows adobe:docid:photoshop:5dd9930e-df37-11d9-b295-daca1d068cfc image/jpeg XICC_PROFILE HLinomntrRGB XYZ  1acspMSFTIEC sRGB-HP cprtP3desclwtptbkptrXYZgXYZ,bXYZ@dmndTpdmddvuedLview$lumimeas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ QXYZ XYZ o8XYZ bXYZ $descIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view_. \XYZ L VPWmeassig CRT curv #(-27;@EJOTY^chmrw| %+28>ELRY`gnu| &/8AKT]gqz !-8COZfr~ -;HUcq~ +:IXgw'7HYj{+=Oat 2FZn  % : O d y  ' = T j " 9 Q i  * C \ u & @ Z t .Id %A^z &Ca~1Om&Ed#Cc'Ij4Vx&IlAe@e Ek*Qw;c*R{Gp@j>i  A l !!H!u!!!"'"U"""# #8#f###$$M$|$$% %8%h%%%&'&W&&&''I'z''( (?(q(())8)k))**5*h**++6+i++,,9,n,,- -A-v--..L.../$/Z///050l0011J1112*2c223 3F3334+4e4455M555676r667$7`7788P8899B999:6:t::;-;k;;<' >`>>?!?a??@#@d@@A)AjAAB0BrBBC:C}CDDGDDEEUEEF"FgFFG5G{GHHKHHIIcIIJ7J}JK KSKKL*LrLMMJMMN%NnNOOIOOP'PqPQQPQQR1R|RSS_SSTBTTU(UuUVV\VVWDWWX/X}XYYiYZZVZZ[E[[\5\\]']x]^^l^__a_``W``aOaabIbbcCccd@dde=eef=ffg=ggh?hhiCiijHjjkOkklWlmm`mnnknooxop+ppq:qqrKrss]sttptu(uuv>vvwVwxxnxy*yyzFz{{c{|!||}A}~~b~#G k͂0WGrׇ;iΉ3dʋ0cʍ1fΏ6n֑?zM _ɖ4 uL$h՛BdҞ@iءG&vVǥ8nRĩ7u\ЭD-u`ֲK³8%yhYѹJº;.! zpg_XQKFAǿ=ȼ:ɹ8ʷ6˶5̵5͵6ζ7ϸ9к<Ѿ?DINU\dlvۀ܊ݖޢ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o ">_}z6dE|ET^j \y!\nE462)|,D&K) gd O: .O5],%|N2ݻ-QXzeM<4c`FR5[ ǰ=nGEw[]Ք%Xzf?dģzpHUM\\N!'#[9p?ޭ;uZ7UgQzKeR噏*I7kצ P3Љ>?nMSo~CY2"Q%.w:D$G ;PUrǷđhmkI'ʜcSM *Qu0AARbTtmQRƱS¡c(<}v±Ơ*`:&zkI iDwөo}1f G$&?$_N[wTAV= FhS<%*7Lvs&:6כKc϶]Ml-cQM#K`)J kpDKS(*o~}:#I=Ei*H 1ֺԩZYH FG Qs Mz "3U'RO^:S2чozUz=El[Pܑ:C-DJM#K<^I\ܟtW.jz6Ѳta)-P)ҧ3?1o?۪h Wj}zY\vAb#Wi7?װDtaN:ǚ1St4پ?_zOul7G>K>.re}Ϸ>g&?SY{BDֹy\ڕON&}7;>"Ӣz>龽{խ8q_Ffb %n c IH" NI,I44JI'ɯL9ꀑé0y5eP?<=O!KR1hyZiZQ[ ty5SJQ>1]ԥ<. #6_?zV'G"駼'ϨrUoŏI.׷><>*VrzS{^׺org.eclipse.remote-R2_1_0/features/org.eclipse.remote-feature/epl-v10.html000066400000000000000000000402301272114001700265210ustar00rootroot00000000000000 Eclipse Public License - Version 1.0

Eclipse Public License - v 1.0

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.

1. DEFINITIONS

"Contribution" means:

a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
b) in the case of each subsequent Contributor:

i) changes to the Program, and

ii) additions to the Program;

where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.

"Contributor" means any person or entity that distributes the Program.

"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.

"Program" means the Contributions distributed in accordance with this Agreement.

"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.

2. GRANT OF RIGHTS

a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.

b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.

c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.

d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.

3. REQUIREMENTS

A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:

a) it complies with the terms and conditions of this Agreement; and

b) its license agreement:

i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;

ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;

iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and

iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.

When the Program is made available in source code form:

a) it must be made available under this Agreement; and

b) a copy of this Agreement must be included with each copy of the Program.

Contributors may not remove or alter any copyright notices contained within the Program.

Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.

4. COMMERCIAL DISTRIBUTION

Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.

For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.

5. NO WARRANTY

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.

6. DISCLAIMER OF LIABILITY

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

7. GENERAL

If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.

If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.

All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.

Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.

This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.

 

org.eclipse.remote-R2_1_0/features/org.eclipse.remote-feature/feature.properties000066400000000000000000000020251272114001700302200ustar00rootroot00000000000000################################################################################# # Copyright (c) 2013 IBM Corporation. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ################################################################################# # "featureName" property - name of the feature featureName=Remote Services # "providerName" property - name of the company that provides the feature providerName=Eclipse PTP # "description" property - description of the feature description=Provides an extensible remote services framework # copyright copyright=\ Copyright (c) 2013 IBM Corporation.\n\ All rights reserved. This program and the accompanying materials\n\ are made available under the terms of the Eclipse Public License v1.0\n\ which accompanies this distribution, and is available at\n\ http://www.eclipse.org/legal/epl-v10.html\n org.eclipse.remote-R2_1_0/features/org.eclipse.remote-feature/feature.xml000066400000000000000000000023311272114001700266240ustar00rootroot00000000000000 %description %copyright %license org.eclipse.remote-R2_1_0/features/org.eclipse.remote-feature/pom.xml000066400000000000000000000031171272114001700257670ustar00rootroot00000000000000 4.0.0 org.eclipse.remote remote-parent 2.1.0-SNAPSHOT ../../releng/org.eclipse.remote.build/pom.xml org.eclipse.tycho.extras tycho-source-feature-plugin source-feature package source-feature org.eclipse.tycho tycho-p2-plugin ${tycho-version} attached-p2-metadata package p2-metadata org.eclipse.remote eclipse-feature org.eclipse.remote-R2_1_0/features/org.eclipse.remote.console-feature/000077500000000000000000000000001272114001700261115ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/features/org.eclipse.remote.console-feature/.project000066400000000000000000000006051272114001700275610ustar00rootroot00000000000000 org.eclipse.remote.console-feature org.eclipse.pde.FeatureBuilder org.eclipse.pde.FeatureNature org.eclipse.remote-R2_1_0/features/org.eclipse.remote.console-feature/build.properties000066400000000000000000000002051272114001700313230ustar00rootroot00000000000000bin.includes = feature.xml,\ feature.properties,\ epl-v10.html,\ eclipse_update_120.jpg org.eclipse.remote-R2_1_0/features/org.eclipse.remote.console-feature/eclipse_update_120.jpg000066400000000000000000000522771272114001700322000ustar00rootroot00000000000000JFIFHHExifMM*bj(1r2iHHAdobe Photoshop CS Windows2005:06:17 09:55:47xx&(.kHHJFIFHH Adobe_CMAdobed            xx"?   3!1AQa"q2B#$Rb34rC%Scs5&DTdE£t6UeuF'Vfv7GWgw5!1AQaq"2B#R3$brCScs4%&5DTdEU6teuFVfv'7GWgw ?I!")Jh*AZRRʉi *d!I$JRI$I$$I)I!"U6PKtwpWOdؕpCfS%*^; vxmgEml>Klz DFWioZMԒqv 5'.'I4򠅖6yU?I| 2(e>s<;B]NI潡2:rI$S8m>#&fXC Lqi@#vJ:+P%q>[hk?IŽqoMWZ\Q7"ʡuQS6㪵}*R AIJK) qOw௬PF(K^HuJI)LJ_-ExKF)&ۺ^"ւ8gou@g>i?><#ɾE*12˿yڕ2R.P%Klz DFWioZMԒqv 5'.'I4򠅖6yU?I| 2(e>s<;B]NI潡2:rI$S8m>#&fXC Lqi@#vJ:+P%q>[hk?IŽqoMWZ\Q7"ʡuQS6㪵}*R AIJK) qOw௬PF(K^HuJI)LJ_-ExKF)&ۺ^"ւ8gou@g>i?><#ɾE*12˿yڕ2R.P% 1 120 120 1 72/1 72/1 2 2005-06-17T09:55:47-05:00 2005-06-17T09:55:47-05:00 2005-06-17T09:55:47-05:00 Adobe Photoshop CS Windows adobe:docid:photoshop:5dd9930e-df37-11d9-b295-daca1d068cfc image/jpeg XICC_PROFILE HLinomntrRGB XYZ  1acspMSFTIEC sRGB-HP cprtP3desclwtptbkptrXYZgXYZ,bXYZ@dmndTpdmddvuedLview$lumimeas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ QXYZ XYZ o8XYZ bXYZ $descIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view_. \XYZ L VPWmeassig CRT curv #(-27;@EJOTY^chmrw| %+28>ELRY`gnu| &/8AKT]gqz !-8COZfr~ -;HUcq~ +:IXgw'7HYj{+=Oat 2FZn  % : O d y  ' = T j " 9 Q i  * C \ u & @ Z t .Id %A^z &Ca~1Om&Ed#Cc'Ij4Vx&IlAe@e Ek*Qw;c*R{Gp@j>i  A l !!H!u!!!"'"U"""# #8#f###$$M$|$$% %8%h%%%&'&W&&&''I'z''( (?(q(())8)k))**5*h**++6+i++,,9,n,,- -A-v--..L.../$/Z///050l0011J1112*2c223 3F3334+4e4455M555676r667$7`7788P8899B999:6:t::;-;k;;<' >`>>?!?a??@#@d@@A)AjAAB0BrBBC:C}CDDGDDEEUEEF"FgFFG5G{GHHKHHIIcIIJ7J}JK KSKKL*LrLMMJMMN%NnNOOIOOP'PqPQQPQQR1R|RSS_SSTBTTU(UuUVV\VVWDWWX/X}XYYiYZZVZZ[E[[\5\\]']x]^^l^__a_``W``aOaabIbbcCccd@dde=eef=ffg=ggh?hhiCiijHjjkOkklWlmm`mnnknooxop+ppq:qqrKrss]sttptu(uuv>vvwVwxxnxy*yyzFz{{c{|!||}A}~~b~#G k͂0WGrׇ;iΉ3dʋ0cʍ1fΏ6n֑?zM _ɖ4 uL$h՛BdҞ@iءG&vVǥ8nRĩ7u\ЭD-u`ֲK³8%yhYѹJº;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ҩaŭǾdק wS`jx,G(K#\ !Bƃ = UvpRJ%sisQ!E $d\bۚV%guЧu)NOXUT}P!pQa h-2 9p,mo ">_}z6dE|ET^j \y!\nE462)|,D&K) gd O: .O5],%|N2ݻ-QXzeM<4c`FR5[ ǰ=nGEw[]Ք%Xzf?dģzpHUM\\N!'#[9p?ޭ;uZ7UgQzKeR噏*I7kצ P3Љ>?nMSo~CY2"Q%.w:D$G ;PUrǷđhmkI'ʜcSM *Qu0AARbTtmQRƱS¡c(<}v±Ơ*`:&zkI iDwөo}1f G$&?$_N[wTAV= FhS<%*7Lvs&:6כKc϶]Ml-cQM#K`)J kpDKS(*o~}:#I=Ei*H 1ֺԩZYH FG Qs Mz "3U'RO^:S2чozUz=El[Pܑ:C-DJM#K<^I\ܟtW.jz6Ѳta)-P)ҧ3?1o?۪h Wj}zY\vAb#Wi7?װDtaN:ǚ1St4پ?_zOul7G>K>.re}Ϸ>g&?SY{BDֹy\ڕON&}7;>"Ӣz>龽{խ8q_Ffb %n c IH" NI,I44JI'ɯL9ꀑé0y5eP?<=O!KR1hyZiZQ[ ty5SJQ>1]ԥ<. #6_?zV'G"駼'ϨrUoŏI.׷><>*VrzS{^׺org.eclipse.remote-R2_1_0/features/org.eclipse.remote.console-feature/epl-v10.html000066400000000000000000000402301272114001700301620ustar00rootroot00000000000000 Eclipse Public License - Version 1.0

Eclipse Public License - v 1.0

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.

1. DEFINITIONS

"Contribution" means:

a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
b) in the case of each subsequent Contributor:

i) changes to the Program, and

ii) additions to the Program;

where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.

"Contributor" means any person or entity that distributes the Program.

"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.

"Program" means the Contributions distributed in accordance with this Agreement.

"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.

2. GRANT OF RIGHTS

a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.

b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.

c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.

d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.

3. REQUIREMENTS

A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:

a) it complies with the terms and conditions of this Agreement; and

b) its license agreement:

i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;

ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;

iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and

iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.

When the Program is made available in source code form:

a) it must be made available under this Agreement; and

b) a copy of this Agreement must be included with each copy of the Program.

Contributors may not remove or alter any copyright notices contained within the Program.

Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.

4. COMMERCIAL DISTRIBUTION

Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.

For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.

5. NO WARRANTY

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.

6. DISCLAIMER OF LIABILITY

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

7. GENERAL

If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.

If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.

All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.

Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.

This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.

 

org.eclipse.remote-R2_1_0/features/org.eclipse.remote.console-feature/feature.properties000066400000000000000000000021021272114001700316550ustar00rootroot00000000000000################################################################################# # Copyright (c) 2015 QNX Software Systems Corporation. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ################################################################################# # "featureName" property - name of the feature featureName=Remote Command Shell Console # "providerName" property - name of the company that provides the feature providerName=Eclipse PTP # "description" property - description of the feature description=Provides serial port services for the remote framework # copyright copyright=\ Copyright (c) 2015 QNX Software Corporation.\n\ All rights reserved. This program and the accompanying materials\n\ are made available under the terms of the Eclipse Public License v1.0\n\ which accompanies this distribution, and is available at\n\ http://www.eclipse.org/legal/epl-v10.html\n org.eclipse.remote-R2_1_0/features/org.eclipse.remote.console-feature/feature.xml000066400000000000000000000011261272114001700302660ustar00rootroot00000000000000 %description %copyright %license org.eclipse.remote-R2_1_0/features/org.eclipse.remote.console-feature/pom.xml000066400000000000000000000027561272114001700274400ustar00rootroot00000000000000 4.0.0 org.eclipse.remote remote-parent 2.1.0-SNAPSHOT ../../releng/org.eclipse.remote.build/pom.xml org.eclipse.remote.features org.eclipse.remote.console eclipse-feature org.eclipse.tycho.extras tycho-source-feature-plugin source-feature package source-feature org.eclipse.tycho tycho-p2-plugin ${tycho-version} attached-p2-metadata package p2-metadata org.eclipse.remote-R2_1_0/features/org.eclipse.remote.serial-feature/000077500000000000000000000000001272114001700257265ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/features/org.eclipse.remote.serial-feature/.project000066400000000000000000000006041272114001700273750ustar00rootroot00000000000000 org.eclipse.remote.serial-feature org.eclipse.pde.FeatureBuilder org.eclipse.pde.FeatureNature org.eclipse.remote-R2_1_0/features/org.eclipse.remote.serial-feature/build.properties000066400000000000000000000002051272114001700311400ustar00rootroot00000000000000bin.includes = feature.xml,\ feature.properties,\ epl-v10.html,\ eclipse_update_120.jpg org.eclipse.remote-R2_1_0/features/org.eclipse.remote.serial-feature/eclipse_update_120.jpg000066400000000000000000000522771272114001700320150ustar00rootroot00000000000000JFIFHHExifMM*bj(1r2iHHAdobe Photoshop CS Windows2005:06:17 09:55:47xx&(.kHHJFIFHH Adobe_CMAdobed            xx"?   3!1AQa"q2B#$Rb34rC%Scs5&DTdE£t6UeuF'Vfv7GWgw5!1AQaq"2B#R3$brCScs4%&5DTdEU6teuFVfv'7GWgw ?I!")Jh*AZRRʉi *d!I$JRI$I$$I)I!"U6PKtwpWOdؕpCfS%*^; vxmgEml>Klz DFWioZMԒqv 5'.'I4򠅖6yU?I| 2(e>s<;B]NI潡2:rI$S8m>#&fXC Lqi@#vJ:+P%q>[hk?IŽqoMWZ\Q7"ʡuQS6㪵}*R AIJK) qOw௬PF(K^HuJI)LJ_-ExKF)&ۺ^"ւ8gou@g>i?><#ɾE*12˿yڕ2R.P%Klz DFWioZMԒqv 5'.'I4򠅖6yU?I| 2(e>s<;B]NI潡2:rI$S8m>#&fXC Lqi@#vJ:+P%q>[hk?IŽqoMWZ\Q7"ʡuQS6㪵}*R AIJK) qOw௬PF(K^HuJI)LJ_-ExKF)&ۺ^"ւ8gou@g>i?><#ɾE*12˿yڕ2R.P% 1 120 120 1 72/1 72/1 2 2005-06-17T09:55:47-05:00 2005-06-17T09:55:47-05:00 2005-06-17T09:55:47-05:00 Adobe Photoshop CS Windows adobe:docid:photoshop:5dd9930e-df37-11d9-b295-daca1d068cfc image/jpeg XICC_PROFILE HLinomntrRGB XYZ  1acspMSFTIEC sRGB-HP cprtP3desclwtptbkptrXYZgXYZ,bXYZ@dmndTpdmddvuedLview$lumimeas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ QXYZ XYZ o8XYZ bXYZ $descIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view_. \XYZ L VPWmeassig CRT curv #(-27;@EJOTY^chmrw| %+28>ELRY`gnu| &/8AKT]gqz !-8COZfr~ -;HUcq~ +:IXgw'7HYj{+=Oat 2FZn  % : O d y  ' = T j " 9 Q i  * C \ u & @ Z t .Id %A^z &Ca~1Om&Ed#Cc'Ij4Vx&IlAe@e Ek*Qw;c*R{Gp@j>i  A l !!H!u!!!"'"U"""# #8#f###$$M$|$$% %8%h%%%&'&W&&&''I'z''( (?(q(())8)k))**5*h**++6+i++,,9,n,,- -A-v--..L.../$/Z///050l0011J1112*2c223 3F3334+4e4455M555676r667$7`7788P8899B999:6:t::;-;k;;<' >`>>?!?a??@#@d@@A)AjAAB0BrBBC:C}CDDGDDEEUEEF"FgFFG5G{GHHKHHIIcIIJ7J}JK KSKKL*LrLMMJMMN%NnNOOIOOP'PqPQQPQQR1R|RSS_SSTBTTU(UuUVV\VVWDWWX/X}XYYiYZZVZZ[E[[\5\\]']x]^^l^__a_``W``aOaabIbbcCccd@dde=eef=ffg=ggh?hhiCiijHjjkOkklWlmm`mnnknooxop+ppq:qqrKrss]sttptu(uuv>vvwVwxxnxy*yyzFz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'm\,yH#uRqoׂ| *no~-Eiӂ2i^<JܟZˮ/0j$^j5#?'S5{Ztc :GϤc-$NY}/.\=?t^UvM嚧a^(LnE )7N$b(Ao&z?貯X&ndЪ:=ˠ}aIҩaŭǾdק wS`jx,G(K#\ !Bƃ = UvpRJ%sisQ!E $d\bۚV%guЧu)NOXUT}P!pQa h-2 9p,mo ">_}z6dE|ET^j \y!\nE462)|,D&K) gd O: .O5],%|N2ݻ-QXzeM<4c`FR5[ ǰ=nGEw[]Ք%Xzf?dģzpHUM\\N!'#[9p?ޭ;uZ7UgQzKeR噏*I7kצ P3Љ>?nMSo~CY2"Q%.w:D$G ;PUrǷđhmkI'ʜcSM *Qu0AARbTtmQRƱS¡c(<}v±Ơ*`:&zkI iDwөo}1f G$&?$_N[wTAV= FhS<%*7Lvs&:6כKc϶]Ml-cQM#K`)J kpDKS(*o~}:#I=Ei*H 1ֺԩZYH FG Qs Mz "3U'RO^:S2чozUz=El[Pܑ:C-DJM#K<^I\ܟtW.jz6Ѳta)-P)ҧ3?1o?۪h Wj}zY\vAb#Wi7?װDtaN:ǚ1St4پ?_zOul7G>K>.re}Ϸ>g&?SY{BDֹy\ڕON&}7;>"Ӣz>龽{խ8q_Ffb %n c IH" NI,I44JI'ɯL9ꀑé0y5eP?<=O!KR1hyZiZQ[ ty5SJQ>1]ԥ<. #6_?zV'G"駼'ϨrUoŏI.׷><>*VrzS{^׺org.eclipse.remote-R2_1_0/features/org.eclipse.remote.serial-feature/epl-v10.html000066400000000000000000000402301272114001700277770ustar00rootroot00000000000000 Eclipse Public License - Version 1.0

Eclipse Public License - v 1.0

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.

1. DEFINITIONS

"Contribution" means:

a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
b) in the case of each subsequent Contributor:

i) changes to the Program, and

ii) additions to the Program;

where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.

"Contributor" means any person or entity that distributes the Program.

"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.

"Program" means the Contributions distributed in accordance with this Agreement.

"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.

2. GRANT OF RIGHTS

a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.

b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.

c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.

d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.

3. REQUIREMENTS

A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:

a) it complies with the terms and conditions of this Agreement; and

b) its license agreement:

i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;

ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;

iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and

iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.

When the Program is made available in source code form:

a) it must be made available under this Agreement; and

b) a copy of this Agreement must be included with each copy of the Program.

Contributors may not remove or alter any copyright notices contained within the Program.

Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.

4. COMMERCIAL DISTRIBUTION

Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.

For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.

5. NO WARRANTY

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.

6. DISCLAIMER OF LIABILITY

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

7. GENERAL

If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.

If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.

All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.

Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.

This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.

 

org.eclipse.remote-R2_1_0/features/org.eclipse.remote.serial-feature/feature.properties000066400000000000000000000021011272114001700314710ustar00rootroot00000000000000################################################################################# # Copyright (c) 2015 QNX Software Systems Corporation. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ################################################################################# # "featureName" property - name of the feature featureName=Serial Port Remote Services # "providerName" property - name of the company that provides the feature providerName=Eclipse PTP # "description" property - description of the feature description=Provides serial port services for the remote framework # copyright copyright=\ Copyright (c) 2015 QNX Software Corporation.\n\ All rights reserved. This program and the accompanying materials\n\ are made available under the terms of the Eclipse Public License v1.0\n\ which accompanies this distribution, and is available at\n\ http://www.eclipse.org/legal/epl-v10.html\n org.eclipse.remote-R2_1_0/features/org.eclipse.remote.serial-feature/feature.xml000066400000000000000000000013701272114001700301040ustar00rootroot00000000000000 %description %copyright %license org.eclipse.remote-R2_1_0/features/org.eclipse.remote.serial-feature/pom.xml000066400000000000000000000027551272114001700272540ustar00rootroot00000000000000 4.0.0 org.eclipse.remote remote-parent 2.1.0-SNAPSHOT ../../releng/org.eclipse.remote.build/pom.xml org.eclipse.remote.features org.eclipse.remote.serial eclipse-feature org.eclipse.tycho.extras tycho-source-feature-plugin source-feature package source-feature org.eclipse.tycho tycho-p2-plugin ${tycho-version} attached-p2-metadata package p2-metadata org.eclipse.remote-R2_1_0/features/org.eclipse.remote.telnet-feature/000077500000000000000000000000001272114001700257425ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/features/org.eclipse.remote.telnet-feature/.project000066400000000000000000000006041272114001700274110ustar00rootroot00000000000000 org.eclipse.remote.telnet-feature org.eclipse.pde.FeatureBuilder org.eclipse.pde.FeatureNature org.eclipse.remote-R2_1_0/features/org.eclipse.remote.telnet-feature/build.properties000066400000000000000000000002051272114001700311540ustar00rootroot00000000000000bin.includes = feature.xml,\ feature.properties,\ epl-v10.html,\ eclipse_update_120.jpg org.eclipse.remote-R2_1_0/features/org.eclipse.remote.telnet-feature/eclipse_update_120.jpg000066400000000000000000000522771272114001700320310ustar00rootroot00000000000000JFIFHHExifMM*bj(1r2iHHAdobe Photoshop CS Windows2005:06:17 09:55:47xx&(.kHHJFIFHH Adobe_CMAdobed            xx"?   3!1AQa"q2B#$Rb34rC%Scs5&DTdE£t6UeuF'Vfv7GWgw5!1AQaq"2B#R3$brCScs4%&5DTdEU6teuFVfv'7GWgw ?I!")Jh*AZRRʉi *d!I$JRI$I$$I)I!"U6PKtwpWOdؕpCfS%*^; vxmgEml>Klz DFWioZMԒqv 5'.'I4򠅖6yU?I| 2(e>s<;B]NI潡2:rI$S8m>#&fXC Lqi@#vJ:+P%q>[hk?IŽqoMWZ\Q7"ʡuQS6㪵}*R AIJK) qOw௬PF(K^HuJI)LJ_-ExKF)&ۺ^"ւ8gou@g>i?><#ɾE*12˿yڕ2R.P%Klz DFWioZMԒqv 5'.'I4򠅖6yU?I| 2(e>s<;B]NI潡2:rI$S8m>#&fXC Lqi@#vJ:+P%q>[hk?IŽqoMWZ\Q7"ʡuQS6㪵}*R AIJK) qOw௬PF(K^HuJI)LJ_-ExKF)&ۺ^"ւ8gou@g>i?><#ɾE*12˿yڕ2R.P% 1 120 120 1 72/1 72/1 2 2005-06-17T09:55:47-05:00 2005-06-17T09:55:47-05:00 2005-06-17T09:55:47-05:00 Adobe Photoshop CS Windows adobe:docid:photoshop:5dd9930e-df37-11d9-b295-daca1d068cfc image/jpeg XICC_PROFILE HLinomntrRGB XYZ  1acspMSFTIEC sRGB-HP cprtP3desclwtptbkptrXYZgXYZ,bXYZ@dmndTpdmddvuedLview$lumimeas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ QXYZ XYZ o8XYZ bXYZ $descIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view_. \XYZ L VPWmeassig CRT curv #(-27;@EJOTY^chmrw| %+28>ELRY`gnu| &/8AKT]gqz !-8COZfr~ -;HUcq~ +:IXgw'7HYj{+=Oat 2FZn  % : O d y  ' = T j " 9 Q i  * C \ u & @ Z t .Id %A^z &Ca~1Om&Ed#Cc'Ij4Vx&IlAe@e Ek*Qw;c*R{Gp@j>i  A l !!H!u!!!"'"U"""# #8#f###$$M$|$$% %8%h%%%&'&W&&&''I'z''( (?(q(())8)k))**5*h**++6+i++,,9,n,,- -A-v--..L.../$/Z///050l0011J1112*2c223 3F3334+4e4455M555676r667$7`7788P8899B999:6:t::;-;k;;<' >`>>?!?a??@#@d@@A)AjAAB0BrBBC:C}CDDGDDEEUEEF"FgFFG5G{GHHKHHIIcIIJ7J}JK KSKKL*LrLMMJMMN%NnNOOIOOP'PqPQQPQQR1R|RSS_SSTBTTU(UuUVV\VVWDWWX/X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x;6˫&ˏ?˭_;i&m$ԓQV,ѴSE7n~~u/_[:^zoyx_kÏNǩȽw6Vr MՖAU?0z _сt&ѬMՎD4sJmH} xW\PQ3޾A )~Xdr4xɱK U;I  Z#pm@˨Qtra? k'm\,yH#uRqoׂ| *no~-Eiӂ2i^<JܟZˮ/0j$^j5#?'S5{Ztc :GϤc-$NY}/.\=?t^UvM嚧a^(LnE )7N$b(Ao&z?貯X&ndЪ:=ˠ}aIҩaŭǾdק wS`jx,G(K#\ !Bƃ = UvpRJ%sisQ!E $d\bۚV%guЧu)NOXUT}P!pQa h-2 9p,mo ">_}z6dE|ET^j \y!\nE462)|,D&K) gd O: .O5],%|N2ݻ-QXzeM<4c`FR5[ ǰ=nGEw[]Ք%Xzf?dģzpHUM\\N!'#[9p?ޭ;uZ7UgQzKeR噏*I7kצ P3Љ>?nMSo~CY2"Q%.w:D$G ;PUrǷđhmkI'ʜcSM *Qu0AARbTtmQRƱS¡c(<}v±Ơ*`:&zkI iDwөo}1f G$&?$_N[wTAV= FhS<%*7Lvs&:6כKc϶]Ml-cQM#K`)J kpDKS(*o~}:#I=Ei*H 1ֺԩZYH FG Qs Mz "3U'RO^:S2чozUz=El[Pܑ:C-DJM#K<^I\ܟtW.jz6Ѳta)-P)ҧ3?1o?۪h Wj}zY\vAb#Wi7?װDtaN:ǚ1St4پ?_zOul7G>K>.re}Ϸ>g&?SY{BDֹy\ڕON&}7;>"Ӣz>龽{խ8q_Ffb %n c IH" NI,I44JI'ɯL9ꀑé0y5eP?<=O!KR1hyZiZQ[ ty5SJQ>1]ԥ<. #6_?zV'G"駼'ϨrUoŏI.׷><>*VrzS{^׺org.eclipse.remote-R2_1_0/features/org.eclipse.remote.telnet-feature/epl-v10.html000066400000000000000000000402301272114001700300130ustar00rootroot00000000000000 Eclipse Public License - Version 1.0

Eclipse Public License - v 1.0

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.

1. DEFINITIONS

"Contribution" means:

a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
b) in the case of each subsequent Contributor:

i) changes to the Program, and

ii) additions to the Program;

where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.

"Contributor" means any person or entity that distributes the Program.

"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.

"Program" means the Contributions distributed in accordance with this Agreement.

"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.

2. GRANT OF RIGHTS

a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.

b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.

c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.

d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.

3. REQUIREMENTS

A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:

a) it complies with the terms and conditions of this Agreement; and

b) its license agreement:

i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;

ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;

iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and

iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.

When the Program is made available in source code form:

a) it must be made available under this Agreement; and

b) a copy of this Agreement must be included with each copy of the Program.

Contributors may not remove or alter any copyright notices contained within the Program.

Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.

4. COMMERCIAL DISTRIBUTION

Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.

For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.

5. NO WARRANTY

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.

6. DISCLAIMER OF LIABILITY

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

7. GENERAL

If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.

If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.

All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.

Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.

This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.

 

org.eclipse.remote-R2_1_0/features/org.eclipse.remote.telnet-feature/feature.properties000066400000000000000000000020351272114001700315130ustar00rootroot00000000000000################################################################################# # Copyright (c) 2015 IBM Corporation. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ################################################################################# # "featureName" property - name of the feature featureName=Telnet Remote Services # "providerName" property - name of the company that provides the feature providerName=Eclipse PTP # "description" property - description of the feature description=Provides telnet services for the remote framework # copyright copyright=\ Copyright (c) 2015 IBM Corporation.\n\ All rights reserved. This program and the accompanying materials\n\ are made available under the terms of the Eclipse Public License v1.0\n\ which accompanies this distribution, and is available at\n\ http://www.eclipse.org/legal/epl-v10.html\n org.eclipse.remote-R2_1_0/features/org.eclipse.remote.telnet-feature/feature.xml000066400000000000000000000013701272114001700301200ustar00rootroot00000000000000 %description %copyright %license org.eclipse.remote-R2_1_0/features/org.eclipse.remote.telnet-feature/pom.xml000066400000000000000000000027551272114001700272700ustar00rootroot00000000000000 4.0.0 org.eclipse.remote remote-parent 2.1.0-SNAPSHOT ../../releng/org.eclipse.remote.build/pom.xml org.eclipse.remote.features org.eclipse.remote.telnet eclipse-feature org.eclipse.tycho.extras tycho-source-feature-plugin source-feature package source-feature org.eclipse.tycho tycho-p2-plugin ${tycho-version} attached-p2-metadata package p2-metadata org.eclipse.remote-R2_1_0/releng/000077500000000000000000000000001272114001700167515ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/releng/org.eclipse.remote.build/000077500000000000000000000000001272114001700235535ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/releng/org.eclipse.remote.build/.project000066400000000000000000000003311272114001700252170ustar00rootroot00000000000000 org.eclipse.remote.build org.eclipse.remote-R2_1_0/releng/org.eclipse.remote.build/pom.xml000066400000000000000000000251011272114001700250670ustar00rootroot00000000000000 4.0.0 3.0 org.eclipse.remote remote-parent 2.1.0-SNAPSHOT pom Remote Parent nightly 0.24.0 ${tycho-version} scm:git:git://git.eclipse.org/gitroot/ptp/org.eclipse.remote.git 4.5 http://download.eclipse.org/eclipse/updates/${platform-version}/ http://download.eclipse.org/cbi/updates/license/ http://download.eclipse.org/tm/terminal/builds/development/nightly/ http://download.eclipse.org/tools/cdt/builds/master/nightly/ /home/data/httpd/download.eclipse.org/tools/ptp/builds/remote/${remote-release} Eclipse Public License v1.0 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.htm ../../releng/org.eclipse.remote.target ../../bundles/org.eclipse.remote.core ../../bundles/org.eclipse.remote.jsch.core ../../bundles/org.eclipse.remote.jsch.ui ../../bundles/org.eclipse.remote.ui ../../features/org.eclipse.remote-feature ../../releng/org.eclipse.remote.repo ../../bundles/org.eclipse.remote.console ../../features/org.eclipse.remote.console-feature ../../bundles/org.eclipse.remote.serial.core ../../bundles/org.eclipse.remote.serial.ui ../../features/org.eclipse.remote.serial-feature ../../bundles/org.eclipse.remote.telnet.core ../../bundles/org.eclipse.remote.telnet.ui ../../features/org.eclipse.remote.telnet-feature ../../bundles/org.eclipse.remote.doc.isv license ${license-site} p2 org.eclipse.tycho tycho-maven-plugin ${tycho-version} true org.eclipse.tycho target-platform-configuration ${tycho-version} p2 consider linux gtk x86 linux gtk x86_64 win32 win32 x86 win32 win32 x86_64 macosx cocoa x86_64 eclipse-plugin org.eclipse.ui.ide 0.0.0 org.eclipse.remote org.eclipse.remote.target 2.1.0-SNAPSHOT neon org.eclipse.tycho tycho-source-plugin ${tycho-version} plugin-source plugin-source org.eclipse.tycho.extras tycho-source-feature-plugin ${tycho-version} false source-feature package source-feature org.eclipse.tycho tycho-versions-plugin ${tycho-version} versions validate update-pom org.eclipse.tycho tycho-compiler-plugin ${tycho-version} UTF-8 org.eclipse.tycho tycho-source-plugin ${tycho-version} plugin-source plugin-source org.apache.maven.plugins maven-resources-plugin 2.6 ISO-8859-1 org.apache.maven.plugins maven-antrun-plugin 1.7 org.codehaus.mojo findbugs-maven-plugin 2.5.3 true false check org.apache.maven.plugins maven-pmd-plugin 3.0.1 utf-8 100 1.5 xml false cpd-check org.eclipse.tycho tycho-packaging-plugin ${tycho-version} true org.eclipse.tycho.extras tycho-sourceref-jgit ${tycho-extras-version} eclipse-sign m2e-cbi http://download.eclipse.org/technology/m2e/maven/ org.eclipse.tycho target-platform-configuration ${tycho-version} true org.eclipse.tycho.extras tycho-pack200a-plugin ${tycho-extras-version} pack200-normalize normalize org.eclipse.cbi.maven.plugins eclipse-jarsigner-plugin 1.0.1 sign sign org.eclipse.tycho.extras tycho-pack200b-plugin ${tycho-extras-version} pack200-pack pack org.eclipse.tycho tycho-p2-plugin ${tycho-version} p2-metadata p2-metadata package false org.eclipse.remote-R2_1_0/releng/org.eclipse.remote.build/update_versions000066400000000000000000000034521272114001700267140ustar00rootroot00000000000000#!/bin/sh # # script to update versions # # Usage: user_id version [branch] # # user_id - user id to use to clone repo # version - new version string (e.g. "5.0.1") # branch - alternate branch to use when updating versions # # Note: a "qualifier" suffix will automatically be added to the version where appropriate # # If version numbers are updated on a branch other than master, it is recommended to run # the command from the master branch: # # git merge -s ours origin/branch # # to mark the changes as merged. # BRANCH=master if [ $# -lt 3 ]; then echo "usage: update_versions user_id version [branch]" exit 1 fi user_id=$1 version=$2 if [ $# -gt 2 ]; then BRANCH=$3 fi if [ -d fix_versions ]; then echo "please remove fix_versions first" exit 1 fi mkdir fix_versions cd fix_versions git clone ssh://${user_id}@git.eclipse.org:29418/ptp/org.eclipse.remote.git (cd org.eclipse.remote && git checkout $BRANCH) update_feature() { sed -e "s/^\([ \t]*\)version=\"[0-9]\.[0-9]\.[0-9]\.qualifier\"/\1version=\"$2\.qualifier\"/" < $1/feature.xml > $1/feature.xml.tmp mv $1/feature.xml.tmp $1/feature.xml } update_manifest() { sed -e "s/^Bundle-Version: *[0-9]\.[0-9]\.[0-9]\.qualifier/Bundle-Version: $2.qualifier/" < $1/META-INF/MANIFEST.MF > $1/META-INF/MANIFEST.MF.tmp mv $1/META-INF/MANIFEST.MF.tmp $1/META-INF/MANIFEST.MF } for feature in org.eclipse.remote/features/*-feature; do echo "Updating $feature..." update_feature $feature $version done (cd org.eclipse.remote/releng/org.eclipse.remote.build && \ mvn versions:set -DnewVersion="${version}-SNAPSHOT" && \ mvn org.eclipse.tycho:tycho-versions-plugin:0.14.0:update-pom) find . -name pom.xml.versionsBackup -exec rm -f {} \; #(cd org.eclipse.remote && git commit -m "Update versions" && git push) # # Cleanup # #cd .. #rm -rf fix_versions exit 0 org.eclipse.remote-R2_1_0/releng/org.eclipse.remote.repo/000077500000000000000000000000001272114001700234215ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/releng/org.eclipse.remote.repo/.project000066400000000000000000000003301272114001700250640ustar00rootroot00000000000000 org.eclipse.remote.repo org.eclipse.remote-R2_1_0/releng/org.eclipse.remote.repo/category.xml000066400000000000000000000026461272114001700257700ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/releng/org.eclipse.remote.repo/pom.xml000066400000000000000000000033061272114001700247400ustar00rootroot00000000000000 4.0.0 org.eclipse.remote remote-parent 2.1.0-SNAPSHOT ../../releng/org.eclipse.remote.build/pom.xml org.eclipse.remote.repo eclipse-repository org.eclipse.tycho tycho-p2-publisher-plugin ${tycho-version} true production maven-antrun-plugin deploy install run org.eclipse.remote-R2_1_0/releng/org.eclipse.remote.target/000077500000000000000000000000001272114001700237425ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/releng/org.eclipse.remote.target/.project000066400000000000000000000003321272114001700254070ustar00rootroot00000000000000 org.eclipse.remote.target org.eclipse.remote-R2_1_0/releng/org.eclipse.remote.target/mars.target000066400000000000000000000025701272114001700261200ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/releng/org.eclipse.remote.target/neon.target000066400000000000000000000026021272114001700261110ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/releng/org.eclipse.remote.target/pom.xml000066400000000000000000000022521272114001700252600ustar00rootroot00000000000000 4.0.0 org.eclipse.remote remote-parent 2.1.0-SNAPSHOT ../org.eclipse.remote.build/pom.xml org.eclipse.remote.target pom org.codehaus.mojo build-helper-maven-plugin 1.9.1 attach-artifacts package attach-artifact neon.target target neon org.eclipse.remote-R2_1_0/tests/000077500000000000000000000000001272114001700166375ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/000077500000000000000000000000001272114001700244335ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/.classpath000066400000000000000000000005611272114001700264200ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/.gitignore000066400000000000000000000000051272114001700264160ustar00rootroot00000000000000/bin org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/.project000066400000000000000000000015241272114001700261040ustar00rootroot00000000000000 org.eclipse.remote.core.tests org.eclipse.jdt.core.javabuilder org.eclipse.pde.ManifestBuilder org.eclipse.pde.SchemaBuilder org.eclipse.pde.api.tools.apiAnalysisBuilder org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.pde.api.tools.apiAnalysisNature org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/.settings/000077500000000000000000000000001272114001700263515ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/.settings/org.eclipse.jdt.core.prefs000066400000000000000000000114711272114001700333370ustar00rootroot00000000000000eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning org.eclipse.jdt.core.compiler.problem.deprecation=warning org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=error org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore org.eclipse.jdt.core.compiler.problem.nullReference=warning org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled org.eclipse.jdt.core.compiler.problem.unusedImport=warning org.eclipse.jdt.core.compiler.problem.unusedLabel=warning org.eclipse.jdt.core.compiler.problem.unusedLocal=warning org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.source=1.6 org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/META-INF/000077500000000000000000000000001272114001700255735ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/META-INF/MANIFEST.MF000066400000000000000000000011471272114001700272300ustar00rootroot00000000000000Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.remote.core.tests;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-Vendor: %pluginProvider Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0", org.junit, com.jcraft.jsch;bundle-version="0.1.41", org.eclipse.core.filesystem;bundle-version="1.2.0", org.eclipse.remote.core;bundle-version="1.0.0", org.eclipse.remote.ui;bundle-version="1.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-Activator: org.eclipse.remote.core.tests.internal.Activator Bundle-ActivationPolicy: lazy org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/build.properties000066400000000000000000000001141272114001700276440ustar00rootroot00000000000000source.. = src/ output.. = bin/ bin.includes = META-INF/,\ . org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/plugin.properties000077500000000000000000000011051272114001700300470ustar00rootroot00000000000000############################################################################### # Copyright (c) 2009 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 available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # IBM Corporation - initial API and implementation ############################################################################### pluginName=Remote Core Tests pluginProvider=Eclipse PTP org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/src/000077500000000000000000000000001272114001700252225ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/src/org/000077500000000000000000000000001272114001700260115ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/src/org/eclipse/000077500000000000000000000000001272114001700274355ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/src/org/eclipse/remote/000077500000000000000000000000001272114001700307305ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/src/org/eclipse/remote/core/000077500000000000000000000000001272114001700316605ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/src/org/eclipse/remote/core/tests/000077500000000000000000000000001272114001700330225ustar00rootroot00000000000000internal/000077500000000000000000000000001272114001700345575ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/src/org/eclipse/remote/core/testsActivator.java000066400000000000000000000022561272114001700373630ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/src/org/eclipse/remote/core/tests/internal/******************************************************************************* * Copyright (c) 2015 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * QNX - initial API and implementation *******************************************************************************/ package org.eclipse.remote.core.tests.internal; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; public class Activator implements BundleActivator { private static BundleContext bundleContext; @Override public void start(BundleContext context) throws Exception { bundleContext = context; } @Override public void stop(BundleContext context) throws Exception { bundleContext = null; } public static T getService(Class service) { ServiceReference ref = bundleContext.getServiceReference(service); return ref != null ? bundleContext.getService(ref) : null; } } ServiceTests.java000066400000000000000000000047401272114001700400520ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.core.tests/src/org/eclipse/remote/core/tests/internalpackage org.eclipse.remote.core.tests.internal; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionHostService; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.core.exception.RemoteConnectionException; import junit.framework.TestCase; public class ServiceTests extends TestCase { private static final String USERNAME = "test"; //$NON-NLS-1$ private static final String PASSWORD = ""; //$NON-NLS-1$ private static final String HOST = "localhost"; //$NON-NLS-1$ private IRemoteConnectionType fConnectionType; private IRemoteConnection fRemoteConnection; public void testHostService() { IRemoteConnectionWorkingCopy wc = null; try { wc = fConnectionType.newConnection("test_connection");//$NON-NLS-1$ } catch (RemoteConnectionException e) { fail(e.getLocalizedMessage()); } IRemoteConnectionHostService hostService = wc.getService(IRemoteConnectionHostService.class); assertNotNull(hostService); String host = System.getenv("TEST_HOST"); if (host == null) { host = HOST; } hostService.setHostname(host); String username = System.getenv("TEST_USERNAME"); if (username == null) { username = USERNAME; } hostService.setUsername(username); String password = System.getenv("TEST_PASSWORD"); if (password == null) { password = PASSWORD; } hostService.setPassword(password); try { fRemoteConnection = wc.save(); } catch (RemoteConnectionException e) { fail(e.getLocalizedMessage()); } assertNotNull(fRemoteConnection); try { fRemoteConnection.open(new NullProgressMonitor()); } catch (RemoteConnectionException e) { fail(e.getLocalizedMessage()); } assertTrue(fRemoteConnection.isOpen()); hostService = fRemoteConnection.getService(IRemoteConnectionHostService.class); assertNotNull(hostService); assertEquals(hostService.getHostname(), host); assertEquals(hostService.getUsername(), username); } @Override protected void setUp() throws Exception { IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class); fConnectionType = manager.getConnectionType("org.eclipse.remote.JSch"); //$NON-NLS-1$ assertNotNull(fConnectionType); } @Override protected void tearDown() throws Exception { fConnectionType.removeConnection(fRemoteConnection); } } org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/000077500000000000000000000000001272114001700244325ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/.classpath000066400000000000000000000005611272114001700264170ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/.gitignore000066400000000000000000000000061272114001700264160ustar00rootroot00000000000000/bin/ org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/.project000066400000000000000000000012261272114001700261020ustar00rootroot00000000000000 org.eclipse.remote.jsch.tests org.eclipse.jdt.core.javabuilder org.eclipse.pde.ManifestBuilder org.eclipse.pde.SchemaBuilder org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/.settings/000077500000000000000000000000001272114001700263505ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/.settings/org.eclipse.jdt.core.prefs000066400000000000000000000005451272114001700333360ustar00rootroot00000000000000eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/META-INF/000077500000000000000000000000001272114001700255725ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/META-INF/MANIFEST.MF000066400000000000000000000007711272114001700272310ustar00rootroot00000000000000Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: JSch Remote Tests Bundle-SymbolicName: org.eclipse.remote.jsch.tests Bundle-Version: 1.0.0.qualifier Bundle-Activator: org.eclipse.remote.jsch.tests.Activator Bundle-Vendor: Eclipse PTP Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime;bundle-version="3.8.0", org.eclipse.core.filesystem, org.eclipse.remote.core, org.eclipse.remote.jsch.core, org.junit Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/build.properties000066400000000000000000000001141272114001700276430ustar00rootroot00000000000000source.. = src/ output.. = bin/ bin.includes = META-INF/,\ . org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/src/000077500000000000000000000000001272114001700252215ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/src/org/000077500000000000000000000000001272114001700260105ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/src/org/eclipse/000077500000000000000000000000001272114001700274345ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/src/org/eclipse/remote/000077500000000000000000000000001272114001700307275ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/src/org/eclipse/remote/jsch/000077500000000000000000000000001272114001700316565ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/src/org/eclipse/remote/jsch/tests/000077500000000000000000000000001272114001700330205ustar00rootroot00000000000000Activator.java000066400000000000000000000024021272114001700355360ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/src/org/eclipse/remote/jsch/testspackage org.eclipse.remote.jsch.tests; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; /** * The activator class controls the plug-in life cycle */ public class Activator extends AbstractUIPlugin { // The plug-in ID public static final String PLUGIN_ID = "org.eclipse.remote.jsch.tests"; //$NON-NLS-1$ // The shared instance private static Activator plugin; /** * The constructor */ public Activator() { } public void start(BundleContext context) throws Exception { super.start(context); plugin = this; } public void stop(BundleContext context) throws Exception { plugin = null; super.stop(context); } /** * Returns the shared instance * * @return the shared instance */ public static Activator getDefault() { return plugin; } /** * Return the OSGi service with the given service interface. * * @param service service interface * @return the specified service or null if it's not registered */ public static T getService(Class service) { BundleContext context = plugin.getBundle().getBundleContext(); ServiceReference ref = context.getServiceReference(service); return ref != null ? context.getService(ref) : null; } } ConnectionTests.java000066400000000000000000000123271272114001700367330ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/src/org/eclipse/remote/jsch/testspackage org.eclipse.remote.jsch.tests; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import junit.framework.TestCase; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.IRemoteFileService; import org.eclipse.remote.core.IRemoteProcess; import org.eclipse.remote.core.IRemoteProcessBuilder; import org.eclipse.remote.core.IRemoteProcessService; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.internal.jsch.core.JSchConnection; public class ConnectionTests extends TestCase { private static final String USERNAME = "test"; //$NON-NLS-1$ private static final String PASSWORD = ""; //$NON-NLS-1$ private static final String HOST = "localhost"; //$NON-NLS-1$ private IRemoteConnectionType fConnectionType; private IRemoteConnection fRemoteConnection; public void testEnv() { IRemoteProcessService processService = fRemoteConnection.getService(IRemoteProcessService.class); assertNotNull(processService); String var = processService.getEnv("SHELL"); //$NON-NLS-1$ assertNotNull(var); var = processService.getEnv("FOO_VAR_SHOULD_NOT_BE_DEFINED"); //$NON-NLS-1$ assertNull(var); assertNotNull(fRemoteConnection.getProperty("os.name")); //$NON-NLS-1$ assertNotNull(fRemoteConnection.getProperty("os.arch")); //$NON-NLS-1$ assertNotNull(fRemoteConnection.getProperty("os.version")); //$NON-NLS-1$ assertNotNull(fRemoteConnection.getProperty("file.separator")); //$NON-NLS-1$ assertNotNull(fRemoteConnection.getProperty("path.separator")); //$NON-NLS-1$ assertNotNull(fRemoteConnection.getProperty("line.separator")); //$NON-NLS-1$ IRemoteProcessBuilder builder = processService.getProcessBuilder("env"); //$NON-NLS-1$ assertNotNull(builder); builder.environment().put("FOO", "BAR"); //$NON-NLS-1$ //$NON-NLS-2$ builder.environment().put("USER", "FOO"); //$NON-NLS-1$ //$NON-NLS-2$ try { IRemoteProcess proc = builder.start(); BufferedReader stdout = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line; while ((line = stdout.readLine()) != null) { String[] kv = line.trim().split("="); //$NON-NLS-1$ if (kv.length == 2) { if (kv[0].equals("FOO")) { assertTrue(kv[1].equals("BAR")); //$NON-NLS-1$ //$NON-NLS-2$ } if (kv[0].equals("USER")) { assertTrue(kv[1].equals("FOO")); //$NON-NLS-1$ //$NON-NLS-2$ } } } } catch (IOException e) { fail(e.getMessage()); } } public void testWd() { IRemoteProcessService processService = fRemoteConnection.getService(IRemoteProcessService.class); assertNotNull(processService); /* * Test connection wd */ String oldWd = processService.getWorkingDirectory(); assertTrue(oldWd.startsWith("/")); String newWd = "/tmp"; processService.setWorkingDirectory(newWd); assertTrue(processService.getWorkingDirectory().equals(newWd)); /* * Test process builder inherits wd from connection */ IRemoteProcessBuilder builder = processService.getProcessBuilder("pwd"); //$NON-NLS-1$ assertNotNull(builder); try { IRemoteProcess proc = builder.start(); BufferedReader stdout = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line = stdout.readLine(); proc.destroy(); assertTrue(line != null && line.equals(newWd)); } catch (IOException e) { fail(e.getMessage()); } /* * Test process builder wd */ final IRemoteFileService fileManager = fRemoteConnection.getService(IRemoteFileService.class); assertNotNull(fileManager); builder = processService.getProcessBuilder("pwd"); //$NON-NLS-1$ assertNotNull(builder); builder.directory(fileManager.getResource("/bin")); try { IRemoteProcess proc = builder.start(); BufferedReader stdout = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line = stdout.readLine(); proc.destroy(); assertTrue(line != null && line.equals("/bin")); } catch (IOException e) { fail(e.getMessage()); } } @Override protected void setUp() throws Exception { IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class); fConnectionType = manager.getConnectionType("org.eclipse.remote.JSch"); //$NON-NLS-1$ assertNotNull(fConnectionType); IRemoteConnectionWorkingCopy wc = fConnectionType.newConnection("test_connection"); //$NON-NLS-1$ String host = System.getenv("TEST_HOST"); if (host == null) { host = HOST; } wc.setAttribute(JSchConnection.ADDRESS_ATTR, host); String username = System.getenv("TEST_USERNAME"); if (username == null) { username = USERNAME; } wc.setAttribute(JSchConnection.USERNAME_ATTR, username); String password = System.getenv("TEST_PASSWORD"); if (password == null) { password = PASSWORD; } wc.setSecureAttribute(JSchConnection.PASSWORD_ATTR, password); fRemoteConnection = wc.save(); assertNotNull(fRemoteConnection); fRemoteConnection.open(new NullProgressMonitor()); assertTrue(fRemoteConnection.isOpen()); } @Override protected void tearDown() throws Exception { fConnectionType.removeConnection(fRemoteConnection); } } FileStoreTests.java000066400000000000000000000203771272114001700365340ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/src/org/eclipse/remote/jsch/testspackage org.eclipse.remote.jsch.tests; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.net.URI; import org.eclipse.core.filesystem.EFS; import org.eclipse.core.filesystem.IFileInfo; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Path; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.IRemoteFileService; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.internal.jsch.core.JSchConnection; import junit.framework.TestCase; public class FileStoreTests extends TestCase { private static final String CONNECTION_NAME = "test_connection"; private static final String USERNAME = "test"; private static final String PASSWORD = ""; private static final String HOST = "localhost"; private static final String LOCAL_DIR = "/tmp/ptp_" + System.getProperty("user.name") + "/filestore_tests"; private static final String REMOTE_DIR = "/tmp/ptp_" + USERNAME + "/filestore_tests"; private static final String LOCAL_FILE = "local_file"; private static final String REMOTE_FILE = "remote_file"; private static final String REMOTE_FILE2 = "remote_file2"; private static final String TEST_STRING = "a string containing fairly *()(*&^$%## random text"; private static final String TEST_STRING2 = "a different string containing fairly *()(*&^$%## random text"; private IRemoteConnectionType fConnectionType; private IRemoteConnection fRemoteConnection; private IRemoteFileService fRemoteFileManager; private IFileStore fRemoteDir; private IFileStore fLocalDir; private void createFile(IFileStore fileStore, String contents) throws CoreException, IOException { OutputStream stream = fileStore.openOutputStream(EFS.NONE, new NullProgressMonitor()); assertNotNull(stream); BufferedWriter buf = new BufferedWriter(new OutputStreamWriter(stream)); buf.write(contents); buf.close(); } public void testStreams() { IFileStore remoteFileStore = fRemoteDir.getChild(REMOTE_FILE); for (int i = 0; i < 5; i++) { try { remoteFileStore.delete(EFS.NONE, null); } catch (CoreException e) { fail(e.getMessage()); } assertFalse(remoteFileStore.fetchInfo().exists()); try { createFile(remoteFileStore, TEST_STRING); } catch (Exception e) { fail(e.getMessage()); } assertTrue(remoteFileStore.fetchInfo().exists()); try { InputStream stream = remoteFileStore.openInputStream(EFS.NONE, null); assertNotNull(stream); BufferedReader buf = new BufferedReader(new InputStreamReader(stream)); String line = buf.readLine().trim(); assertTrue(line.equals(TEST_STRING)); buf.close(); } catch (Exception e) { fail(e.getMessage()); } } } public void testMultiStreams() { IFileStore remoteFileStore = fRemoteDir.getChild(REMOTE_FILE); IFileStore remoteFileStore2 = fRemoteDir.getChild(REMOTE_FILE2); try { createFile(remoteFileStore, TEST_STRING); createFile(remoteFileStore2, TEST_STRING2); } catch (Exception e) { fail(e.getMessage()); } assertTrue(remoteFileStore.fetchInfo().exists()); assertTrue(remoteFileStore2.fetchInfo().exists()); /* * Check how many streams we can open */ InputStream streams[] = new InputStream[100]; int streamCount = 0; for (; streamCount < streams.length; streamCount++) { try { streams[streamCount] = remoteFileStore.openInputStream(EFS.NONE, null); } catch (Exception e) { if (!e.getMessage().endsWith("channel is not opened.")) { fail(e.getMessage()); } break; } } for (int i = 0; i < streamCount; i++) { try { streams[i].close(); } catch (IOException e) { // No need to deal with this } } for (int i = 0; i < streamCount / 2; i++) { try { InputStream stream = remoteFileStore.openInputStream(EFS.NONE, null); assertNotNull(stream); BufferedReader buf = new BufferedReader(new InputStreamReader(stream)); String line = buf.readLine().trim(); assertTrue(line.equals(TEST_STRING)); InputStream stream2 = remoteFileStore2.openInputStream(EFS.NONE, null); assertNotNull(stream2); BufferedReader buf2 = new BufferedReader(new InputStreamReader(stream2)); String line2 = buf2.readLine().trim(); assertTrue(line2.equals(TEST_STRING2)); stream.close(); stream2.close(); } catch (Exception e) { fail(e.getMessage()); } } } public void testCopy() { final IFileStore localFileStore = fLocalDir.getChild(LOCAL_FILE); final IFileStore remoteFileStore = fRemoteDir.getChild(REMOTE_FILE); try { localFileStore.delete(EFS.NONE, new NullProgressMonitor()); remoteFileStore.delete(EFS.NONE, new NullProgressMonitor()); createFile(localFileStore, "foo\n"); localFileStore.copy(remoteFileStore, EFS.NONE, new NullProgressMonitor()); } catch (CoreException e) { fail(e.getMessage()); } catch (IOException e) { fail(e.getMessage()); } IFileInfo srcInfo = localFileStore.fetchInfo(); IFileInfo dstInfo = remoteFileStore.fetchInfo(); assertTrue(dstInfo.exists()); assertTrue(srcInfo.getLength() == dstInfo.getLength()); try { InputStream stream = remoteFileStore.openInputStream(EFS.NONE, new NullProgressMonitor()); byte[] b = new byte[4]; stream.read(b); stream.close(); assertTrue(b[0] == 'f'); assertTrue(b[1] == 'o'); assertTrue(b[2] == 'o'); assertTrue(b[3] == '\n'); } catch (CoreException e) { fail(e.getMessage()); } catch (IOException e) { fail(e.getMessage()); } } public void testExecutable() { IFileStore fs = fRemoteDir.getChild(REMOTE_FILE); try { fs.delete(EFS.NONE, new NullProgressMonitor()); createFile(fs, "contents"); } catch (Exception e) { fail(e.getMessage()); } IFileInfo fi = fs.fetchInfo(); boolean current = fi.getAttribute(EFS.ATTRIBUTE_EXECUTABLE); boolean expected = !current; fi.setAttribute(EFS.ATTRIBUTE_EXECUTABLE, expected); try { fs.putInfo(fi, EFS.SET_ATTRIBUTES, new NullProgressMonitor()); } catch (CoreException e) { fail(e.getMessage()); } fs = fRemoteDir.getChild(REMOTE_FILE); fi = fs.fetchInfo(); assertEquals(expected, fi.getAttribute(EFS.ATTRIBUTE_EXECUTABLE)); } /* * (non-Javadoc) * * @see junit.framework.TestCase#setUp() */ @Override protected void setUp() throws Exception { IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class); fConnectionType = manager.getConnectionType("org.eclipse.remote.JSch"); assertNotNull(fConnectionType); IRemoteConnectionWorkingCopy wc = fConnectionType.newConnection(CONNECTION_NAME); String host = System.getenv("TEST_HOST"); if (host == null) { host = HOST; } wc.setAttribute(JSchConnection.ADDRESS_ATTR, host); String username = System.getenv("TEST_USERNAME"); if (username == null) { username = USERNAME; } wc.setAttribute(JSchConnection.USERNAME_ATTR, username); String password = System.getenv("TEST_PASSWORD"); if (password == null) { password = PASSWORD; } wc.setSecureAttribute(JSchConnection.PASSWORD_ATTR, password); fRemoteConnection = wc.save(); assertNotNull(fRemoteConnection); fRemoteConnection.open(new NullProgressMonitor()); assertTrue(fRemoteConnection.isOpen()); fRemoteFileManager = fRemoteConnection.getService(IRemoteFileService.class); assertNotNull(fRemoteFileManager); URI remoteDirUri = fRemoteFileManager.toURI(REMOTE_DIR); URI localDirUri = fRemoteFileManager.toURI(LOCAL_DIR); assertNotNull(remoteDirUri); assertNotNull(localDirUri); fRemoteDir = EFS.getStore(fRemoteFileManager.toURI(REMOTE_DIR)); fLocalDir = EFS.getLocalFileSystem().getStore(new Path(LOCAL_DIR)); fRemoteDir.mkdir(EFS.NONE, null); fLocalDir.mkdir(EFS.NONE, null); } /* * (non-Javadoc) * * @see junit.framework.TestCase#tearDown() */ @Override protected void tearDown() throws Exception { fRemoteDir.delete(EFS.NONE, new NullProgressMonitor()); fLocalDir.delete(EFS.NONE, new NullProgressMonitor()); fConnectionType.removeConnection(fRemoteConnection); } } ProcessTests.java000066400000000000000000000162041272114001700362500ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/src/org/eclipse/remote/jsch/testspackage org.eclipse.remote.jsch.tests; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.Collections; import java.util.HashSet; import java.util.Set; import junit.framework.TestCase; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.IRemoteProcess; import org.eclipse.remote.core.IRemoteProcessBuilder; import org.eclipse.remote.core.IRemoteProcessService; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.core.RemoteProcessAdapter; import org.eclipse.remote.internal.jsch.core.JSchConnection; public class ProcessTests extends TestCase { private static final String USERNAME = "test"; //$NON-NLS-1$ private static final String PASSWORD = ""; //$NON-NLS-1$ private static final String HOST = "localhost"; //$NON-NLS-1$ private static int NUM_THREADS = 1; // Test currently fails for more than one thread private IRemoteConnectionType fConnectionType; private IRemoteConnection fRemoteConnection; public void testConcurrentProcess() { Thread[] threads = new Thread[NUM_THREADS]; for (int t = 0; t < NUM_THREADS; t++) { final String threadNum = Integer.toString(t); Thread thread = new Thread("test thread " + t) { @Override public void run() { final Set results = Collections.synchronizedSet(new HashSet()); IRemoteProcessService processService = fRemoteConnection.getService(IRemoteProcessService.class); assertNotNull(processService); IRemoteProcessBuilder builder = processService.getProcessBuilder("perl", "-v", threadNum); //$NON-NLS-1$ assertNotNull(builder); builder.redirectErrorStream(true); for (int i = 0; i < 10; i++) { try { IRemoteProcess proc = builder.start(); BufferedReader stdout = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line; while ((line = stdout.readLine()) != null) { results.add(line); results.add("\n"); } try { proc.waitFor(); } catch (InterruptedException e) { e.printStackTrace(); } assertTrue(results.toString().contains("Larry Wall")); } catch (IOException e) { e.printStackTrace(); fail(e.getLocalizedMessage()); } } } }; thread.start(); threads[t] = thread; } for (Thread t : threads) { try { t.join(); } catch (InterruptedException e) { } } } public void testEnv() { IRemoteProcessService processService = fRemoteConnection.getService(IRemoteProcessService.class); assertNotNull(processService); IRemoteProcessBuilder builder = processService.getProcessBuilder("printenv"); //$NON-NLS-1$ assertNotNull(builder); builder.redirectErrorStream(true); String path = builder.environment().get("PATH"); builder.environment().clear(); builder.environment().put("PATH", path); try { IRemoteProcess proc = builder.start(); BufferedReader stdout = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line; String result = null; while ((line = stdout.readLine()) != null) { assertNull(result); result = line; } assertEquals(result, "PATH=" + path); } catch (IOException e) { e.printStackTrace(); fail(e.getLocalizedMessage()); } } public void testEcho() { IRemoteProcessService processService = fRemoteConnection.getService(IRemoteProcessService.class); assertNotNull(processService); IRemoteProcessBuilder builder = processService.getProcessBuilder("cat"); //$NON-NLS-1$ assertNotNull(builder); builder.redirectErrorStream(true); final StringBuffer result = new StringBuffer(); try { final IRemoteProcess proc = builder.start(); Thread readerThread = new Thread("echo reader thread") { @Override public void run() { try { BufferedReader stdout = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line; while ((line = stdout.readLine()) != null) { result.append(line); } try { proc.waitFor(); } catch (InterruptedException e) { e.printStackTrace(); } } catch (IOException e) { e.printStackTrace(); fail(e.getLocalizedMessage()); } } }; Thread writerThread = new Thread("echo writer thread") { @Override public void run() { try { BufferedWriter stdin = new BufferedWriter(new OutputStreamWriter(proc.getOutputStream())); for (int i = 0; i < 10; i++) { String line = i + "\n"; stdin.append(line); stdin.flush(); } proc.getOutputStream().close(); try { proc.waitFor(); } catch (InterruptedException e) { e.printStackTrace(); } } catch (IOException e) { e.printStackTrace(); fail(e.getLocalizedMessage()); } } }; writerThread.start(); readerThread.start(); writerThread.join(); readerThread.join(); } catch (IOException e) { e.printStackTrace(); fail(e.getLocalizedMessage()); } catch (InterruptedException e) { e.printStackTrace(); fail(e.getLocalizedMessage()); } assertEquals("0123456789", result.toString()); } public void testExitValue() { IRemoteProcessService processService = fRemoteConnection.getService(IRemoteProcessService.class); assertNotNull(processService); IRemoteProcessBuilder builder = processService.getProcessBuilder(new String[]{"sleep","60"}); //$NON-NLS-1$ assertNotNull(builder); IRemoteProcess rp = null; try { rp = builder.start(); } catch (IOException e) { e.printStackTrace(); fail(e.getLocalizedMessage()); } assertNotNull(rp); Process p = new RemoteProcessAdapter(rp); try { p.exitValue(); fail("Process has not exited. Should throws an IllegalThreadStateException exception"); } catch(IllegalThreadStateException e) { e.printStackTrace(); } } @Override protected void setUp() throws Exception { IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class); fConnectionType = manager.getConnectionType("org.eclipse.remote.JSch"); //$NON-NLS-1$ assertNotNull(fConnectionType); IRemoteConnectionWorkingCopy wc = fConnectionType.newConnection("test_connection"); //$NON-NLS-1$ String host = System.getenv("TEST_HOST"); if (host == null) { host = HOST; } wc.setAttribute(JSchConnection.ADDRESS_ATTR, host); String username = System.getenv("TEST_USERNAME"); if (username == null) { username = USERNAME; } wc.setAttribute(JSchConnection.USERNAME_ATTR, username); String password = System.getenv("TEST_PASSWORD"); if (password == null) { password = PASSWORD; } wc.setSecureAttribute(JSchConnection.PASSWORD_ATTR, password); fRemoteConnection = wc.save(); assertNotNull(fRemoteConnection); fRemoteConnection.open(new NullProgressMonitor()); assertTrue(fRemoteConnection.isOpen()); } @Override protected void tearDown() throws Exception { fConnectionType.removeConnection(fRemoteConnection); } } RemoteCoreTestSuite.java000066400000000000000000000006131272114001700375220ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.jsch.tests/src/org/eclipse/remote/jsch/testspackage org.eclipse.remote.jsch.tests; import junit.framework.Test; import junit.framework.TestSuite; public class RemoteCoreTestSuite { public static Test suite() { TestSuite suite = new TestSuite(RemoteCoreTestSuite.class.getName()); suite.addTestSuite(ConnectionTests.class); suite.addTestSuite(FileStoreTests.class); suite.addTestSuite(ProcessTests.class); return suite; } } org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.telnet.core.tests/000077500000000000000000000000001272114001700257255ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.telnet.core.tests/META-INF/000077500000000000000000000000001272114001700270655ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.telnet.core.tests/META-INF/MANIFEST.MF000066400000000000000000000010131272114001700305120ustar00rootroot00000000000000Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Remote Telnet tests Bundle-SymbolicName: org.eclipse.remote.telnet.core.tests Bundle-Version: 1.0.0.qualifier Bundle-Activator: org.eclipse.remote.telnet.core.tests.Activator Bundle-Vendor: Eclipse PTP Require-Bundle: org.eclipse.core.runtime, org.eclipse.remote.telnet.core;bundle-version="1.0.0", org.junit;bundle-version="4.12.0", org.eclipse.remote.core;bundle-version="2.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.telnet.core.tests/build.properties000066400000000000000000000001141272114001700311360ustar00rootroot00000000000000source.. = src/ output.. = bin/ bin.includes = META-INF/,\ . org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.telnet.core.tests/src/000077500000000000000000000000001272114001700265145ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.telnet.core.tests/src/org/000077500000000000000000000000001272114001700273035ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.telnet.core.tests/src/org/eclipse/000077500000000000000000000000001272114001700307275ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.telnet.core.tests/src/org/eclipse/remote/000077500000000000000000000000001272114001700322225ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.telnet.core.tests/src/org/eclipse/remote/telnet/000077500000000000000000000000001272114001700335155ustar00rootroot00000000000000core/000077500000000000000000000000001272114001700343665ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.telnet.core.tests/src/org/eclipse/remote/telnettests/000077500000000000000000000000001272114001700355305ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.telnet.core.tests/src/org/eclipse/remote/telnet/coreActivator.java000066400000000000000000000027071272114001700403350ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.telnet.core.tests/src/org/eclipse/remote/telnet/core/tests/******************************************************************************* * Copyright (c) 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Wainer dos Santos Moschetta (IBM Corp.) - initial contribution *******************************************************************************/ package org.eclipse.remote.telnet.core.tests; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; public class Activator implements BundleActivator { private static BundleContext context; static BundleContext getContext() { return context; } /* * (non-Javadoc) * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) */ public void start(BundleContext bundleContext) throws Exception { Activator.context = bundleContext; } /* * (non-Javadoc) * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) */ public void stop(BundleContext bundleContext) throws Exception { Activator.context = null; } public static T getService(Class service) { ServiceReference ref = context.getServiceReference(service); return ref != null ? context.getService(ref) : null; } } TelnetConnectionTests.java000066400000000000000000000136451272114001700427020ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.telnet.core.tests/src/org/eclipse/remote/telnet/core/tests/******************************************************************************* * Copyright (c) 2015 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Wainer dos Santos Moschetta (IBM Corp.) - initial contribution *******************************************************************************/ package org.eclipse.remote.telnet.core.tests; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionHostService; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.IRemoteProcessBuilder; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.telnet.core.TelnetCommandShell; import org.eclipse.remote.telnet.core.TelnetConnection; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class TelnetConnectionTests { private static final String TELNET_CONN_TYPE_ID = "org.eclipse.remote.telnet.core.connectionType"; private static String hostname = "localhost"; private static String username = "test"; private static String password = ""; private static String TEST_CONN_NAME = "NewTelnetConnection"; private final String expected_connType_name = "Telnet"; private final int expected_telnet_default_port = 23; private final int expected_telnet_default_timeout = 0; private static TelnetConnection telnet; @BeforeClass public static void setup() { String host = System.getenv("TEST_HOSTNAME"); if(host != null) { hostname = host; } String user = System.getenv("TEST_USERNAME"); if(user != null) { username = user; } String passwd = System.getenv("TEST_PASSWORD"); if(user != null) { password = passwd; } IRemoteServicesManager services = Activator.getService(IRemoteServicesManager.class); IRemoteConnectionType connType = services.getConnectionType(TELNET_CONN_TYPE_ID); assertNotNull(connType); IRemoteConnectionWorkingCopy workingCopy = null; IRemoteConnection connection = null; try { workingCopy = connType.newConnection(TEST_CONN_NAME); assertNotNull(workingCopy); IRemoteConnectionHostService hostService = workingCopy.getService(IRemoteConnectionHostService.class); hostService.setHostname(hostname); connection = workingCopy.save(); assertNotNull(connection); } catch (RemoteConnectionException e) { fail("Failed to create a Telnet connection: " + e.getMessage()); } telnet = connection.getService(TelnetConnection.class); assertNotNull(telnet); } @Test public void testTelnetConnection() throws RemoteConnectionException { IRemoteConnectionType connType = telnet.getRemoteConnection().getConnectionType(); assertEquals("Connection type name", expected_connType_name, connType.getName()); assertEquals("Default Telnet over TCP port", expected_telnet_default_port, telnet.getPort()); assertEquals("Default connection timeout", expected_telnet_default_timeout, telnet.getTimeout()); telnet.open(new NullProgressMonitor()); assertTrue("Connection should be open", telnet.isOpen()); telnet.close(); assertTrue("Connection should be closed", !telnet.isOpen()); } @Test public void testTelnetCommandShell() { try { telnet.open(new NullProgressMonitor()); } catch (RemoteConnectionException e) { e.printStackTrace(); fail("Failed to open telnet connection"); } TelnetCommandShell commandShell = null; try { commandShell = (TelnetCommandShell) telnet.getCommandShell(IRemoteProcessBuilder.ALLOCATE_PTY); } catch (IOException e) { e.printStackTrace(); fail("Failed to get command shell"); } try { commandShell.connect(); } catch (RemoteConnectionException e) { e.printStackTrace(); fail("Unabled to connect with command shell"); } OutputStream os = commandShell.getOutputStream(); assertNotNull("Command shel output stream", os); InputStream is = commandShell.getInputStream(); assertNotNull("Command shel input stream"); if(!username.isEmpty() && !password.isEmpty()) { try { // Assume that a login prompt appears readPrompt(is); os.write((username + "\r\n").getBytes()); readPrompt(is); os.write((password + "\r\n").getBytes()); BufferedReader br = new BufferedReader(new InputStreamReader(is)); br.readLine(); } catch (IOException e) { e.printStackTrace(); fail("Failed to log in"); } } } @AfterClass public static void tearDown() { IRemoteServicesManager services = Activator.getService(IRemoteServicesManager.class); IRemoteConnectionType connType = services.getConnectionType(TELNET_CONN_TYPE_ID); try { connType.removeConnection(telnet.getRemoteConnection()); IRemoteConnection conn = connType.getConnection(TEST_CONN_NAME); assertTrue("Connection should had been deleted", conn == null); } catch (RemoteConnectionException e) { e.printStackTrace(); fail("Failed to delete the Telnet connection"); } } /* * Consume characters until prompt delimite ":" has been found. */ private void readPrompt(InputStream is) { int v; try { v = is.read(); while((v != -1) && (v != ':')) { v = is.read(); } } catch (IOException e) { e.printStackTrace(); fail("Failed to read prompt: " + e.getMessage()); } } } org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.ui.tests/000077500000000000000000000000001272114001700241205ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.ui.tests/.classpath000066400000000000000000000005611272114001700261050ustar00rootroot00000000000000 org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.ui.tests/.project000066400000000000000000000012241272114001700255660ustar00rootroot00000000000000 org.eclipse.remote.ui.tests org.eclipse.jdt.core.javabuilder org.eclipse.pde.ManifestBuilder org.eclipse.pde.SchemaBuilder org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.ui.tests/.settings/000077500000000000000000000000001272114001700260365ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.ui.tests/.settings/org.eclipse.jdt.core.prefs000066400000000000000000000005451272114001700330240ustar00rootroot00000000000000eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.ui.tests/META-INF/000077500000000000000000000000001272114001700252605ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.ui.tests/META-INF/MANIFEST.MF000066400000000000000000000006741272114001700267210ustar00rootroot00000000000000Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Remote UI Tests Bundle-SymbolicName: org.eclipse.remote.ui.tests Bundle-Version: 1.0.0.qualifier Fragment-Host: org.eclipse.remote.ui;bundle-version="2.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.junit;bundle-version="4.12.0", org.eclipse.remote.core, org.eclipse.ui.workbench, org.eclipse.swt, org.eclipse.core.filesystem Bundle-Vendor: Eclipse PTP org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.ui.tests/build.properties000066400000000000000000000001141272114001700273310ustar00rootroot00000000000000source.. = src/ output.. = bin/ bin.includes = META-INF/,\ . org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.ui.tests/src/000077500000000000000000000000001272114001700247075ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.ui.tests/src/org/000077500000000000000000000000001272114001700254765ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.ui.tests/src/org/eclipse/000077500000000000000000000000001272114001700271225ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.ui.tests/src/org/eclipse/remote/000077500000000000000000000000001272114001700304155ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.ui.tests/src/org/eclipse/remote/ui/000077500000000000000000000000001272114001700310325ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.ui.tests/src/org/eclipse/remote/ui/tests/000077500000000000000000000000001272114001700321745ustar00rootroot00000000000000RemoteResourceBrowserTest.java000066400000000000000000000147321272114001700401360ustar00rootroot00000000000000org.eclipse.remote-R2_1_0/tests/org.eclipse.remote.ui.tests/src/org/eclipse/remote/ui/tests/* * Copyright (c) 2016 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 available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package org.eclipse.remote.ui.tests; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.util.List; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnectionHostService; import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.IRemoteServicesManager; import org.eclipse.remote.core.exception.RemoteConnectionException; import org.eclipse.remote.internal.ui.RemoteUIPlugin; import org.eclipse.remote.ui.dialogs.RemoteResourceBrowser; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /* * Provides tests to several scenarios but they should be * executed manually (i.e. browse and click OK) */ @RunWith(JUnit4.class) public class RemoteResourceBrowserTest { private static final String USERNAME = "test"; //$NON-NLS-1$ private static final String PASSWORD = ""; //$NON-NLS-1$ private static final String HOST = "localhost"; //$NON-NLS-1$ private static IRemoteConnectionType fConnectionType; private static IRemoteConnection fRemoteConnection; private static Shell shell = null; private RemoteResourceBrowser browser; private IFileStore expectedResource; @BeforeClass public static void setUp() { IRemoteServicesManager manager = RemoteUIPlugin.getService(IRemoteServicesManager.class); fConnectionType = manager.getConnectionType("org.eclipse.remote.JSch"); //$NON-NLS-1$ assertNotNull(fConnectionType); IRemoteConnectionWorkingCopy wc = null; try { wc = fConnectionType.newConnection("test_connection");//$NON-NLS-1$ } catch (RemoteConnectionException e) { fail(e.getLocalizedMessage()); } IRemoteConnectionHostService hostService = wc.getService(IRemoteConnectionHostService.class); assertNotNull(hostService); String host = System.getenv("TEST_HOST"); if (host == null) { host = HOST; } hostService.setHostname(host); String username = System.getenv("TEST_USERNAME"); if (username == null) { username = USERNAME; } hostService.setUsername(username); String password = System.getenv("TEST_PASSWORD"); if (password == null) { password = PASSWORD; } hostService.setPassword(password); try { fRemoteConnection = wc.save(); } catch (RemoteConnectionException e) { fail(e.getLocalizedMessage()); } assertNotNull(fRemoteConnection); try { fRemoteConnection.open(new NullProgressMonitor()); } catch (RemoteConnectionException e) { fail(e.getLocalizedMessage()); } assertTrue(fRemoteConnection.isOpen()); shell = PlatformUI.getWorkbench().getDisplay().getActiveShell(); assertNotNull(shell); } @AfterClass public static void tearDown() throws RemoteConnectionException { fConnectionType.removeConnection(fRemoteConnection); } /* * Select any file. */ @Test public void browseFileTest() { browser = new RemoteResourceBrowser(shell, SWT.SINGLE); browser.setConnection(fRemoteConnection); browser.setType(RemoteResourceBrowser.FILE_BROWSER); browser.setTitle("Allows to select file only"); browser.open(); expectedResource = browser.getResource(); assertNotNull(expectedResource); assertTrue(!expectedResource.fetchInfo().isDirectory()); } /* * Select any directory. */ @Test public void browseDirectoryTest() { browser = new RemoteResourceBrowser(shell, SWT.SINGLE); browser.setConnection(fRemoteConnection); browser.setType(RemoteResourceBrowser.DIRECTORY_BROWSER); browser.setTitle("Allows to select directory only"); browser.open(); expectedResource = browser.getResource(); assertNotNull(expectedResource); assertTrue(expectedResource.fetchInfo().isDirectory()); } /* * Select either file or directory. */ @Test public void browseResourceTest() { browser = new RemoteResourceBrowser(shell, SWT.SINGLE); browser.setConnection(fRemoteConnection); browser.setTitle("Allows to select either file or directory"); browser.open(); expectedResource = browser.getResource(); assertNotNull(expectedResource); } /* * Select more than one resource. */ @Test public void browseResourcesTest() { browser = new RemoteResourceBrowser(shell, SWT.MULTI); browser.setConnection(fRemoteConnection); browser.setTitle("Allows to select either multiple resources"); browser.open(); List expectedResources = browser.getResources(); assertNotNull(expectedResources); assertTrue(expectedResources.size() > 0); } /* * Select to local connection and select a directory. */ @Test public void changeLocalConnectionTest() { browser = new RemoteResourceBrowser(shell, SWT.SINGLE); browser.setConnection(fRemoteConnection); browser.setTitle("Allows to switch to local browsing"); browser.setType(RemoteResourceBrowser.DIRECTORY_BROWSER); browser.showConnections(true); browser.showLocalSelection(true); browser.open(); expectedResource = browser.getResource(); assertNotNull(expectedResource); assertEquals(expectedResource.getFileSystem().getScheme(), "file"); } /* * Initial path set. */ @Test public void setInitialPathTest() { String initialPath = "/tmp"; browser = new RemoteResourceBrowser(shell, SWT.SINGLE); browser.setConnection(fRemoteConnection); browser.setTitle("Initial path set to " + initialPath); browser.setType(RemoteResourceBrowser.FILE_BROWSER); browser.setInitialPath(initialPath); browser.open(); } /* * Show connections. * Don't show hidden check box and new folder button. */ @Test public void changeDefaultSettingsTest() { browser = new RemoteResourceBrowser(shell, SWT.SINGLE); browser.setConnection(fRemoteConnection); browser.setType(RemoteResourceBrowser.FILE_BROWSER); browser.showConnections(true); browser.showHiddenCheckbox(false); browser.showNewFolderButton(false); browser.open(); } }

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.