Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2007-02-19 11:16:07 -0500
committerMichael Valenta2007-02-19 11:16:07 -0500
commite524b2735d1bfea544c30d87ef55e0e10b5c23e5 (patch)
tree2d0ebd198a1e4e107c9033530eba94bda8e970a5
parentec9e1a92c0ccb03f6da49ceba984c878366c5e77 (diff)
downloadeclipse.platform.team-e524b2735d1bfea544c30d87ef55e0e10b5c23e5.tar.gz
eclipse.platform.team-e524b2735d1bfea544c30d87ef55e0e10b5c23e5.tar.xz
eclipse.platform.team-e524b2735d1bfea544c30d87ef55e0e10b5c23e5.zip
Bug 170883 [SSH2] jsch connection preferences should be made public below "Internet" category
-rw-r--r--bundles/org.eclipse.jsch.core/.classpath7
-rw-r--r--bundles/org.eclipse.jsch.core/.cvsignore1
-rw-r--r--bundles/org.eclipse.jsch.core/.project28
-rw-r--r--bundles/org.eclipse.jsch.core/.settings/org.eclipse.jdt.core.prefs324
-rw-r--r--bundles/org.eclipse.jsch.core/.settings/org.eclipse.jdt.ui.prefs4
-rw-r--r--bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF15
-rw-r--r--bundles/org.eclipse.jsch.core/build.properties13
-rw-r--r--bundles/org.eclipse.jsch.core/plugin.properties14
-rw-r--r--bundles/org.eclipse.jsch.core/plugin.xml11
-rw-r--r--bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/core/JSchProvider.java84
-rw-r--r--bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/IConstants.java51
-rw-r--r--bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/JSchCorePlugin.java201
-rw-r--r--bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Messages.java31
-rw-r--r--bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Policy.java37
-rw-r--r--bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/PreferenceInitializer.java66
-rw-r--r--bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/ResponsiveSocketFactory.java130
-rw-r--r--bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Utils.java153
-rw-r--r--bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/messages.properties21
18 files changed, 1191 insertions, 0 deletions
diff --git a/bundles/org.eclipse.jsch.core/.classpath b/bundles/org.eclipse.jsch.core/.classpath
new file mode 100644
index 000000000..751c8f2e5
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.jsch.core/.cvsignore b/bundles/org.eclipse.jsch.core/.cvsignore
new file mode 100644
index 000000000..ba077a403
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/bundles/org.eclipse.jsch.core/.project b/bundles/org.eclipse.jsch.core/.project
new file mode 100644
index 000000000..a257846e7
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.jsch.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.jsch.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.jsch.core/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..65c853e17
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,324 @@
+#Mon Feb 19 11:13:13 EST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+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.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.autoboxing=error
+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=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
+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=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
+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.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+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=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=error
+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.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.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
+org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,NORMAL
+org.eclipse.jdt.core.compiler.taskTags=TODO,XXX
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false
+org.eclipse.jdt.core.formatter.comment.format_comments=false
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=2
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=80
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=2
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
diff --git a/bundles/org.eclipse.jsch.core/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.jsch.core/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..560471235
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,4 @@
+#Thu Dec 07 16:35:13 JST 2006
+eclipse.preferences.version=1
+formatter_profile=_eclipse-java-code-formatter-20060522
+formatter_settings_version=10
diff --git a/bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..60a6f01b5
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.jsch.core;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.eclipse.jsch.internal.core.JSchCorePlugin
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.3.0,4.0.0)",
+ com.jcraft.jsch;bundle-version="[0.1.28,1.0.0)",
+ org.eclipse.core.resources;bundle-version="[3.3.0,4.0.0)",
+ org.eclipse.net.core;bundle-version="[1.0.0,2.0.0)"
+Eclipse-LazyStart: true
+Export-Package: org.eclipse.jsch.core,
+ org.eclipse.jsch.internal.core
diff --git a/bundles/org.eclipse.jsch.core/build.properties b/bundles/org.eclipse.jsch.core/build.properties
new file mode 100644
index 000000000..27432d225
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/build.properties
@@ -0,0 +1,13 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties
+src.includes = .classpath,\
+ .project,\
+ META-INF/,\
+ build.properties,\
+ plugin.properties,\
+ plugin.xml,\
+ src/
diff --git a/bundles/org.eclipse.jsch.core/plugin.properties b/bundles/org.eclipse.jsch.core/plugin.properties
new file mode 100644
index 000000000..54e01ca23
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/plugin.properties
@@ -0,0 +1,14 @@
+###############################################################################
+# 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:
+# # Atsuhiko Yamanaka, JCraft,Inc. - initial API and implementation.
+# IBM Corporation - implementation
+###############################################################################
+providerName=Eclipse.org
+pluginName=JSch Core
+
diff --git a/bundles/org.eclipse.jsch.core/plugin.xml b/bundles/org.eclipse.jsch.core/plugin.xml
new file mode 100644
index 000000000..becb0f6d0
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/plugin.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.eclipse.jsch.internal.core.PreferenceInitializer">
+ </initializer>
+ </extension>
+
+</plugin>
diff --git a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/core/JSchProvider.java b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/core/JSchProvider.java
new file mode 100644
index 000000000..113c5fdb0
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/core/JSchProvider.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * 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.jsch.core;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jsch.internal.core.*;
+
+import com.jcraft.jsch.JSchException;
+import com.jcraft.jsch.Session;
+
+/**
+ * A static class whose purpose is to ensure that all the Jsch preferences are properly pushed into Jsch
+ * before a {@link Session} is created.
+ * @since 1.0
+ */
+public class JSchProvider {
+
+ /**
+ * Create a {@link Session} that can be used to make SSH2 connections. This method ensures that
+ * all preferences are properly propagated into JSch before creating the session and also
+ * ensures that the session uses the appropriate proxy settings.
+ * <p>
+ * Calling this method does not connect the session (see {@link #connect(Session, int, IProgressMonitor)}, if connection
+ * throws an exception, clients should check to see if the session is still connected (see {@link Session#isConnected()}.
+ * If it is, they should call {@link Session#disconnect()}.
+ *
+ * @param host the host name
+ * @param port the port or -1 if the default port is to be used
+ * @param username the user name or <code>null</code> if there is no user name or the user name is not known
+
+ * @return the created session
+ * @throws JSchException if errors occur
+ */
+ public static Session createSession(String host, int port, String username) throws JSchException {
+ if(port == -1)
+ port = IConstants.SSH_DEFAULT_PORT;
+
+ if(JSchCorePlugin.getPlugin().isNeedToLoadKnownHosts()){
+ JSchCorePlugin.getPlugin().loadKnownHosts();
+ }
+
+ if(JSchCorePlugin.getPlugin().isNeedToLoadKeys()){
+ JSchCorePlugin.getPlugin().loadPrivateKeys();
+ }
+
+ return Utils.createSession(JSchCorePlugin.getPlugin().getJSch(), username, host, port);
+ }
+
+ /**
+ * Connect the session using a responsive socket factory. The timeout value is used
+ * for socket creation only. Clients that desire a timeout on the session must
+ * call {@link Session#setTimeout(int)}. If session connection fails due to an exception,
+ * the session will be disconnected by this method.
+ *
+ * @param session the session to be connected
+ * @param timeout
+ * a timeout in milliseconds
+ * @param monitor
+ * a progress monitor or <code>null</code> if progress and
+ * cancelation is not desired
+ * @throws JSchException if an exception occurs connecting the session.
+ */
+ public static void connect(Session session, int timeout,
+ IProgressMonitor monitor) throws JSchException{
+ session.setSocketFactory(new ResponsiveSocketFactory(monitor, timeout));
+ try{
+ session.connect();
+ }
+ catch(JSchException e){
+ if(session.isConnected())
+ session.disconnect();
+ throw e;
+ }
+ }
+
+}
diff --git a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/IConstants.java b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/IConstants.java
new file mode 100644
index 000000000..19c9b2d78
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/IConstants.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 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.jsch.internal.core;
+
+/**
+ * Defines the constants used by the SSH2 Plugin
+ */
+public interface IConstants{
+
+ public static final String KEY_PROXY="CVSSSH2PreferencePage.PROXY"; //$NON-NLS-1$
+ public static final String KEY_PROXY_TYPE="CVSSSH2PreferencePage.PROXY_TYPE"; //$NON-NLS-1$
+ public static final String KEY_PROXY_HOST="CVSSSH2PreferencePage.PROXY_HOST"; //$NON-NLS-1$
+ public static final String KEY_PROXY_PORT="CVSSSH2PreferencePage.PROXY_PORT"; //$NON-NLS-1$
+ public static final String KEY_PROXY_AUTH="CVSSSH2PreferencePage.PROXY_AUTH"; //$NON-NLS-1$
+ public static final String KEY_PROXY_USER="CVSSSH2PreferencePage.PROXY_USER"; //$NON-NLS-1$
+ public static final String KEY_PROXY_PASS="CVSSSH2PreferencePage.PROXY_PASS"; //$NON-NLS-1$
+ public static final String KEY_OLD_SSH2HOME="CVSSSH2PreferencePage.SSH2HOME"; //$NON-NLS-1$
+ public static final String KEY_OLD_PRIVATEKEY="CVSSSH2PreferencePage.PRIVATEKEY"; //$NON-NLS-1$
+ public static final String KEY_KEYFILE="CVSSSH2PreferencePage.KEYFILE"; //$NON-NLS-1$
+
+ public static final String KEY_SSH2HOME="SSH2HOME"; //$NON-NLS-1$
+ public static final String KEY_PRIVATEKEY="PRIVATEKEY"; //$NON-NLS-1$
+
+ public static final String PROXY_TYPE_SOCKS5="SOCKS5"; //$NON-NLS-1$
+ public static final String PROXY_TYPE_HTTP="HTTP"; //$NON-NLS-1$
+ public static final String HTTP_DEFAULT_PORT="80"; //$NON-NLS-1$
+ public static final String SOCKS5_DEFAULT_PORT="1080"; //$NON-NLS-1$
+ public static final String PRIVATE_KEYS_DEFAULT="id_dsa,id_rsa"; //$NON-NLS-1$
+
+ public static final String DSA="DSA"; //$NON-NLS-1$
+ public static final String RSA="RSA"; //$NON-NLS-1$
+
+ public static final int SSH_DEFAULT_PORT=22;
+
+ public final String PREF_USE_PROXY="proxyEnabled"; //$NON-NLS-1$
+ public final String PREF_PROXY_TYPE="proxyType"; //$NON-NLS-1$
+ public final String PREF_PROXY_HOST="proxyHost"; //$NON-NLS-1$
+ public final String PREF_PROXY_PORT="proxyPort"; //$NON-NLS-1$
+ public final String PREF_PROXY_AUTH="proxyAuth"; //$NON-NLS-1$
+
+ public final String PREF_FIRST_STARTUP="pref_first_startup"; //$NON-NLS-1$
+
+}
diff --git a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/JSchCorePlugin.java b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/JSchCorePlugin.java
new file mode 100644
index 000000000..039d3f618
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/JSchCorePlugin.java
@@ -0,0 +1,201 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 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:
+ * Atsuhiko Yamanaka, JCraft,Inc. - initial API and implementation.
+ * IBM Corporation - ongoing maintenance
+ *******************************************************************************/
+package org.eclipse.jsch.internal.core;
+
+//import org.eclipse.core.runtime.Plugin;
+import java.util.Map;
+
+import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.preferences.*;
+import org.eclipse.osgi.util.NLS;
+
+import com.jcraft.jsch.JSch;
+import com.jcraft.jsch.JSchException;
+
+public class JSchCorePlugin extends Plugin{
+
+ public static String ID="org.eclipse.jsch.core"; //$NON-NLS-1$
+
+ // communication timeout with the server
+ public static final int DEFAULT_TIMEOUT=60;
+ private int communicationsTimeout=DEFAULT_TIMEOUT;
+ private boolean needToLoadKnownHosts=true;
+ private boolean needToLoadKeys=true;
+
+ private JSch jsch;
+
+ private String current_pkeys;
+
+ private static final String INFO_PROXY_USER="org.eclipse.team.cvs.core.proxy.user"; //$NON-NLS-1$
+ private static final String INFO_PROXY_PASS="org.eclipse.team.cvs.core.proxy.pass"; //$NON-NLS-1$
+
+ public static final String PT_AUTHENTICATOR="authenticator"; //$NON-NLS-1$
+
+ private static JSchCorePlugin plugin;
+
+ public JSchCorePlugin(){
+ plugin=this;
+ }
+
+ public static JSchCorePlugin getPlugin(){
+ return plugin;
+ }
+
+ /**
+ * Convenience method for logging CoreExceptions to the plugin log
+ * @param e the exception
+ */
+ public static void log(CoreException e){
+ log(e.getStatus().getSeverity(), e.getMessage(), e);
+ }
+
+ /**
+ * Log the given status. Do not use this method for the IStatus from a
+ * CoreException. Use<code>log(CoreException)</code> instead so the stack
+ * trace is not lost.
+ * @param status the status
+ */
+ public static void log(IStatus status){
+ getPlugin().getLog().log(status);
+ }
+
+ public static void log(int severity, String message, Throwable e){
+ log(new Status(severity, ID, 0, message, e));
+ }
+
+ // proxy configuration
+ boolean isUseProxy(){
+ IPreferencesService ps=Platform.getPreferencesService();
+ String value=ps.get(IConstants.PREF_USE_PROXY,
+ "false", getProxyPreferenceStore()); //$NON-NLS-1$
+ return value==null ? false : !value.equals("false"); //$NON-NLS-1$
+ }
+
+ String getProxyType(){
+ IPreferencesService ps=Platform.getPreferencesService();
+ return ps.get(IConstants.PREF_PROXY_TYPE, "", getProxyPreferenceStore()); //$NON-NLS-1$
+ }
+
+ String getProxyHost(){
+ IPreferencesService ps=Platform.getPreferencesService();
+ return ps.get(IConstants.PREF_PROXY_HOST, "", getProxyPreferenceStore()); //$NON-NLS-1$
+ }
+
+ String getProxyPort(){
+ IPreferencesService ps=Platform.getPreferencesService();
+ return ps.get(IConstants.PREF_PROXY_PORT, "", getProxyPreferenceStore()); //$NON-NLS-1$
+ }
+
+ boolean isUseProxyAuth(){
+ IPreferencesService ps=Platform.getPreferencesService();
+ String value=ps.get(IConstants.PREF_PROXY_AUTH,
+ "false", getProxyPreferenceStore()); //$NON-NLS-1$
+ return value==null ? false : !value.equals("false"); //$NON-NLS-1$
+ }
+
+ String getProxyUser(){
+ Object user=getAuthInfo().get(INFO_PROXY_USER);
+ return user==null ? "" : (String)user; //$NON-NLS-1$
+ }
+
+ private Map getAuthInfo(){
+ // XXX Auto-generated method stub
+ return null;
+ }
+
+ String getProxyPassword(){
+ Object pass=getAuthInfo().get(INFO_PROXY_PASS);
+ return pass==null ? "" : (String)pass; //$NON-NLS-1$
+ }
+
+ /**
+ * Get the communications timeout value in seconds
+ * @return the timeout value in seconds
+ */
+ public int getTimeout(){
+ return communicationsTimeout;
+ }
+
+ /**
+ * Set the timeout value for communications to a value in seconds. The value
+ * must be greater than or equal 0. If is it 0, there is no timeout.
+ * @param timeout the timeout value in seconds
+ */
+ public void setTimeout(int timeout){
+ this.communicationsTimeout=Math.max(0, timeout);
+ }
+
+ /**
+ * Return the preferences node in the instance scope
+ */
+ IEclipsePreferences getInstancePreferences(){
+ return new InstanceScope().getNode(ID);
+ }
+
+ private static IEclipsePreferences[] proxyPreferences;
+
+ static IEclipsePreferences[] getProxyPreferenceStore(){
+ if(proxyPreferences==null){
+ proxyPreferences=new IEclipsePreferences[] {
+ new InstanceScope().getNode("org.eclipse.team.cvs.ui"), //$NON-NLS-1$
+ new DefaultScope().getNode("org.eclipse.team.cvs.ui") //$NON-NLS-1$
+ };
+ }
+ return proxyPreferences;
+ }
+
+ public synchronized JSch getJSch(){
+ if(jsch==null)
+ jsch=new JSch();
+ return jsch;
+ }
+
+ public void loadKnownHosts(){
+ Preferences preferences=JSchCorePlugin.getPlugin().getPluginPreferences();
+ String ssh_home=preferences.getString(IConstants.KEY_SSH2HOME);
+
+ if(ssh_home.length()==0)
+ ssh_home=PreferenceInitializer.SSH_HOME_DEFAULT;
+
+ java.io.File file=new java.io.File(ssh_home, "known_hosts"); //$NON-NLS-1$
+ try{
+ getJSch().setKnownHosts(file.getPath());
+ }
+ catch(JSchException e){
+ JSchCorePlugin.log(IStatus.ERROR, NLS.bind(
+ "An error occurred while loading the know hosts file {0}", file //$NON-NLS-1$
+ .getAbsolutePath()), e);
+ }
+ needToLoadKnownHosts=false;
+ }
+
+ public boolean isNeedToLoadKnownHosts(){
+ return needToLoadKnownHosts;
+ }
+
+ public void setNeedToLoadKnownHosts(boolean needToLoadKnownHosts){
+ this.needToLoadKnownHosts=needToLoadKnownHosts;
+ }
+
+ public boolean isNeedToLoadKeys(){
+ return needToLoadKeys;
+ }
+
+ public void setNeedToLoadKeys(boolean needToLoadKeys){
+ this.needToLoadKeys=needToLoadKeys;
+ }
+
+ public void loadPrivateKeys(){
+ current_pkeys=Utils.loadPrivateKeys(getJSch(), current_pkeys);
+ setNeedToLoadKeys(false);
+ }
+}
diff --git a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Messages.java b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Messages.java
new file mode 100644
index 000000000..5433226d8
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Messages.java
@@ -0,0 +1,31 @@
+/**********************************************************************
+ * 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.jsch.internal.core;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS{
+ private static final String BUNDLE_NAME="org.eclipse.jsch.core.messages";//$NON-NLS-1$
+
+ public static String JSchSession_5;
+ public static String Util_timeout;
+ public static String JSchAuthenticationException_detail;
+ public static String JSchRepositoryLocation_locationForm;
+ public static String JSchRepositoryLocation_invalidFormat;
+ public static String KnownRepositories_0;
+ public static String JSchRepositoryLocation_73;
+ public static String JSchRepositoryLocation_74;
+ public static String JSchRepositoryLocation_75;
+
+ static{
+ // load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Policy.java b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Policy.java
new file mode 100644
index 000000000..ae2a4fb3d
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Policy.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 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.jsch.internal.core;
+
+import org.eclipse.core.runtime.*;
+
+public class Policy{
+
+ public static void checkCanceled(IProgressMonitor monitor){
+ if(monitor.isCanceled())
+ throw new OperationCanceledException();
+ }
+
+ public static IProgressMonitor monitorFor(IProgressMonitor monitor){
+ if(monitor==null)
+ return new NullProgressMonitor();
+ return monitor;
+ }
+
+ public static IProgressMonitor subMonitorFor(IProgressMonitor monitor,
+ int ticks){
+ if(monitor==null)
+ return new NullProgressMonitor();
+ if(monitor instanceof NullProgressMonitor)
+ return monitor;
+ return new SubProgressMonitor(monitor, ticks);
+ }
+
+}
diff --git a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/PreferenceInitializer.java b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/PreferenceInitializer.java
new file mode 100644
index 000000000..ef1620d7b
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/PreferenceInitializer.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 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:
+ * Atsuhiko Yamanaka, JCraft,Inc. - initial API and implementation.
+ * IBM Corporation - ongoing maintenance
+ *******************************************************************************/
+package org.eclipse.jsch.internal.core;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IPreferencesService;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+
+public class PreferenceInitializer extends AbstractPreferenceInitializer{
+
+ public static String SSH_HOME_DEFAULT=null;
+ static{
+ String ssh_dir_name=".ssh"; //$NON-NLS-1$
+
+ // Windows doesn't like files or directories starting with a dot.
+ if(Platform.getOS().equals(Platform.OS_WIN32)){
+ ssh_dir_name="ssh"; //$NON-NLS-1$
+ }
+ SSH_HOME_DEFAULT=System.getProperty("user.home"); //$NON-NLS-1$
+ if(SSH_HOME_DEFAULT!=null){
+ SSH_HOME_DEFAULT=SSH_HOME_DEFAULT+java.io.File.separator+ssh_dir_name;
+ }
+ }
+
+ private IEclipsePreferences[] getOldPreferences() {
+ return new IEclipsePreferences[]{
+ new InstanceScope().getNode("org.eclipse.team.cvs.ssh2"), //$NON-NLS-1$
+ new DefaultScope().getNode("org.eclipse.team.cvs.ssh2") //$NON-NLS-1$
+ };
+ }
+
+ public void initializeDefaultPreferences(){
+ Preferences preferences=JSchCorePlugin.getPlugin().getPluginPreferences();
+
+ preferences.setDefault(IConstants.KEY_SSH2HOME, SSH_HOME_DEFAULT);
+ preferences.setDefault(IConstants.KEY_PRIVATEKEY, IConstants.PRIVATE_KEYS_DEFAULT);
+
+ if(!preferences.contains(IConstants.PREF_FIRST_STARTUP)){
+
+ IEclipsePreferences[] oldPreferences=getOldPreferences();
+ IPreferencesService ps=Platform.getPreferencesService();
+ if(ps.get(IConstants.KEY_OLD_SSH2HOME, null, oldPreferences)!=null){
+ preferences.setValue(IConstants.KEY_SSH2HOME, ps.get(
+ IConstants.KEY_OLD_SSH2HOME, null, oldPreferences));
+ preferences.setValue(IConstants.KEY_PRIVATEKEY, ps.get(
+ IConstants.KEY_OLD_PRIVATEKEY, null, oldPreferences));
+ }
+ preferences.setValue(IConstants.PREF_FIRST_STARTUP, true);
+ JSchCorePlugin.getPlugin().savePluginPreferences();
+ }
+ }
+
+}
diff --git a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/ResponsiveSocketFactory.java b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/ResponsiveSocketFactory.java
new file mode 100644
index 000000000..2053c70d0
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/ResponsiveSocketFactory.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * 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.jsch.internal.core;
+
+import java.io.*;
+import java.net.Socket;
+import java.net.UnknownHostException;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.osgi.util.NLS;
+
+import com.jcraft.jsch.SocketFactory;
+
+public class ResponsiveSocketFactory implements SocketFactory {
+ private static final int DEFAULT_TIMEOUT=60; // Seconds
+ InputStream in = null;
+ OutputStream out = null;
+ private IProgressMonitor monitor;
+ private final int timeout;
+ public ResponsiveSocketFactory(IProgressMonitor monitor, int timeout) {
+ if (monitor == null)
+ monitor = new NullProgressMonitor();
+ this.monitor = monitor;
+ this.timeout=timeout;
+ }
+ public InputStream getInputStream(Socket socket) throws IOException {
+ if (in == null)
+ in = socket.getInputStream();
+ return in;
+ }
+ public OutputStream getOutputStream(Socket socket) throws IOException {
+ if (out == null)
+ out = socket.getOutputStream();
+ return out;
+ }
+ public Socket createSocket(String host, int port) throws IOException, UnknownHostException {
+ Socket socket = null;
+ socket = createSocket(host, port, timeout / 1000, monitor);
+ // Null out the monitor so we don't hold onto anything
+ // (i.e. the SSH2 session will keep a handle to the socket factory around
+ monitor = new NullProgressMonitor();
+ // Set the socket timeout
+ socket.setSoTimeout(timeout);
+ return socket;
+ }
+
+ /**
+ * Helper method that will time out when making a socket connection.
+ * This is required because there is no way to provide a timeout value
+ * when creating a socket and in some instances, they don't seem to
+ * timeout at all.
+ */
+ private Socket createSocket(final String host, final int port, int timeout, IProgressMonitor monitor) throws UnknownHostException, IOException {
+
+ // Start a thread to open a socket
+ final Socket[] socket = new Socket[] { null };
+ final Exception[] exception = new Exception[] {null };
+ final Thread thread = new Thread(new Runnable() {
+ public void run() {
+ try {
+ Socket newSocket = new Socket(host, port);
+ synchronized (socket) {
+ if (Thread.interrupted()) {
+ // we we're either canceled or timed out so just close the socket
+ newSocket.close();
+ } else {
+ socket[0] = newSocket;
+ }
+ }
+ } catch (UnknownHostException e) {
+ exception[0] = e;
+ } catch (IOException e) {
+ exception[0] = e;
+ }
+ }
+ });
+ thread.start();
+
+ // Wait the appropriate number of seconds
+ if (timeout == 0) timeout = DEFAULT_TIMEOUT;
+ for (int i = 0; i < timeout; i++) {
+ try {
+ // wait for the thread to complete or 1 second, which ever comes first
+ thread.join(1000);
+ } catch (InterruptedException e) {
+ // I think this means the thread was interrupted but not necessarily timed out
+ // so we don't need to do anything
+ }
+ synchronized (socket) {
+ // if the user canceled, clean up before preempting the operation
+ if (monitor.isCanceled()) {
+ if (thread.isAlive()) {
+ thread.interrupt();
+ }
+ if (socket[0] != null) {
+ socket[0].close();
+ }
+ // this method will throw the proper exception
+ Policy.checkCanceled(monitor);
+ }
+ }
+ }
+ // If the thread is still running (i.e. we timed out) signal that it is too late
+ synchronized (socket) {
+ if (thread.isAlive()) {
+ thread.interrupt();
+ }
+ }
+ if (exception[0] != null) {
+ if (exception[0] instanceof UnknownHostException)
+ throw (UnknownHostException)exception[0];
+ else
+ throw (IOException)exception[0];
+ }
+ if (socket[0] == null) {
+ throw new InterruptedIOException(NLS.bind(Messages.Util_timeout, new String[] { host }));
+ }
+ return socket[0];
+ }
+
+}
diff --git a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Utils.java b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Utils.java
new file mode 100644
index 000000000..dc34a0775
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Utils.java
@@ -0,0 +1,153 @@
+/*******************************************************************************
+ * 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.jsch.internal.core;
+
+import java.util.Hashtable;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.net.core.IProxyData;
+import org.eclipse.net.core.NetCore;
+
+import com.jcraft.jsch.*;
+
+public class Utils{
+
+ public static String loadPrivateKeys(JSch jsch, String current_pkeys){
+ Preferences preferences=JSchCorePlugin.getPlugin().getPluginPreferences();
+ String ssh_home=preferences.getString(IConstants.KEY_SSH2HOME);
+ String pkeys=preferences.getString(IConstants.KEY_PRIVATEKEY);
+
+ if(ssh_home.length()==0)
+ ssh_home=PreferenceInitializer.SSH_HOME_DEFAULT;
+
+ java.io.File file;
+ String[] pkey=pkeys.split(","); //$NON-NLS-1$
+ String[] _pkey=current_pkeys.split(","); //$NON-NLS-1$
+ String result=""; //$NON-NLS-1$
+ for(int i=0; i<pkey.length; i++){
+ file=new java.io.File(pkey[i]);
+ if(!file.isAbsolute()){
+ file=new java.io.File(ssh_home, pkey[i]);
+ }
+ if(file.exists()){
+ boolean notyet=true;
+ for(int j=0; j<_pkey.length; j++){
+ if(pkey[i].equals(_pkey[j])){
+ notyet=false;
+ break;
+ }
+ }
+ try{
+ if(notyet)
+ jsch.addIdentity(file.getPath());
+ if(result.length()==0){
+ result=pkey[i];
+ }
+ else{
+ result+=(","+pkey[i]); //$NON-NLS-1$
+ }
+ }
+ catch(JSchException e){
+ JSchCorePlugin.log(IStatus.ERROR, "An error occurred loading the SSH2 private keys", e); //$NON-NLS-1$
+ }
+ }
+ }
+ return result;
+ }
+
+ public static Session createSession(JSch jsch, String username, String hostname, int port) throws JSchException{
+ Session session=jsch.getSession(username, hostname, port);
+ setProxy(session);
+ Hashtable config=new Hashtable();
+ config.put(
+ "PreferredAuthentications", //$NON-NLS-1$
+ "gssapi-with-mic,publickey,password,keyboard-interactive"); //$NON-NLS-1$
+ session.setConfig(config);
+ return session;
+ }
+
+ public static void setProxy(Session session){
+ boolean useProxy=NetCore.getProxyManager().isProxiesEnabled();
+ if(!useProxy)
+ return;
+ Proxy proxy=null;
+ IProxyData data=getProxyData();
+ if(data==null)
+ return;
+ String _type=getProxyType(data);
+ if (_type == null)
+ return;
+ String _host=data.getHost();
+ int _port=getPort(data);
+
+ boolean useAuth=data.isRequiresAuthentication();
+ String _user=""; //$NON-NLS-1$
+ String _pass=""; //$NON-NLS-1$
+
+ // Retrieve username and password from keyring.
+ if(useAuth){
+ _user=data.getUserId();
+ _pass=data.getPassword();
+ }
+
+ String proxyhost=_host+":"+_port; //$NON-NLS-1$
+ if(_type.equals(IConstants.PROXY_TYPE_HTTP)){
+ proxy=new ProxyHTTP(proxyhost);
+ if(useAuth){
+ ((ProxyHTTP)proxy).setUserPasswd(_user, _pass);
+ }
+ }
+ else if(_type.equals(IConstants.PROXY_TYPE_SOCKS5)){
+ proxy=new ProxySOCKS5(proxyhost);
+ if(useAuth){
+ ((ProxySOCKS5)proxy).setUserPasswd(_user, _pass);
+ }
+ }
+ if(proxy!=null)
+ session.setProxy(proxy);
+ }
+
+ private static int getPort(IProxyData data){
+ int port = data.getPort();
+ if (port == -1) {
+ if (data.getType().equals(IProxyData.HTTP_PROXY_TYPE))
+ port = 80;
+ else if (data.getType().equals(IProxyData.HTTPS_PROXY_TYPE))
+ port = 443;
+ else if (data.getType().equals(IProxyData.SOCKS_PROXY_TYPE))
+ port = 1080;
+ }
+ return port;
+ }
+
+ private static IProxyData getProxyData(){
+ IProxyData data = NetCore.getProxyManager().getProxyData(IProxyData.HTTP_PROXY_TYPE);
+ if (data == null || data.getHost() == null) {
+ data = NetCore.getProxyManager().getProxyData(IProxyData.SOCKS_PROXY_TYPE);
+ }
+ if (data == null || data.getHost() == null) {
+ data = NetCore.getProxyManager().getProxyData(IProxyData.HTTPS_PROXY_TYPE);
+ }
+ if (data == null || data.getHost() == null || getProxyType(data) == null)
+ return null;
+ return data;
+ }
+
+ private static String getProxyType(IProxyData data){
+ if (data.getType().equals(IProxyData.HTTP_PROXY_TYPE) || data.getType().equals(IProxyData.HTTPS_PROXY_TYPE))
+ return IConstants.PROXY_TYPE_HTTP;
+ if (data.getType().equals(IProxyData.SOCKS_PROXY_TYPE))
+ return IConstants.PROXY_TYPE_SOCKS5;
+ return null;
+ }
+
+}
diff --git a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/messages.properties b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/messages.properties
new file mode 100644
index 000000000..48faf185a
--- /dev/null
+++ b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/messages.properties
@@ -0,0 +1,21 @@
+###############################################################################
+# 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
+# Maik Schreiber - bug 102461
+# Philippe Ombredanne - bug 84808
+###############################################################################
+JSchSession_5=SSH2 Message
+Util_timeout=A timeout occurred connecting to host {0}
+JSchAuthenticationException_detail=Authentication error: {0}
+JSchRepositoryLocation_locationForm=Location must have form 'user@host[:port]'
+JSchRepositoryLocation_invalidFormat=Invalid location format: {0}
+KnownRepositories_0=Error restoring location repositories
+JSchRepositoryLocation_73=Error clearing preferences for location {0}
+JSchRepositoryLocation_74=Error retrieving preferences for location {0}
+JSchRepositoryLocation_75=Error flushing preferences for location {0}

Back to the top