Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 195763 Details for
Bug 251740
[filetransfer][plan] create filetransfer provider from httpclient 4.X
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
httpclient 4.1 implementation
httpclient4.1.patch (text/plain), 190.08 KB, created by
Thomas
on 2011-05-16 12:59:37 EDT
(
hide
)
Description:
httpclient 4.1 implementation
Filename:
MIME Type:
Creator:
Thomas
Created:
2011-05-16 12:59:37 EDT
Size:
190.08 KB
patch
obsolete
>diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.classpath b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.classpath >new file mode 100644 >index 0000000..6f3b481 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.classpath >@@ -0,0 +1,7 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<classpath> >+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/> >+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> >+ <classpathentry kind="src" path="src"/> >+ <classpathentry kind="output" path="bin"/> >+</classpath> >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.gitignore b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.gitignore >new file mode 100644 >index 0000000..ba077a4 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.gitignore >@@ -0,0 +1 @@ >+bin >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.options b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.options >new file mode 100644 >index 0000000..7bb9928 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.options >@@ -0,0 +1,16 @@ >+# Debugging options for the org.eclipse.ecf.provider.filetransfer.httpclient plug-in >+ >+# Turn on general debugging for the org.eclipse.ecf.provider.filetransfer.httpclient plug-in >+org.eclipse.ecf.provider.filetransfer.httpclient/debug=false >+org.eclipse.ecf.provider.filetransfer.httpclient/debug/filter = * >+org.eclipse.ecf.provider.filetransfer.httpclient/debug/flag = false >+ >+# Trace when exceptions are caught >+org.eclipse.ecf.provider.filetransfer.httpclient/debug/exceptions/catching=false >+# Trace when exceptions are thrown >+org.eclipse.ecf.provider.filetransfer.httpclient/debug/exceptions/throwing=false >+ >+# Trace when methods are entered >+org.eclipse.ecf.provider.filetransfer.httpclient/debug/methods/entering=false >+# Trace when methods are exited >+org.eclipse.ecf.provider.filetransfer.httpclient/debug/methods/exiting=false >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.project b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.project >new file mode 100644 >index 0000000..5441903 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.project >@@ -0,0 +1,34 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<projectDescription> >+ <name>org.eclipse.ecf.provider.filetransfer.httpclient</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> >+ <buildCommand> >+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name> >+ <arguments> >+ </arguments> >+ </buildCommand> >+ </buildSpec> >+ <natures> >+ <nature>org.eclipse.pde.PluginNature</nature> >+ <nature>org.eclipse.jdt.core.javanature</nature> >+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature> >+ </natures> >+</projectDescription> >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.jdt.core.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.jdt.core.prefs >new file mode 100644 >index 0000000..9943097 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.jdt.core.prefs >@@ -0,0 +1,351 @@ >+#Fri Jan 29 14:30:16 PST 2010 >+eclipse.preferences.version=1 >+org.eclipse.jdt.core.builder.cleanOutputFolder=clean >+org.eclipse.jdt.core.builder.duplicateResourceTask=warning >+org.eclipse.jdt.core.builder.invalidClasspath=abort >+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch >+org.eclipse.jdt.core.circularClasspath=error >+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled >+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled >+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.maxProblemPerUnit=1000 >+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning >+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning >+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=enabled >+org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore >+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning >+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning >+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore >+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled >+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning >+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore >+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning >+org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore >+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=warning >+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error >+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled >+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled >+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled >+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private >+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning >+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.missingJavadocComments=ignore >+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled >+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public >+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag >+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore >+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled >+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public >+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore >+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled >+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=warning >+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=warning >+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore >+org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore >+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=ignore >+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning >+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning >+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning >+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning >+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore >+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning >+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled >+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled >+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled >+org.eclipse.jdt.core.compiler.problem.unusedImport=error >+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=enabled >+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled >+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error >+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning >+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning >+org.eclipse.jdt.core.compiler.source=1.3 >+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_import_groups=1 >+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_in_block_comment=false >+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false >+org.eclipse.jdt.core.formatter.comment.format_block_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_javadoc_comments=false >+org.eclipse.jdt.core.formatter.comment.format_line_comments=false >+org.eclipse.jdt.core.formatter.comment.format_source_code=true >+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false >+org.eclipse.jdt.core.formatter.comment.indent_root_tags=false >+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert >+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not 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=4 >+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=do not 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=do not insert >+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert >+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not 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=do not 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=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=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=insert >+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=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=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=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=insert >+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert >+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=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=insert >+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=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=insert >+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert >+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert >+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert >+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert >+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert >+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=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=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=insert >+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=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=insert >+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert >+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert >+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert >+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=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=800 >+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false >+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false >+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=false >+org.eclipse.jdt.core.formatter.tabulation.char=tab >+org.eclipse.jdt.core.formatter.tabulation.size=4 >+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false >+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true >+org.eclipse.jdt.core.incompatibleJDKLevel=ignore >+org.eclipse.jdt.core.incompleteClasspath=error >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.jdt.core.prefs.bak b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.jdt.core.prefs.bak >new file mode 100644 >index 0000000..149b51e >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.jdt.core.prefs.bak >@@ -0,0 +1,12 @@ >+#Mon May 16 09:37:06 CDT 2011 >+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.problem.assertIdentifier=warning >+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning >+org.eclipse.jdt.core.compiler.source=1.3 >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.jdt.launching.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.jdt.launching.prefs >new file mode 100644 >index 0000000..c7eda7a >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.jdt.launching.prefs >@@ -0,0 +1,3 @@ >+#Tue Feb 03 16:03:47 PST 2009 >+eclipse.preferences.version=1 >+org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=ignore >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.jdt.ui.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.jdt.ui.prefs >new file mode 100644 >index 0000000..9e5e00d >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.jdt.ui.prefs >@@ -0,0 +1,61 @@ >+#Thu Mar 12 11:02:43 PDT 2009 >+eclipse.preferences.version=1 >+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true >+formatter_profile=_core >+formatter_settings_version=11 >+internal.default.compliance=user >+org.eclipse.jdt.ui.ignorelowercasenames=true >+org.eclipse.jdt.ui.importorder= >+org.eclipse.jdt.ui.ondemandthreshold=100 >+org.eclipse.jdt.ui.staticondemandthreshold=99 >+sp_cleanup.add_default_serial_version_id=true >+sp_cleanup.add_generated_serial_version_id=false >+sp_cleanup.add_missing_annotations=true >+sp_cleanup.add_missing_deprecated_annotations=true >+sp_cleanup.add_missing_methods=false >+sp_cleanup.add_missing_nls_tags=false >+sp_cleanup.add_missing_override_annotations=true >+sp_cleanup.add_serial_version_id=false >+sp_cleanup.always_use_blocks=true >+sp_cleanup.always_use_parentheses_in_expressions=false >+sp_cleanup.always_use_this_for_non_static_field_access=false >+sp_cleanup.always_use_this_for_non_static_method_access=false >+sp_cleanup.convert_to_enhanced_for_loop=false >+sp_cleanup.correct_indentation=false >+sp_cleanup.format_source_code=true >+sp_cleanup.format_source_code_changes_only=false >+sp_cleanup.make_local_variable_final=false >+sp_cleanup.make_parameters_final=false >+sp_cleanup.make_private_fields_final=true >+sp_cleanup.make_type_abstract_if_missing_method=false >+sp_cleanup.make_variable_declarations_final=true >+sp_cleanup.never_use_blocks=false >+sp_cleanup.never_use_parentheses_in_expressions=true >+sp_cleanup.on_save_use_additional_actions=false >+sp_cleanup.organize_imports=true >+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false >+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true >+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true >+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false >+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false >+sp_cleanup.remove_private_constructors=true >+sp_cleanup.remove_trailing_whitespaces=false >+sp_cleanup.remove_trailing_whitespaces_all=true >+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false >+sp_cleanup.remove_unnecessary_casts=true >+sp_cleanup.remove_unnecessary_nls_tags=false >+sp_cleanup.remove_unused_imports=false >+sp_cleanup.remove_unused_local_variables=false >+sp_cleanup.remove_unused_private_fields=true >+sp_cleanup.remove_unused_private_members=false >+sp_cleanup.remove_unused_private_methods=true >+sp_cleanup.remove_unused_private_types=true >+sp_cleanup.sort_members=false >+sp_cleanup.sort_members_all=false >+sp_cleanup.use_blocks=false >+sp_cleanup.use_blocks_only_for_return_and_throw=false >+sp_cleanup.use_parentheses_in_expressions=false >+sp_cleanup.use_this_for_non_static_field_access=false >+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true >+sp_cleanup.use_this_for_non_static_method_access=false >+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.pde.api.tools.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.pde.api.tools.prefs >new file mode 100644 >index 0000000..e0cf154 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.pde.api.tools.prefs >@@ -0,0 +1,94 @@ >+#Wed Sep 01 15:16:36 PDT 2010 >+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error >+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error >+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error >+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error >+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error >+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error >+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error >+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error >+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error >+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error >+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error >+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error >+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error >+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error >+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error >+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error >+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error >+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error >+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error >+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error >+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error >+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error >+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error >+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error >+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error >+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error >+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error >+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error >+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error >+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error >+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error >+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error >+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error >+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error >+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error >+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error >+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error >+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error >+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error >+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error >+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error >+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error >+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error >+ILLEGAL_EXTEND=Warning >+ILLEGAL_IMPLEMENT=Warning >+ILLEGAL_INSTANTIATE=Warning >+ILLEGAL_OVERRIDE=Warning >+ILLEGAL_REFERENCE=Warning >+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error >+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error >+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error >+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error >+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error >+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error >+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error >+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error >+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error >+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error >+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error >+INVALID_JAVADOC_TAG=Ignore >+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Error >+LEAK_EXTEND=Warning >+LEAK_FIELD_DECL=Warning >+LEAK_IMPLEMENT=Ignore >+LEAK_METHOD_PARAM=Warning >+LEAK_METHOD_RETURN_TYPE=Warning >+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error >+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error >+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error >+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error >+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error >+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error >+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error >+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error >+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error >+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error >+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error >+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error >+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error >+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error >+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error >+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error >+UNUSED_PROBLEM_FILTERS=Warning >+automatically_removed_unused_problem_filters=false >+eclipse.preferences.version=1 >+incompatible_api_component_version=Error >+incompatible_api_component_version_include_major_without_breaking_change=Disabled >+incompatible_api_component_version_include_minor_without_api_change=Disabled >+invalid_since_tag_version=Error >+malformed_since_tag=Error >+missing_since_tag=Error >+report_api_breakage_when_major_version_incremented=Disabled >+report_resolution_errors_api_component=Warning >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.pde.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.pde.prefs >new file mode 100644 >index 0000000..05ef9da >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/.settings/org.eclipse.pde.prefs >@@ -0,0 +1,27 @@ >+#Fri Jan 29 14:33:19 PST 2010 >+compilers.f.unresolved-features=1 >+compilers.f.unresolved-plugins=1 >+compilers.incompatible-environment=1 >+compilers.p.build=2 >+compilers.p.build.missing.output=2 >+compilers.p.deprecated=1 >+compilers.p.discouraged-class=0 >+compilers.p.internal=1 >+compilers.p.missing-packages=2 >+compilers.p.missing-version-export-package=2 >+compilers.p.missing-version-import-package=2 >+compilers.p.missing-version-require-bundle=2 >+compilers.p.no-required-att=0 >+compilers.p.not-externalized-att=2 >+compilers.p.unknown-attribute=1 >+compilers.p.unknown-class=1 >+compilers.p.unknown-element=1 >+compilers.p.unknown-identifier=1 >+compilers.p.unknown-resource=1 >+compilers.p.unresolved-ex-points=0 >+compilers.p.unresolved-import=0 >+compilers.s.create-docs=false >+compilers.s.doc-folder=doc >+compilers.s.open-tags=1 >+compilers.use-project=true >+eclipse.preferences.version=1 >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/META-INF/MANIFEST.MF >new file mode 100644 >index 0000000..937cf38 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/META-INF/MANIFEST.MF >@@ -0,0 +1,36 @@ >+Manifest-Version: 1.0 >+Bundle-ManifestVersion: 2 >+Bundle-Name: %plugin.name >+Bundle-SymbolicName: org.eclipse.ecf.provider.filetransfer.httpclient4;singleton:=true >+Bundle-Version: 1.0.0.qualifier >+Bundle-Localization: plugin >+Bundle-Activator: org.eclipse.ecf.internal.provider.filetransfer.httpclient.Activator >+Require-Bundle: org.eclipse.equinox.common, >+ org.eclipse.ecf.provider.filetransfer, >+ org.eclipse.ecf, >+ org.eclipse.ecf.filetransfer, >+ org.apache.httpcomponents.httpclient;bundle-version="4.1.0", >+ org.eclipse.osgi >+Eclipse-LazyStart: true >+Import-Package: org.apache.http;version="4.1.0", >+ org.apache.http.entity;version="4.1.0", >+ org.apache.http.impl;version="4.1.0", >+ org.apache.http.impl.entity;version="4.1.0", >+ org.apache.http.impl.io;version="4.1.0", >+ org.apache.http.io;version="4.1.0", >+ org.apache.http.message;version="4.1.0", >+ org.apache.http.params;version="4.1.0", >+ org.apache.http.protocol;version="4.1.0", >+ org.apache.http.util;version="4.1.0", >+ org.eclipse.core.runtime.jobs, >+ org.eclipse.osgi.util;version="1.0.0", >+ org.osgi.framework;version="1.3.0", >+ org.osgi.service.log;version="1.3.0", >+ org.osgi.service.url;version="1.0.0", >+ org.osgi.util.tracker;version="1.3.2" >+Export-Package: org.eclipse.ecf.internal.provider.filetransfer.httpclient;x-internal:=true, >+ org.eclipse.ecf.provider.filetransfer.httpclient >+Bundle-Vendor: %plugin.provider >+Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1, >+ J2SE-1.5 >+Bundle-ActivationPolicy: lazy >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/about.html b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/about.html >new file mode 100644 >index 0000000..8ffd12b >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/about.html >@@ -0,0 +1,274 @@ >+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" >+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> >+<html xmlns="http://www.w3.org/1999/xhtml"> >+<head> >+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> >+<title>About</title> >+</head> >+<body lang="EN-US"> >+ <h3>About This Content</h3> >+ >+ <p>May 14, 2009</p> >+ <h3>License</h3> >+ >+ <p>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 <a href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/legal/epl-v10.html</a>. >+ For purposes of the EPL, "Program" will mean the Content.</p> >+ >+ <p>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 <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> >+ >+ <h3>Third Party Content</h3> >+ <p>The Content includes items that have been sourced from third parties as set out below. If you >+ did not receive this Content directly from the Eclipse Foundation, the following is provided >+ for informational purposes only, and you should look to the Redistributor's license for >+ terms and conditions of use.</p> >+ >+<h4>Apache HttpClient v4.1.0</h4> >+ >+<p>This plugin is based on software developed by the Apache Httpclient project at <a href="http://jakarta.apache.org/commons/httpclient/">http://jakarta.apache.org/commons/httpclient/</a>. >+A copy of this library is distributed within this plugin and >+therefore this plugin is subject to the Apache License version 2.0, a copy of the license is contained >+in the file <a href="asl-v20.txt">asl-v20.txt</a> and >+at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>. >+</p> >+ >+<h4>Apache Commons Codec v1.4</h4> >+ >+<p>This plugin is based on software developed by the Apache Commons Codec project at <a href="http://jakarta.apache.org/commons/codec/">http://jakarta.apache.org/commons/codec/</a>. >+A copy of this library is distributed within this plugin and >+therefore this plugin is subject to the Apache License version 2.0, a copy of the license is contained >+in the file <a href="asl-v20.txt">asl-v20.txt</a> and >+at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>. >+</p> >+ >+<h4>Apache Commons Logging v1.1.1</h4> >+ >+<p>This plugin is based on software developed by the Apache Commons Codec project at <a href="http://jakarta.apache.org/commons/logging/">http://jakarta.apache.org/commons/logging/</a>. >+A copy of this library is distributed within this plugin and >+therefore this plugin is subject to the Apache License version 2.0, a copy of the license is contained >+in the file <a href="asl-v20.txt">asl-v20.txt</a> and >+at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>. >+</p> >+ >+<p>Your use of the this plugin and the components listed above is subject to the terms and conditions of the Apache License v2.0 >+which is available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>. >+</p> >+<p> >+More specifically:</p> >+ >+<p></p> >+ >+<pre> >+ >+ Apache License >+ Version 2.0, January 2004 >+ http://www.apache.org/licenses/ >+ >+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION >+ >+ 1. Definitions. >+ >+ "License" shall mean the terms and conditions for use, reproduction, >+ and distribution as defined by Sections 1 through 9 of this document. >+ >+ "Licensor" shall mean the copyright owner or entity authorized by >+ the copyright owner that is granting the License. >+ >+ "Legal Entity" shall mean the union of the acting entity and all >+ other entities that control, are controlled by, or are under common >+ control with that entity. For the purposes of this definition, >+ "control" means (i) the power, direct or indirect, to cause the >+ direction or management of such entity, whether by contract or >+ otherwise, or (ii) ownership of fifty percent (50%) or more of the >+ outstanding shares, or (iii) beneficial ownership of such entity. >+ >+ "You" (or "Your") shall mean an individual or Legal Entity >+ exercising permissions granted by this License. >+ >+ "Source" form shall mean the preferred form for making modifications, >+ including but not limited to software source code, documentation >+ source, and configuration files. >+ >+ "Object" form shall mean any form resulting from mechanical >+ transformation or translation of a Source form, including but >+ not limited to compiled object code, generated documentation, >+ and conversions to other media types. >+ >+ "Work" shall mean the work of authorship, whether in Source or >+ Object form, made available under the License, as indicated by a >+ copyright notice that is included in or attached to the work >+ (an example is provided in the Appendix below). >+ >+ "Derivative Works" shall mean any work, whether in Source or Object >+ form, that is based on (or derived from) the Work and for which the >+ editorial revisions, annotations, elaborations, or other modifications >+ represent, as a whole, an original work of authorship. For the purposes >+ of this License, Derivative Works shall not include works that remain >+ separable from, or merely link (or bind by name) to the interfaces of, >+ the Work and Derivative Works thereof. >+ >+ "Contribution" shall mean any work of authorship, including >+ the original version of the Work and any modifications or additions >+ to that Work or Derivative Works thereof, that is intentionally >+ submitted to Licensor for inclusion in the Work by the copyright owner >+ or by an individual or Legal Entity authorized to submit on behalf of >+ the copyright owner. For the purposes of this definition, "submitted" >+ means any form of electronic, verbal, or written communication sent >+ to the Licensor or its representatives, including but not limited to >+ communication on electronic mailing lists, source code control systems, >+ and issue tracking systems that are managed by, or on behalf of, the >+ Licensor for the purpose of discussing and improving the Work, but >+ excluding communication that is conspicuously marked or otherwise >+ designated in writing by the copyright owner as "Not a Contribution." >+ >+ "Contributor" shall mean Licensor and any individual or Legal Entity >+ on behalf of whom a Contribution has been received by Licensor and >+ subsequently incorporated within the Work. >+ >+ 2. Grant of Copyright License. Subject to the terms and conditions of >+ this License, each Contributor hereby grants to You a perpetual, >+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable >+ copyright license to reproduce, prepare Derivative Works of, >+ publicly display, publicly perform, sublicense, and distribute the >+ Work and such Derivative Works in Source or Object form. >+ >+ 3. Grant of Patent License. Subject to the terms and conditions of >+ this License, each Contributor hereby grants to You a perpetual, >+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable >+ (except as stated in this section) patent license to make, have made, >+ use, offer to sell, sell, import, and otherwise transfer the Work, >+ where such license applies only to those patent claims licensable >+ by such Contributor that are necessarily infringed by their >+ Contribution(s) alone or by combination of their Contribution(s) >+ with the Work to which such Contribution(s) was submitted. If You >+ institute patent litigation against any entity (including a >+ cross-claim or counterclaim in a lawsuit) alleging that the Work >+ or a Contribution incorporated within the Work constitutes direct >+ or contributory patent infringement, then any patent licenses >+ granted to You under this License for that Work shall terminate >+ as of the date such litigation is filed. >+ >+ 4. Redistribution. You may reproduce and distribute copies of the >+ Work or Derivative Works thereof in any medium, with or without >+ modifications, and in Source or Object form, provided that You >+ meet the following conditions: >+ >+ (a) You must give any other recipients of the Work or >+ Derivative Works a copy of this License; and >+ >+ (b) You must cause any modified files to carry prominent notices >+ stating that You changed the files; and >+ >+ (c) You must retain, in the Source form of any Derivative Works >+ that You distribute, all copyright, patent, trademark, and >+ attribution notices from the Source form of the Work, >+ excluding those notices that do not pertain to any part of >+ the Derivative Works; and >+ >+ (d) If the Work includes a "NOTICE" text file as part of its >+ distribution, then any Derivative Works that You distribute must >+ include a readable copy of the attribution notices contained >+ within such NOTICE file, excluding those notices that do not >+ pertain to any part of the Derivative Works, in at least one >+ of the following places: within a NOTICE text file distributed >+ as part of the Derivative Works; within the Source form or >+ documentation, if provided along with the Derivative Works; or, >+ within a display generated by the Derivative Works, if and >+ wherever such third-party notices normally appear. The contents >+ of the NOTICE file are for informational purposes only and >+ do not modify the License. You may add Your own attribution >+ notices within Derivative Works that You distribute, alongside >+ or as an addendum to the NOTICE text from the Work, provided >+ that such additional attribution notices cannot be construed >+ as modifying the License. >+ >+ You may add Your own copyright statement to Your modifications and >+ may provide additional or different license terms and conditions >+ for use, reproduction, or distribution of Your modifications, or >+ for any such Derivative Works as a whole, provided Your use, >+ reproduction, and distribution of the Work otherwise complies with >+ the conditions stated in this License. >+ >+ 5. Submission of Contributions. Unless You explicitly state otherwise, >+ any Contribution intentionally submitted for inclusion in the Work >+ by You to the Licensor shall be under the terms and conditions of >+ this License, without any additional terms or conditions. >+ Notwithstanding the above, nothing herein shall supersede or modify >+ the terms of any separate license agreement you may have executed >+ with Licensor regarding such Contributions. >+ >+ 6. Trademarks. This License does not grant permission to use the trade >+ names, trademarks, service marks, or product names of the Licensor, >+ except as required for reasonable and customary use in describing the >+ origin of the Work and reproducing the content of the NOTICE file. >+ >+ 7. Disclaimer of Warranty. Unless required by applicable law or >+ agreed to in writing, Licensor provides the Work (and each >+ Contributor provides its Contributions) 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. You are solely responsible for determining the >+ appropriateness of using or redistributing the Work and assume any >+ risks associated with Your exercise of permissions under this License. >+ >+ 8. Limitation of Liability. In no event and under no legal theory, >+ whether in tort (including negligence), contract, or otherwise, >+ unless required by applicable law (such as deliberate and grossly >+ negligent acts) or agreed to in writing, shall any Contributor be >+ liable to You for damages, including any direct, indirect, special, >+ incidental, or consequential damages of any character arising as a >+ result of this License or out of the use or inability to use the >+ Work (including but not limited to damages for loss of goodwill, >+ work stoppage, computer failure or malfunction, or any and all >+ other commercial damages or losses), even if such Contributor >+ has been advised of the possibility of such damages. >+ >+ 9. Accepting Warranty or Additional Liability. While redistributing >+ the Work or Derivative Works thereof, You may choose to offer, >+ and charge a fee for, acceptance of support, warranty, indemnity, >+ or other liability obligations and/or rights consistent with this >+ License. However, in accepting such obligations, You may act only >+ on Your own behalf and on Your sole responsibility, not on behalf >+ of any other Contributor, and only if You agree to indemnify, >+ defend, and hold each Contributor harmless for any liability >+ incurred by, or claims asserted against, such Contributor by reason >+ of your accepting any such warranty or additional liability. >+ >+ END OF TERMS AND CONDITIONS >+ >+ APPENDIX: How to apply the Apache License to your work. >+ >+ To apply the Apache License to your work, attach the following >+ boilerplate notice, with the fields enclosed by brackets "[]" >+ replaced with your own identifying information. (Don't include >+ the brackets!) The text should be enclosed in the appropriate >+ comment syntax for the file format. We also recommend that a >+ file or class name and description of purpose be included on the >+ same "printed page" as the copyright notice for easier >+ identification within third-party archives. >+ >+ Copyright [yyyy] [name of copyright owner] >+ >+ Licensed under the Apache License, Version 2.0 (the "License"); >+ you may not use this file except in compliance with the License. >+ You may obtain a copy of the License at >+ >+ http://www.apache.org/licenses/LICENSE-2.0 >+ >+ Unless required by applicable law or agreed to in writing, software >+ distributed under the License is distributed on an "AS IS" BASIS, >+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >+ See the License for the specific language governing permissions and >+ limitations under the License. >+</pre> >+ >+</body> >+</html> >\ No newline at end of file >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/asl-v20.txt b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/asl-v20.txt >new file mode 100644 >index 0000000..d645695 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/asl-v20.txt >@@ -0,0 +1,202 @@ >+ >+ Apache License >+ Version 2.0, January 2004 >+ http://www.apache.org/licenses/ >+ >+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION >+ >+ 1. Definitions. >+ >+ "License" shall mean the terms and conditions for use, reproduction, >+ and distribution as defined by Sections 1 through 9 of this document. >+ >+ "Licensor" shall mean the copyright owner or entity authorized by >+ the copyright owner that is granting the License. >+ >+ "Legal Entity" shall mean the union of the acting entity and all >+ other entities that control, are controlled by, or are under common >+ control with that entity. For the purposes of this definition, >+ "control" means (i) the power, direct or indirect, to cause the >+ direction or management of such entity, whether by contract or >+ otherwise, or (ii) ownership of fifty percent (50%) or more of the >+ outstanding shares, or (iii) beneficial ownership of such entity. >+ >+ "You" (or "Your") shall mean an individual or Legal Entity >+ exercising permissions granted by this License. >+ >+ "Source" form shall mean the preferred form for making modifications, >+ including but not limited to software source code, documentation >+ source, and configuration files. >+ >+ "Object" form shall mean any form resulting from mechanical >+ transformation or translation of a Source form, including but >+ not limited to compiled object code, generated documentation, >+ and conversions to other media types. >+ >+ "Work" shall mean the work of authorship, whether in Source or >+ Object form, made available under the License, as indicated by a >+ copyright notice that is included in or attached to the work >+ (an example is provided in the Appendix below). >+ >+ "Derivative Works" shall mean any work, whether in Source or Object >+ form, that is based on (or derived from) the Work and for which the >+ editorial revisions, annotations, elaborations, or other modifications >+ represent, as a whole, an original work of authorship. For the purposes >+ of this License, Derivative Works shall not include works that remain >+ separable from, or merely link (or bind by name) to the interfaces of, >+ the Work and Derivative Works thereof. >+ >+ "Contribution" shall mean any work of authorship, including >+ the original version of the Work and any modifications or additions >+ to that Work or Derivative Works thereof, that is intentionally >+ submitted to Licensor for inclusion in the Work by the copyright owner >+ or by an individual or Legal Entity authorized to submit on behalf of >+ the copyright owner. For the purposes of this definition, "submitted" >+ means any form of electronic, verbal, or written communication sent >+ to the Licensor or its representatives, including but not limited to >+ communication on electronic mailing lists, source code control systems, >+ and issue tracking systems that are managed by, or on behalf of, the >+ Licensor for the purpose of discussing and improving the Work, but >+ excluding communication that is conspicuously marked or otherwise >+ designated in writing by the copyright owner as "Not a Contribution." >+ >+ "Contributor" shall mean Licensor and any individual or Legal Entity >+ on behalf of whom a Contribution has been received by Licensor and >+ subsequently incorporated within the Work. >+ >+ 2. Grant of Copyright License. Subject to the terms and conditions of >+ this License, each Contributor hereby grants to You a perpetual, >+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable >+ copyright license to reproduce, prepare Derivative Works of, >+ publicly display, publicly perform, sublicense, and distribute the >+ Work and such Derivative Works in Source or Object form. >+ >+ 3. Grant of Patent License. Subject to the terms and conditions of >+ this License, each Contributor hereby grants to You a perpetual, >+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable >+ (except as stated in this section) patent license to make, have made, >+ use, offer to sell, sell, import, and otherwise transfer the Work, >+ where such license applies only to those patent claims licensable >+ by such Contributor that are necessarily infringed by their >+ Contribution(s) alone or by combination of their Contribution(s) >+ with the Work to which such Contribution(s) was submitted. If You >+ institute patent litigation against any entity (including a >+ cross-claim or counterclaim in a lawsuit) alleging that the Work >+ or a Contribution incorporated within the Work constitutes direct >+ or contributory patent infringement, then any patent licenses >+ granted to You under this License for that Work shall terminate >+ as of the date such litigation is filed. >+ >+ 4. Redistribution. You may reproduce and distribute copies of the >+ Work or Derivative Works thereof in any medium, with or without >+ modifications, and in Source or Object form, provided that You >+ meet the following conditions: >+ >+ (a) You must give any other recipients of the Work or >+ Derivative Works a copy of this License; and >+ >+ (b) You must cause any modified files to carry prominent notices >+ stating that You changed the files; and >+ >+ (c) You must retain, in the Source form of any Derivative Works >+ that You distribute, all copyright, patent, trademark, and >+ attribution notices from the Source form of the Work, >+ excluding those notices that do not pertain to any part of >+ the Derivative Works; and >+ >+ (d) If the Work includes a "NOTICE" text file as part of its >+ distribution, then any Derivative Works that You distribute must >+ include a readable copy of the attribution notices contained >+ within such NOTICE file, excluding those notices that do not >+ pertain to any part of the Derivative Works, in at least one >+ of the following places: within a NOTICE text file distributed >+ as part of the Derivative Works; within the Source form or >+ documentation, if provided along with the Derivative Works; or, >+ within a display generated by the Derivative Works, if and >+ wherever such third-party notices normally appear. The contents >+ of the NOTICE file are for informational purposes only and >+ do not modify the License. You may add Your own attribution >+ notices within Derivative Works that You distribute, alongside >+ or as an addendum to the NOTICE text from the Work, provided >+ that such additional attribution notices cannot be construed >+ as modifying the License. >+ >+ You may add Your own copyright statement to Your modifications and >+ may provide additional or different license terms and conditions >+ for use, reproduction, or distribution of Your modifications, or >+ for any such Derivative Works as a whole, provided Your use, >+ reproduction, and distribution of the Work otherwise complies with >+ the conditions stated in this License. >+ >+ 5. Submission of Contributions. Unless You explicitly state otherwise, >+ any Contribution intentionally submitted for inclusion in the Work >+ by You to the Licensor shall be under the terms and conditions of >+ this License, without any additional terms or conditions. >+ Notwithstanding the above, nothing herein shall supersede or modify >+ the terms of any separate license agreement you may have executed >+ with Licensor regarding such Contributions. >+ >+ 6. Trademarks. This License does not grant permission to use the trade >+ names, trademarks, service marks, or product names of the Licensor, >+ except as required for reasonable and customary use in describing the >+ origin of the Work and reproducing the content of the NOTICE file. >+ >+ 7. Disclaimer of Warranty. Unless required by applicable law or >+ agreed to in writing, Licensor provides the Work (and each >+ Contributor provides its Contributions) 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. You are solely responsible for determining the >+ appropriateness of using or redistributing the Work and assume any >+ risks associated with Your exercise of permissions under this License. >+ >+ 8. Limitation of Liability. In no event and under no legal theory, >+ whether in tort (including negligence), contract, or otherwise, >+ unless required by applicable law (such as deliberate and grossly >+ negligent acts) or agreed to in writing, shall any Contributor be >+ liable to You for damages, including any direct, indirect, special, >+ incidental, or consequential damages of any character arising as a >+ result of this License or out of the use or inability to use the >+ Work (including but not limited to damages for loss of goodwill, >+ work stoppage, computer failure or malfunction, or any and all >+ other commercial damages or losses), even if such Contributor >+ has been advised of the possibility of such damages. >+ >+ 9. Accepting Warranty or Additional Liability. While redistributing >+ the Work or Derivative Works thereof, You may choose to offer, >+ and charge a fee for, acceptance of support, warranty, indemnity, >+ or other liability obligations and/or rights consistent with this >+ License. However, in accepting such obligations, You may act only >+ on Your own behalf and on Your sole responsibility, not on behalf >+ of any other Contributor, and only if You agree to indemnify, >+ defend, and hold each Contributor harmless for any liability >+ incurred by, or claims asserted against, such Contributor by reason >+ of your accepting any such warranty or additional liability. >+ >+ END OF TERMS AND CONDITIONS >+ >+ APPENDIX: How to apply the Apache License to your work. >+ >+ To apply the Apache License to your work, attach the following >+ boilerplate notice, with the fields enclosed by brackets "[]" >+ replaced with your own identifying information. (Don't include >+ the brackets!) The text should be enclosed in the appropriate >+ comment syntax for the file format. We also recommend that a >+ file or class name and description of purpose be included on the >+ same "printed page" as the copyright notice for easier >+ identification within third-party archives. >+ >+ Copyright [yyyy] [name of copyright owner] >+ >+ Licensed under the Apache License, Version 2.0 (the "License"); >+ you may not use this file except in compliance with the License. >+ You may obtain a copy of the License at >+ >+ http://www.apache.org/licenses/LICENSE-2.0 >+ >+ Unless required by applicable law or agreed to in writing, software >+ distributed under the License is distributed on an "AS IS" BASIS, >+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >+ See the License for the specific language governing permissions and >+ limitations under the License. >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/build.properties b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/build.properties >new file mode 100644 >index 0000000..1eb488b >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/build.properties >@@ -0,0 +1,11 @@ >+source.. = src/ >+output.. = bin/ >+bin.includes = META-INF/,\ >+ .,\ >+ plugin.xml,\ >+ about.html,\ >+ plugin.properties,\ >+ asl-v20.txt >+src.includes = about.html,\ >+ asl-v20.txt >+jre.compilation.profile = J2SE-1.4 >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/plugin.properties b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/plugin.properties >new file mode 100644 >index 0000000..0964603 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/plugin.properties >@@ -0,0 +1,11 @@ >+############################################################################ >+# Copyright (c) 2007 Composent Inc., IBM Corp. 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 >+# >+############################################################################ >+plugin.name=ECF HttpClient Filetransfer Provider >+plugin.provider=Eclipse.org - ECF >+ >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/plugin.xml b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/plugin.xml >new file mode 100644 >index 0000000..292bb6e >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/plugin.xml >@@ -0,0 +1,32 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<?eclipse version="3.2"?> >+<plugin> >+ <extension >+ point="org.eclipse.ecf.provider.filetransfer.retrieveFileTransferProtocolFactory"> >+ <retrieveFileTransferProtocolFactory >+ class="org.eclipse.ecf.provider.filetransfer.httpclient.HttpClientRetrieveFileTransferFactory" >+ protocol="http" >+ priority="50"> >+ </retrieveFileTransferProtocolFactory> >+ <retrieveFileTransferProtocolFactory >+ class="org.eclipse.ecf.provider.filetransfer.httpclient.HttpClientRetrieveFileTransferFactory" >+ protocol="https" >+ priority="50"> >+ </retrieveFileTransferProtocolFactory> >+ </extension> >+ >+ <extension >+ point="org.eclipse.ecf.provider.filetransfer.browseFileTransferProtocolFactory"> >+ <browseFileTransferProtocolFactory >+ class="org.eclipse.ecf.provider.filetransfer.httpclient.HttpClientBrowseFileTransferFactory" >+ protocol="http" >+ priority="50"> >+ </browseFileTransferProtocolFactory> >+ <browseFileTransferProtocolFactory >+ class="org.eclipse.ecf.provider.filetransfer.httpclient.HttpClientBrowseFileTransferFactory" >+ protocol="https" >+ priority="50"> >+ </browseFileTransferProtocolFactory> >+ </extension> >+ >+</plugin> >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/Activator.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/Activator.java >new file mode 100644 >index 0000000..b34d342 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/Activator.java >@@ -0,0 +1,130 @@ >+/**************************************************************************** >+ * Copyright (c) 2007 IBM, Composent 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: >+ * Chris Aniszczyk - initial API and implementation >+ *****************************************************************************/ >+package org.eclipse.ecf.internal.provider.filetransfer.httpclient; >+ >+import javax.net.ssl.SSLSocketFactory; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.ecf.core.util.LogHelper; >+import org.osgi.framework.BundleActivator; >+import org.osgi.framework.BundleContext; >+import org.osgi.service.log.LogService; >+import org.osgi.util.tracker.ServiceTracker; >+ >+/** >+ * The activator class controls the plug-in life cycle >+ */ >+public class Activator implements BundleActivator { >+ >+ // The plug-in ID >+ public static final String PLUGIN_ID = "org.eclipse.ecf.provider.filetransfer.httpclient"; //$NON-NLS-1$ >+ >+ // The shared instance >+ private static Activator plugin; >+ private BundleContext context = null; >+ >+ private ServiceTracker logServiceTracker = null; >+ >+ private ServiceTracker sslSocketFactoryTracker; >+ >+ private ISSLSocketFactoryModifier sslSocketFactoryModifier; >+ >+ /** >+ * The constructor >+ */ >+ public Activator() { >+ // >+ } >+ >+ public BundleContext getContext() { >+ return context; >+ } >+ >+ public void start(BundleContext ctxt) throws Exception { >+ plugin = this; >+ this.context = ctxt; >+ // initialize the default sslSocketFactoryModifier. This instance is then used within HttpClientRetrieveFileTransfer.setupHostAndPort >+ // to set the socket factory for the specific proxy and httpclient instance >+ try { >+ Class socketFactoryModifierClass = Class.forName("org.eclipse.ecf.internal.provider.filetransfer.httpclient.ssl.SSLSocketFactoryModifier"); //$NON-NLS-1$ >+ sslSocketFactoryModifier = (ISSLSocketFactoryModifier) socketFactoryModifierClass.newInstance(); >+ } catch (ClassNotFoundException e) { >+ // will occur if fragment is not installed or not on proper execution environment >+ } catch (Throwable t) { >+ log(new Status(IStatus.ERROR, PLUGIN_ID, "Unexpected Error in Activator.start", t)); //$NON-NLS-1$ >+ } >+ >+ } >+ >+ public ISSLSocketFactoryModifier getSSLSocketFactoryModifier() { >+ return sslSocketFactoryModifier; >+ } >+ >+ public void stop(BundleContext ctxt) throws Exception { >+ if (sslSocketFactoryModifier != null) { >+ sslSocketFactoryModifier.dispose(); >+ sslSocketFactoryModifier = null; >+ } >+ >+ if (sslSocketFactoryTracker != null) { >+ sslSocketFactoryTracker.close(); >+ } >+ >+ if (logServiceTracker != null) { >+ logServiceTracker.close(); >+ } >+ this.context = null; >+ plugin = null; >+ } >+ >+ /** >+ * Returns the shared instance >+ * >+ * @return the shared instance >+ */ >+ public synchronized static Activator getDefault() { >+ if (plugin == null) { >+ plugin = new Activator(); >+ } >+ return plugin; >+ } >+ >+ protected LogService getLogService() { >+ if (logServiceTracker == null) { >+ logServiceTracker = new ServiceTracker(this.context, LogService.class.getName(), null); >+ logServiceTracker.open(); >+ } >+ return (LogService) logServiceTracker.getService(); >+ } >+ >+ public void log(IStatus status) { >+ LogService logService = getLogService(); >+ if (logService != null) { >+ logService.log(LogHelper.getLogCode(status), LogHelper.getLogMessage(status), status.getException()); >+ } >+ } >+ >+ public SSLSocketFactory getSSLSocketFactory() { >+ if (sslSocketFactoryTracker == null) { >+ sslSocketFactoryTracker = new ServiceTracker(this.context, SSLSocketFactory.class.getName(), null); >+ sslSocketFactoryTracker.open(); >+ } >+ return (SSLSocketFactory) sslSocketFactoryTracker.getService(); >+ } >+ >+ public static void logNoProxyWarning(Throwable e) { >+ Activator a = getDefault(); >+ if (a != null) { >+ a.log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, IStatus.ERROR, "Warning: Platform proxy API not available", e)); //$NON-NLS-1$ >+ } >+ } >+ >+} >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/CloseMonitoringSocket.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/CloseMonitoringSocket.java >new file mode 100644 >index 0000000..85bae32 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/CloseMonitoringSocket.java >@@ -0,0 +1,69 @@ >+/******************************************************************************* >+* Copyright (c) 2009 IBM, 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: >+* Thomas Joiner - extracted implementation from the Socket factories >+******************************************************************************/ >+ >+package org.eclipse.ecf.internal.provider.filetransfer.httpclient; >+ >+import java.io.IOException; >+import java.net.Socket; >+import javax.net.ssl.SSLSocket; >+import org.eclipse.ecf.core.util.Trace; >+import org.eclipse.ecf.filetransfer.events.socket.ISocketEvent; >+import org.eclipse.ecf.filetransfer.events.socket.ISocketEventSource; >+import org.eclipse.ecf.filetransfer.events.socket.ISocketListener; >+import org.eclipse.ecf.provider.filetransfer.events.socket.AbstractSocketWrapper; >+import org.eclipse.ecf.provider.filetransfer.events.socket.SocketClosedEvent; >+ >+class CloseMonitoringSocket extends AbstractSocketWrapper { >+ >+ private boolean closed = false; >+ private final ISocketListener spyListener; >+ private final ISocketEventSource source; >+ private Socket wrappedSocket; >+ >+ public CloseMonitoringSocket(Socket toWrap, ISocketListener spyListener, ISocketEventSource source) { >+ super(toWrap); >+ this.spyListener = spyListener; >+ this.source = source; >+ } >+ >+ public synchronized void close() throws IOException { >+ if (!closed) { >+ closed = true; >+ >+ try { >+ Trace.trace(Activator.PLUGIN_ID, "closing socket " + this.toString()); //$NON-NLS-1$ >+ super.close(); >+ } finally { >+ fireEvent(new SocketClosedEvent(source, getSocket(), (wrappedSocket != null ? wrappedSocket : this))); >+ } >+ } >+ } >+ >+ private void fireEvent(ISocketEvent event) { >+ if (spyListener != null) { >+ spyListener.handleSocketEvent(event); >+ } >+ event.getSource().fireEvent(event); >+ } >+ >+ public boolean isSecure() { >+ return getSocket() instanceof SSLSocket; >+ } >+ >+ Socket getWrappedSocket() { >+ return wrappedSocket; >+ } >+ >+ void setWrappedSocket(Socket wrappedSocket) { >+ this.wrappedSocket = wrappedSocket; >+ } >+ >+} >\ No newline at end of file >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/ConnectingSocketMonitor.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/ConnectingSocketMonitor.java >new file mode 100644 >index 0000000..39d8f5a >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/ConnectingSocketMonitor.java >@@ -0,0 +1,46 @@ >+/******************************************************************************* >+* Copyright (c) 2009 IBM, 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.ecf.internal.provider.filetransfer.httpclient; >+ >+import java.util.*; >+import org.eclipse.ecf.filetransfer.events.socket.*; >+ >+public class ConnectingSocketMonitor implements ISocketListener { >+ >+ private Map connectingSockets; >+ >+ public ConnectingSocketMonitor(int initialCapacity) { >+ connectingSockets = Collections.synchronizedMap(new HashMap(initialCapacity)); >+ } >+ >+ public ConnectingSocketMonitor() { >+ connectingSockets = Collections.synchronizedMap(new HashMap()); >+ } >+ >+ public Collection getConnectingSockets() { >+ return Collections.unmodifiableCollection(connectingSockets.keySet()); >+ } >+ >+ public void clear() { >+ connectingSockets.clear(); >+ } >+ >+ public void handleSocketEvent(ISocketEvent event) { >+ if (event instanceof ISocketCreatedEvent) { >+ connectingSockets.put(event.getFactorySocket(), event); >+ } else if (event instanceof ISocketConnectedEvent) { >+ connectingSockets.remove(event.getFactorySocket()); >+ } else if (event instanceof ISocketClosedEvent) { >+ connectingSockets.remove(event.getFactorySocket()); >+ } >+ } >+} >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/DebugOptions.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/DebugOptions.java >new file mode 100644 >index 0000000..d0b0274 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/DebugOptions.java >@@ -0,0 +1,23 @@ >+/******************************************************************************* >+ * Copyright (c) 2004 Composent, 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: Composent, Inc. - initial API and implementation >+ ******************************************************************************/ >+package org.eclipse.ecf.internal.provider.filetransfer.httpclient; >+ >+public interface DebugOptions { >+ >+ public static final String DEBUG = Activator.PLUGIN_ID + "/debug"; //$NON-NLS-1$ >+ >+ public static final String EXCEPTIONS_CATCHING = DEBUG + "/exceptions/catching"; //$NON-NLS-1$ >+ >+ public static final String EXCEPTIONS_THROWING = DEBUG + "/exceptions/throwing"; //$NON-NLS-1$ >+ >+ public static final String METHODS_ENTERING = DEBUG + "/methods/entering"; //$NON-NLS-1$ >+ >+ public static final String METHODS_EXITING = DEBUG + "/methods/exiting"; //$NON-NLS-1$ >+ >+} >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/ECFHttpClientProtocolSocketFactory.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/ECFHttpClientProtocolSocketFactory.java >new file mode 100644 >index 0000000..e2561e4 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/ECFHttpClientProtocolSocketFactory.java >@@ -0,0 +1,132 @@ >+/******************************************************************************* >+ * 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 >+ * Thomas Joiner - HttpClient 4 implementation >+ *******************************************************************************/ >+package org.eclipse.ecf.internal.provider.filetransfer.httpclient; >+ >+import java.io.IOException; >+import java.net.InetSocketAddress; >+import java.net.Socket; >+import java.net.UnknownHostException; >+import javax.net.SocketFactory; >+import javax.net.ssl.SSLSocket; >+import org.apache.http.conn.ConnectTimeoutException; >+import org.apache.http.conn.scheme.SchemeSocketFactory; >+import org.apache.http.params.CoreConnectionPNames; >+import org.apache.http.params.HttpParams; >+import org.eclipse.core.runtime.Assert; >+import org.eclipse.ecf.core.util.Trace; >+import org.eclipse.ecf.filetransfer.events.socket.ISocketEvent; >+import org.eclipse.ecf.filetransfer.events.socket.ISocketEventSource; >+import org.eclipse.ecf.filetransfer.events.socket.ISocketListener; >+import org.eclipse.ecf.filetransfer.events.socketfactory.INonconnectedSocketFactory; >+import org.eclipse.ecf.provider.filetransfer.events.socket.SocketClosedEvent; >+import org.eclipse.ecf.provider.filetransfer.events.socket.SocketConnectedEvent; >+import org.eclipse.ecf.provider.filetransfer.events.socket.SocketCreatedEvent; >+ >+public class ECFHttpClientProtocolSocketFactory implements SchemeSocketFactory { >+ >+ protected ISocketEventSource source; >+ private INonconnectedSocketFactory unconnectedFactory; >+ private ISocketListener socketConnectListener; >+ >+ private static final ISocketListener NULL_SOCKET_EVENT_LISTENER = new ISocketListener() { >+ public void handleSocketEvent(ISocketEvent event) { >+ //empty >+ } >+ }; >+ >+ public ECFHttpClientProtocolSocketFactory(INonconnectedSocketFactory unconnectedFactory, ISocketEventSource source, ISocketListener socketConnectListener) { >+ super(); >+ Assert.isNotNull(unconnectedFactory); >+ Assert.isNotNull(source); >+ this.unconnectedFactory = unconnectedFactory; >+ this.source = source; >+ this.socketConnectListener = socketConnectListener != null ? socketConnectListener : NULL_SOCKET_EVENT_LISTENER; >+ } >+ >+ public ECFHttpClientProtocolSocketFactory(final SocketFactory socketFactory, ISocketEventSource source, ISocketListener socketConnectListener) { >+ this(new INonconnectedSocketFactory() { >+ public Socket createSocket() throws IOException { >+ return socketFactory.createSocket(); >+ } >+ }, source, socketConnectListener); >+ } >+ >+ public Socket createSocket(HttpParams params) throws IOException { >+ Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, ECFHttpClientProtocolSocketFactory.class, "createSocket"); //$NON-NLS-1$ >+ >+ final Socket factorySocket = unconnectedFactory.createSocket(); >+ fireEvent(socketConnectListener, new SocketCreatedEvent(source, factorySocket)); >+ >+ Trace.exiting(Activator.PLUGIN_ID, DebugOptions.METHODS_EXITING, ECFHttpClientProtocolSocketFactory.class, "socketCreated " + factorySocket); //$NON-NLS-1$ >+ >+ return factorySocket; >+ } >+ >+ public Socket connectSocket(final Socket sock, InetSocketAddress remoteAddress, InetSocketAddress localAddress, HttpParams params) throws IOException, UnknownHostException, ConnectTimeoutException { >+ int timeout = params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0); >+ >+ Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, ECFHttpClientProtocolSocketFactory.class, "connectSocket " + remoteAddress.toString() + " timeout=" + timeout); //$NON-NLS-1$ //$NON-NLS-2$ >+ >+ try { >+ // Use String.valueOf to protect against null >+ Trace.trace(Activator.PLUGIN_ID, "bind(" + String.valueOf(localAddress) + ")"); //$NON-NLS-1$//$NON-NLS-2$ >+ sock.bind(localAddress); >+ Trace.trace(Activator.PLUGIN_ID, "connect(" + remoteAddress.toString() + ", " + timeout + ")"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ >+ sock.connect(remoteAddress, timeout); >+ Trace.trace(Activator.PLUGIN_ID, "connected"); //$NON-NLS-1$ >+ } catch (IOException e) { >+ Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, ECFHttpClientProtocolSocketFactory.class, "createSocket", e); //$NON-NLS-1$ >+ fireEvent(socketConnectListener, new SocketClosedEvent(source, sock, sock)); >+ Trace.throwing(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_THROWING, ECFHttpClientProtocolSocketFactory.class, "createSocket", e); //$NON-NLS-1$ >+ throw e; >+ } >+ >+ Socket toReturn; >+ Socket wrapped = new CloseMonitoringSocket(sock, socketConnectListener, source); >+ >+ SocketConnectedEvent connectedEvent = new SocketConnectedEvent(source, sock, wrapped); >+ fireEvent(socketConnectListener, connectedEvent); >+ >+ // Change the wrapped socket if one of the receivers of the SocketConnectedEvent changed it >+ if (connectedEvent.getSocket() != wrapped) { >+ toReturn = connectedEvent.getSocket(); >+ ((CloseMonitoringSocket) wrapped).setWrappedSocket(toReturn); >+ } else { >+ toReturn = wrapped; >+ } >+ >+ return toReturn; >+ } >+ >+ private static void fireEvent(final ISocketListener spyListener, ISocketEvent event) { >+ if (spyListener != null) { >+ spyListener.handleSocketEvent(event); >+ } >+ event.getSource().fireEvent(event); >+ } >+ >+ public boolean isSecure(Socket sock) throws IllegalArgumentException { >+ if (sock instanceof SSLSocket) { >+ throw new IllegalArgumentException("Socket not created by this factory."); //$NON-NLS-1$ >+ } >+ >+ return false; >+ } >+ >+ public boolean equals(Object obj) { >+ return (obj instanceof ECFHttpClientProtocolSocketFactory); >+ } >+ >+ public int hashCode() { >+ return ECFHttpClientProtocolSocketFactory.class.hashCode(); >+ } >+} >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/ECFHttpClientSecureProtocolSocketFactory.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/ECFHttpClientSecureProtocolSocketFactory.java >new file mode 100644 >index 0000000..4b49bb8 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/ECFHttpClientSecureProtocolSocketFactory.java >@@ -0,0 +1,176 @@ >+/******************************************************************************* >+ * 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 >+ * Thomas Joiner - HttpClient 4 implementation >+ *******************************************************************************/ >+package org.eclipse.ecf.internal.provider.filetransfer.httpclient; >+ >+import java.io.IOException; >+import java.net.InetSocketAddress; >+import java.net.Socket; >+import java.net.SocketException; >+import java.net.UnknownHostException; >+import javax.net.ssl.SSLSocket; >+import javax.net.ssl.SSLSocketFactory; >+import org.apache.http.conn.ConnectTimeoutException; >+import org.apache.http.conn.scheme.LayeredSchemeSocketFactory; >+import org.apache.http.params.HttpConnectionParams; >+import org.apache.http.params.HttpParams; >+import org.eclipse.ecf.core.util.Trace; >+import org.eclipse.ecf.filetransfer.events.socket.ISocketEvent; >+import org.eclipse.ecf.filetransfer.events.socket.ISocketEventSource; >+import org.eclipse.ecf.filetransfer.events.socket.ISocketListener; >+import org.eclipse.ecf.provider.filetransfer.events.socket.SocketClosedEvent; >+import org.eclipse.ecf.provider.filetransfer.events.socket.SocketConnectedEvent; >+import org.eclipse.ecf.provider.filetransfer.events.socket.SocketCreatedEvent; >+ >+public final class ECFHttpClientSecureProtocolSocketFactory implements LayeredSchemeSocketFactory { >+ >+ private final SSLSocketFactory sslSocketFactory; >+ private final ISocketEventSource source; >+ private final ISocketListener socketConnectListener; >+ >+ public ECFHttpClientSecureProtocolSocketFactory(final SSLSocketFactory sslSocketFactory, ISocketEventSource source, ISocketListener socketConnectListener) { >+ this.sslSocketFactory = sslSocketFactory; >+ this.source = source; >+ this.socketConnectListener = socketConnectListener; >+ } >+ >+ public Socket createSocket(final HttpParams params) { >+ Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, ECFHttpClientSecureProtocolSocketFactory.class, "createSocket"); //$NON-NLS-1$ >+ >+ Socket socket = new Socket(); >+ fireEvent(socketConnectListener, new SocketCreatedEvent(source, socket)); >+ >+ Trace.exiting(Activator.PLUGIN_ID, DebugOptions.METHODS_EXITING, ECFHttpClientSecureProtocolSocketFactory.class, "socketCreated " + socket); //$NON-NLS-1$ >+ return socket; >+ } >+ >+ public Socket connectSocket(final Socket socket, final InetSocketAddress remoteAddress, final InetSocketAddress localAddress, final HttpParams params) throws IOException, UnknownHostException, ConnectTimeoutException { >+ if (remoteAddress == null) { >+ throw new IllegalArgumentException("Remote address must not be null"); //$NON-NLS-1$ >+ } >+ if (params == null) { >+ throw new IllegalArgumentException("HTTP parameters must not be null"); //$NON-NLS-1$ >+ } >+ >+ if (socket == null) { >+ SSLSocket sslSocket = (SSLSocket) this.sslSocketFactory.createSocket(); >+ >+ performConnection(sslSocket, remoteAddress, localAddress, params); >+ >+ return wrapSocket(sslSocket); >+ } else if (socket instanceof SSLSocket) { >+ performConnection(socket, remoteAddress, localAddress, params); >+ >+ return wrapSocket(socket); >+ } >+ >+ // If we were given a unconnected socket, we need to connect it first >+ if (!socket.isConnected()) { >+ performConnection(socket, remoteAddress, localAddress, params); >+ } >+ >+ Socket layeredSocket = this.sslSocketFactory.createSocket(socket, remoteAddress.getHostName(), remoteAddress.getPort(), true); >+ >+ return wrapSocket(layeredSocket); >+ } >+ >+ private void performConnection(final Socket socket, final InetSocketAddress remoteAddress, final InetSocketAddress localAddress, final HttpParams params) throws SocketException, IOException { >+ try { >+ socket.setReuseAddress(HttpConnectionParams.getSoReuseaddr(params)); >+ socket.bind(localAddress); >+ >+ int connectionTimeout = HttpConnectionParams.getConnectionTimeout(params); >+ int socketTimeout = HttpConnectionParams.getSoTimeout(params); >+ >+ socket.connect(remoteAddress, connectionTimeout); >+ socket.setSoTimeout(socketTimeout); >+ } catch (SocketException e) { >+ Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, ECFHttpClientSecureProtocolSocketFactory.class, "performConnection", e); //$NON-NLS-1$ >+ fireEvent(this.socketConnectListener, new SocketClosedEvent(source, socket, socket)); >+ Trace.throwing(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_THROWING, ECFHttpClientSecureProtocolSocketFactory.class, "performConnection", e); //$NON-NLS-1$ >+ throw e; >+ } catch (IOException e) { >+ Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, ECFHttpClientSecureProtocolSocketFactory.class, "performConnection", e); //$NON-NLS-1$ >+ fireEvent(this.socketConnectListener, new SocketClosedEvent(source, socket, socket)); >+ Trace.throwing(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_THROWING, ECFHttpClientSecureProtocolSocketFactory.class, "performConnection", e); //$NON-NLS-1$ >+ throw e; >+ } >+ } >+ >+ public boolean isSecure(final Socket sock) throws IllegalArgumentException { >+ if (sock == null) { >+ throw new IllegalArgumentException("Socket must not be null"); //$NON-NLS-1$ >+ } >+ >+ if (sock instanceof CloseMonitoringSocket) { >+ return ((CloseMonitoringSocket) sock).isSecure(); >+ } >+ >+ if (!(sock instanceof SSLSocket)) { >+ throw new IllegalArgumentException("Socket not created by this factory"); //$NON-NLS-1$ >+ } >+ >+ if (sock.isClosed()) { >+ throw new IllegalArgumentException("Socket is closed"); //$NON-NLS-1$ >+ } >+ >+ return true; >+ } >+ >+ public Socket createLayeredSocket(final Socket socket, final String host, final int port, final boolean autoClose) throws IOException { >+ Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, ECFHttpClientSecureProtocolSocketFactory.class, "createLayeredSocket " + host + ":" + port + ",socket=" + socket); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ SSLSocket sslSocket = null; >+ try { >+ Trace.trace(Activator.PLUGIN_ID, "connectingLayeredSocket(original=" + socket + ",dest=" + host + ":" + port + ")"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$ >+ sslSocket = (SSLSocket) this.sslSocketFactory.createSocket(socket, host, port, autoClose); >+ Trace.trace(Activator.PLUGIN_ID, "connected"); //$NON-NLS-1$ >+ } catch (IOException e) { >+ Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, ECFHttpClientSecureProtocolSocketFactory.class, "createLayeredSocket", e); //$NON-NLS-1$ >+ fireEvent(this.socketConnectListener, new SocketClosedEvent(source, sslSocket, sslSocket)); >+ Trace.throwing(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_THROWING, ECFHttpClientSecureProtocolSocketFactory.class, "createSocket", e); //$NON-NLS-1$ >+ throw e; >+ } >+ >+ return wrapSocket(sslSocket); >+ } >+ >+ private Socket wrapSocket(Socket toWrap) { >+ CloseMonitoringSocket wrappedSocket = new CloseMonitoringSocket(toWrap, socketConnectListener, source); >+ >+ SocketConnectedEvent connectedEvent = new SocketConnectedEvent(source, toWrap, wrappedSocket); >+ fireEvent(socketConnectListener, connectedEvent); >+ >+ // Change the wrapped socket if one of the receivers of the SocketConnectedEvent changed it >+ Socket connectedEventSocket = connectedEvent.getSocket(); >+ if (connectedEventSocket != wrappedSocket) { >+ wrappedSocket.setWrappedSocket(connectedEventSocket); >+ return connectedEventSocket; >+ } >+ >+ return wrappedSocket; >+ } >+ >+ static void fireEvent(final ISocketListener spyListener, ISocketEvent event) { >+ if (spyListener != null) { >+ spyListener.handleSocketEvent(event); >+ } >+ event.getSource().fireEvent(event); >+ } >+ >+ public boolean equals(Object obj) { >+ return ((obj != null) && obj.getClass().equals(ECFHttpClientSecureProtocolSocketFactory.class)); >+ } >+ >+ public int hashCode() { >+ return ECFHttpClientSecureProtocolSocketFactory.class.hashCode(); >+ } >+ >+} >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/HttpClientProxyCredentialProvider.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/HttpClientProxyCredentialProvider.java >new file mode 100644 >index 0000000..0bf0a1b >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/HttpClientProxyCredentialProvider.java >@@ -0,0 +1,77 @@ >+/******************************************************************************* >+ * 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 >+ * Thomas Joiner - HttpClient 4 implementation >+ *******************************************************************************/ >+package org.eclipse.ecf.internal.provider.filetransfer.httpclient; >+ >+import java.util.HashMap; >+import java.util.Map; >+import org.apache.http.auth.AuthScope; >+import org.apache.http.auth.Credentials; >+import org.apache.http.auth.UsernamePasswordCredentials; >+import org.apache.http.client.CredentialsProvider; >+import org.eclipse.ecf.core.util.Proxy; >+import org.eclipse.ecf.core.util.Trace; >+ >+public abstract class HttpClientProxyCredentialProvider implements CredentialsProvider { >+ >+ abstract protected Proxy getECFProxy(); >+ >+ abstract protected Credentials getNTLMCredentials(Proxy proxy); >+ >+ private Map cachedCredentials; >+ >+ public HttpClientProxyCredentialProvider() { >+ cachedCredentials = new HashMap(); >+ } >+ >+ public void setCredentials(AuthScope authscope, Credentials credentials) { >+ this.cachedCredentials.put(authscope, credentials); >+ } >+ >+ public Credentials getCredentials(AuthScope authscope) { >+ Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, HttpClientProxyCredentialProvider.class, "getCredentials " + authscope); //$NON-NLS-1$ >+ >+ if (this.cachedCredentials.containsKey(authscope)) { >+ return (Credentials) this.cachedCredentials.get(authscope); >+ } >+ >+ Proxy proxy = getECFProxy(); >+ if (proxy == null) { >+ return null; >+ } >+ >+ Credentials credentials = null; >+ if ("ntlm".equalsIgnoreCase(authscope.getScheme())) { //$NON-NLS-1$ >+ credentials = getNTLMCredentials(proxy); >+ } else if ("basic".equalsIgnoreCase(authscope.getScheme()) || //$NON-NLS-1$ >+ "digest".equalsIgnoreCase(authscope.getScheme())) { //$NON-NLS-1$ >+ final String proxyUsername = proxy.getUsername(); >+ final String proxyPassword = proxy.getPassword(); >+ if (proxyUsername != null) { >+ credentials = new UsernamePasswordCredentials(proxyUsername, proxyPassword); >+ } >+ } else if ("negotiate".equalsIgnoreCase(authscope.getScheme())) { //$NON-NLS-1$ >+ Trace.trace(Activator.PLUGIN_ID, "SPNEGO is not supported, if you can contribute support, please do so."); //$NON-NLS-1$ >+ } else { >+ Trace.trace(Activator.PLUGIN_ID, "Unrecognized authentication scheme."); //$NON-NLS-1$ >+ } >+ >+ if (credentials != null) { >+ cachedCredentials.put(authscope, credentials); >+ } >+ >+ return credentials; >+ } >+ >+ public void clear() { >+ this.cachedCredentials.clear(); >+ } >+} >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/ISSLSocketFactoryModifier.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/ISSLSocketFactoryModifier.java >new file mode 100644 >index 0000000..3aa946c >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/ISSLSocketFactoryModifier.java >@@ -0,0 +1,30 @@ >+/**************************************************************************** >+ * Copyright (c) 2008, 2009 Composent, Inc., IBM 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: >+ * Composent, Inc. - initial API and implementation >+ * Henrich Kraemer - bug 263869, testHttpsReceiveFile fails using HTTP proxy >+ *****************************************************************************/ >+ >+package org.eclipse.ecf.internal.provider.filetransfer.httpclient; >+ >+import java.io.IOException; >+import javax.net.ssl.SSLSocketFactory; >+import org.eclipse.ecf.filetransfer.events.socketfactory.INonconnectedSocketFactory; >+ >+/** >+ * Internal interface to allow for use of httpclient.ssl provided socket factory >+ */ >+public interface ISSLSocketFactoryModifier { >+ >+ public SSLSocketFactory getSSLSocketFactory() throws IOException; >+ >+ public INonconnectedSocketFactory getNonconnnectedSocketFactory(); >+ >+ public void dispose(); >+ >+} >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/ISocketConnectionCallback.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/ISocketConnectionCallback.java >new file mode 100644 >index 0000000..1e7f409 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/ISocketConnectionCallback.java >@@ -0,0 +1,24 @@ >+/******************************************************************************* >+* Copyright (c) 2009 IBM, 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.ecf.internal.provider.filetransfer.httpclient; >+ >+import java.io.IOException; >+import java.net.Socket; >+ >+public interface ISocketConnectionCallback { >+ void onSocketCreated(Socket socket); >+ >+ void onSocketConnected(Socket socket); >+ >+ void onSocketConnectionFailed(Socket socket, IOException e); >+ >+} >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/Messages.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/Messages.java >new file mode 100644 >index 0000000..df247f0 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/Messages.java >@@ -0,0 +1,46 @@ >+/**************************************************************************** >+ * Copyright (c) 2007 IBM, Composent 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: >+ * Composent, Inc. - initial API and implementation >+ *****************************************************************************/ >+ >+package org.eclipse.ecf.internal.provider.filetransfer.httpclient; >+ >+import org.eclipse.osgi.util.NLS; >+ >+/** >+ * >+ */ >+public class Messages extends NLS { >+ private static final String BUNDLE_NAME = "org.eclipse.ecf.internal.provider.filetransfer.httpclient.messages"; //$NON-NLS-1$ >+ public static String FileTransferNamespace_Http_Protocol; >+ public static String FileTransferNamespace_Https_Protocol; >+ public static String HttpClientRetrieveFileTransfer_CONNECTING_JOB_NAME; >+ public static String HttpClientRetrieveFileTransfer_CONNECTING_TASK_NAME; >+ public static String HttpClientRetrieveFileTransfer_Proxy_Auth_Required; >+ public static String HttpClientRetrieveFileTransfer_Unauthorized; >+ public static String HttpClientRetrieveFileTransfer_Username_Prefix; >+ public static String HttpClientRetrieveFileTransfer_RESUME_START_POSITION_LESS_THAN_ZERO; >+ public static String HttpClientRetrieveFileTransfer_ERROR_GENERAL_RESPONSE_CODE; >+ public static String HttpClientRetrieveFileTransfer_EXCEPITION_INVALID_LAST_MODIFIED_FROM_SERVER; >+ public static String HttpClientRetrieveFileTransfer_EXCEPTION_FILE_MODIFIED_SINCE_LAST_ACCESS; >+ public static String HttpClientRetrieveFileTransfer_RESUME_ERROR_END_POSITION_LESS_THAN_START; >+ public static String HttpClientRetrieveFileTransfer_EXCEPTION_COULD_NOT_CONNECT; >+ public static String HttpClientRetrieveFileTransfer_INVALID_LAST_MODIFIED_TIME; >+ public static String HttpClientRetrieveFileTransfer_INVALID_SERVER_RESPONSE_TO_PARTIAL_RANGE_REQUEST; >+ public static String HttpClientRetrieveFileTransfer_RESUME_START_ERROR; >+ >+ static { >+ // initialize resource bundle >+ NLS.initializeMessages(BUNDLE_NAME, Messages.class); >+ } >+ >+ private Messages() { >+ // Generated >+ } >+} >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/messages.properties b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/messages.properties >new file mode 100644 >index 0000000..34ea9f9 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/messages.properties >@@ -0,0 +1,16 @@ >+HttpClientRetrieveFileTransfer_CONNECTING_JOB_NAME=: connecting. >+HttpClientRetrieveFileTransfer_CONNECTING_TASK_NAME=\ Connecting >+HttpClientRetrieveFileTransfer_Username_Prefix=Username: >+HttpClientRetrieveFileTransfer_Unauthorized=Unauthorized >+HttpClientRetrieveFileTransfer_Proxy_Auth_Required=Proxy Authentication Required >+FileTransferNamespace_Http_Protocol=http >+FileTransferNamespace_Https_Protocol=https >+HttpClientRetrieveFileTransfer_RESUME_START_POSITION_LESS_THAN_ZERO=start position cannot be less then 0 >+HttpClientRetrieveFileTransfer_ERROR_GENERAL_RESPONSE_CODE=HttpClient connection error response code {0}. >+HttpClientRetrieveFileTransfer_EXCEPITION_INVALID_LAST_MODIFIED_FROM_SERVER=Invalid last modified value >+HttpClientRetrieveFileTransfer_EXCEPTION_FILE_MODIFIED_SINCE_LAST_ACCESS=file modified since last access >+HttpClientRetrieveFileTransfer_RESUME_ERROR_END_POSITION_LESS_THAN_START=end position cannot be less than or equal to start position >+HttpClientRetrieveFileTransfer_EXCEPTION_COULD_NOT_CONNECT=Could not connect to {0} >+HttpClientRetrieveFileTransfer_INVALID_LAST_MODIFIED_TIME=Invalid last modified time from response header >+HttpClientRetrieveFileTransfer_INVALID_SERVER_RESPONSE_TO_PARTIAL_RANGE_REQUEST=invalid server response to partial range request >+HttpClientRetrieveFileTransfer_RESUME_START_ERROR=resume start error >\ No newline at end of file >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientBrowseFileTransferFactory.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientBrowseFileTransferFactory.java >new file mode 100644 >index 0000000..1c94809 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientBrowseFileTransferFactory.java >@@ -0,0 +1,72 @@ >+/**************************************************************************** >+ * Copyright (c) 2007 IBM, Composent 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: >+ * Composent, Inc. - initial API and implementation >+ * Thomas Joiner - HttpClient 4 implementation >+ *****************************************************************************/ >+package org.eclipse.ecf.provider.filetransfer.httpclient; >+ >+import java.net.MalformedURLException; >+import java.net.URL; >+import org.apache.http.impl.client.DefaultHttpClient; >+import org.eclipse.core.runtime.Assert; >+import org.eclipse.ecf.core.identity.IDFactory; >+import org.eclipse.ecf.core.identity.Namespace; >+import org.eclipse.ecf.core.security.IConnectContext; >+import org.eclipse.ecf.core.util.Proxy; >+import org.eclipse.ecf.filetransfer.IRemoteFileSystemListener; >+import org.eclipse.ecf.filetransfer.IRemoteFileSystemRequest; >+import org.eclipse.ecf.filetransfer.RemoteFileSystemException; >+import org.eclipse.ecf.filetransfer.identity.IFileID; >+import org.eclipse.ecf.filetransfer.service.IRemoteFileSystemBrowser; >+import org.eclipse.ecf.filetransfer.service.IRemoteFileSystemBrowserFactory; >+import org.eclipse.ecf.provider.filetransfer.identity.FileTransferNamespace; >+import org.eclipse.osgi.util.NLS; >+ >+public class HttpClientBrowseFileTransferFactory implements IRemoteFileSystemBrowserFactory { >+ >+ public IRemoteFileSystemBrowser newInstance() { >+ return new IRemoteFileSystemBrowser() { >+ >+ private Proxy proxy; >+ private IConnectContext connectContext; >+ >+ public Namespace getBrowseNamespace() { >+ return IDFactory.getDefault().getNamespaceByName(FileTransferNamespace.PROTOCOL); >+ } >+ >+ public IRemoteFileSystemRequest sendBrowseRequest(IFileID directoryOrFileId, IRemoteFileSystemListener listener) throws RemoteFileSystemException { >+ Assert.isNotNull(directoryOrFileId); >+ Assert.isNotNull(listener); >+ URL url; >+ try { >+ url = directoryOrFileId.getURL(); >+ } catch (final MalformedURLException e) { >+ throw new RemoteFileSystemException(NLS.bind("Exception creating URL for {0}", directoryOrFileId)); //$NON-NLS-1$ >+ } >+ >+ HttpClientFileSystemBrowser browser = new HttpClientFileSystemBrowser(new DefaultHttpClient(), directoryOrFileId, listener, url, connectContext, proxy); >+ return browser.sendBrowseRequest(); >+ } >+ >+ public void setConnectContextForAuthentication(IConnectContext connectContext) { >+ this.connectContext = connectContext; >+ } >+ >+ public void setProxy(Proxy proxy) { >+ this.proxy = proxy; >+ } >+ >+ public Object getAdapter(Class adapter) { >+ return null; >+ } >+ >+ }; >+ >+ } >+} >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientDefaultSSLSocketFactoryModifier.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientDefaultSSLSocketFactoryModifier.java >new file mode 100644 >index 0000000..25c55eb >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientDefaultSSLSocketFactoryModifier.java >@@ -0,0 +1,78 @@ >+/**************************************************************************** >+ * Copyright (c) 2004, 2009 Composent, Inc., IBM 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: >+ * Composent, Inc. - initial API and implementation >+ * Henrich Kraemer - bug 263869, testHttpsReceiveFile fails using HTTP proxy >+ *****************************************************************************/ >+ >+package org.eclipse.ecf.provider.filetransfer.httpclient; >+ >+import java.io.IOException; >+import java.net.Socket; >+import javax.net.ssl.SSLContext; >+import javax.net.ssl.SSLSocketFactory; >+import javax.net.ssl.TrustManager; >+import org.eclipse.ecf.core.util.StringUtils; >+import org.eclipse.ecf.filetransfer.events.socketfactory.INonconnectedSocketFactory; >+import org.eclipse.ecf.internal.provider.filetransfer.httpclient.ISSLSocketFactoryModifier; >+ >+public class HttpClientDefaultSSLSocketFactoryModifier implements ISSLSocketFactoryModifier, INonconnectedSocketFactory { >+ public static final String DEFAULT_SSL_PROTOCOL = "https.protocols"; //$NON-NLS-1$ >+ >+ private SSLContext sslContext = null; >+ >+ private String defaultProtocolNames = System.getProperty(DEFAULT_SSL_PROTOCOL); >+ >+ public HttpClientDefaultSSLSocketFactoryModifier() { >+ // empty >+ } >+ >+ public SSLSocketFactory getSSLSocketFactory() throws IOException { >+ if (null == sslContext) { >+ try { >+ sslContext = getSSLContext(defaultProtocolNames); >+ } catch (Exception e) { >+ IOException ioe = new IOException(); >+ ioe.initCause(e); >+ throw ioe; >+ } >+ } >+ return (sslContext == null) ? (SSLSocketFactory) SSLSocketFactory.getDefault() : sslContext.getSocketFactory(); >+ } >+ >+ public SSLContext getSSLContext(String protocols) { >+ SSLContext rtvContext = null; >+ >+ if (protocols != null) { >+ String protocolNames[] = StringUtils.split(protocols, ","); //$NON-NLS-1$ >+ for (int i = 0; i < protocolNames.length; i++) { >+ try { >+ rtvContext = SSLContext.getInstance(protocolNames[i]); >+ sslContext.init(null, new TrustManager[] {new HttpClientSslTrustManager()}, null); >+ break; >+ } catch (Exception e) { >+ // just continue >+ } >+ } >+ } >+ return rtvContext; >+ } >+ >+ public Socket createSocket() throws IOException { >+ return getSSLSocketFactory().createSocket(); >+ } >+ >+ public void dispose() { >+ // empty >+ } >+ >+ public INonconnectedSocketFactory getNonconnnectedSocketFactory() { >+ return this; >+ } >+ >+} >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientFileSystemBrowser.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientFileSystemBrowser.java >new file mode 100644 >index 0000000..e1a217e >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientFileSystemBrowser.java >@@ -0,0 +1,376 @@ >+/**************************************************************************** >+ * Copyright (c) 2008, 2010 Composent, Inc., IBM 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: >+ * Composent, Inc. - initial API and implementation >+ * Henrich Kraemer - bug 263869, testHttpsReceiveFile fails using HTTP proxy >+ * Thomas Joiner - HttpClient 4 implementation >+ *****************************************************************************/ >+ >+package org.eclipse.ecf.provider.filetransfer.httpclient; >+ >+import java.io.IOException; >+import java.net.HttpURLConnection; >+import java.net.Socket; >+import java.net.URL; >+import java.util.ArrayList; >+import java.util.Iterator; >+import java.util.List; >+import org.apache.http.Header; >+import org.apache.http.HttpHost; >+import org.apache.http.HttpResponse; >+import org.apache.http.auth.AuthScope; >+import org.apache.http.auth.Credentials; >+import org.apache.http.auth.UsernamePasswordCredentials; >+import org.apache.http.auth.params.AuthPNames; >+import org.apache.http.client.HttpClient; >+import org.apache.http.client.methods.HttpHead; >+import org.apache.http.client.params.AuthPolicy; >+import org.apache.http.conn.params.ConnRouteParams; >+import org.apache.http.impl.client.DefaultHttpClient; >+import org.apache.http.impl.cookie.DateUtils; >+import org.apache.http.params.CoreConnectionPNames; >+import org.apache.http.protocol.BasicHttpContext; >+import org.apache.http.protocol.HttpContext; >+import org.eclipse.core.runtime.Assert; >+import org.eclipse.ecf.core.security.Callback; >+import org.eclipse.ecf.core.security.CallbackHandler; >+import org.eclipse.ecf.core.security.IConnectContext; >+import org.eclipse.ecf.core.security.NameCallback; >+import org.eclipse.ecf.core.security.ObjectCallback; >+import org.eclipse.ecf.core.security.UnsupportedCallbackException; >+import org.eclipse.ecf.core.util.Proxy; >+import org.eclipse.ecf.core.util.ProxyAddress; >+import org.eclipse.ecf.core.util.Trace; >+import org.eclipse.ecf.filetransfer.BrowseFileTransferException; >+import org.eclipse.ecf.filetransfer.IRemoteFile; >+import org.eclipse.ecf.filetransfer.IRemoteFileSystemListener; >+import org.eclipse.ecf.filetransfer.IRemoteFileSystemRequest; >+import org.eclipse.ecf.filetransfer.identity.IFileID; >+import org.eclipse.ecf.internal.provider.filetransfer.httpclient.Activator; >+import org.eclipse.ecf.internal.provider.filetransfer.httpclient.ConnectingSocketMonitor; >+import org.eclipse.ecf.internal.provider.filetransfer.httpclient.DebugOptions; >+import org.eclipse.ecf.internal.provider.filetransfer.httpclient.HttpClientProxyCredentialProvider; >+import org.eclipse.ecf.internal.provider.filetransfer.httpclient.Messages; >+import org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser; >+import org.eclipse.ecf.provider.filetransfer.browse.URLRemoteFile; >+import org.eclipse.ecf.provider.filetransfer.events.socket.SocketEventSource; >+import org.eclipse.ecf.provider.filetransfer.util.JREProxyHelper; >+import org.eclipse.ecf.provider.filetransfer.util.ProxySetupHelper; >+import org.eclipse.osgi.util.NLS; >+ >+/** >+ * >+ */ >+public class HttpClientFileSystemBrowser extends AbstractFileSystemBrowser { >+ >+ private static final String CONTENT_LENGTH_HEADER = "Content-Length"; //$NON-NLS-1$ >+ >+ // changing to 2 minutes (120000) as per bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=266246 >+ // 10/26/2009: Added being able to set with system property with name org.eclipse.ecf.provider.filetransfer.httpclient.browse.connectTimeout >+ // for https://bugs.eclipse.org/bugs/show_bug.cgi?id=292995 >+ protected static final int DEFAULT_CONNECTION_TIMEOUT = HttpClientOptions.BROWSE_DEFAULT_CONNECTION_TIMEOUT; >+ >+ private static final String USERNAME_PREFIX = "Username:"; //$NON-NLS-1$ >+ >+ private JREProxyHelper proxyHelper = null; >+ >+ private ConnectingSocketMonitor connectingSockets; >+ >+ protected String username = null; >+ >+ protected String password = null; >+ >+ protected DefaultHttpClient httpClient = null; >+ >+ protected volatile HttpHead headMethod; >+ >+ /** >+ * This is the response returned by {@link HttpClient} when it executes >+ * {@link #headMethod}. >+ * @since 5.0 >+ */ >+ protected volatile HttpResponse httpResponse; >+ >+ /** >+ * This is the context used to retain information about the request that >+ * the {@link HttpClient} gathers during the request. >+ * @since 5.0 >+ */ >+ protected volatile HttpContext httpContext; >+ >+ /** >+ * @param directoryOrFileID >+ * @param listener >+ * @since 5.0 >+ */ >+ public HttpClientFileSystemBrowser(DefaultHttpClient httpClient, IFileID directoryOrFileID, IRemoteFileSystemListener listener, URL directoryOrFileURL, IConnectContext connectContext, Proxy proxy) { >+ super(directoryOrFileID, listener, directoryOrFileURL, connectContext, proxy); >+ Assert.isNotNull(httpClient); >+ this.httpClient = httpClient; >+ this.httpClient.setCredentialsProvider(new HttpClientProxyCredentialProvider() { >+ >+ protected Proxy getECFProxy() { >+ return getProxy(); >+ } >+ >+ protected Credentials getNTLMCredentials(Proxy lp) { >+ if (hasForceNTLMProxyOption()) >+ return HttpClientRetrieveFileTransfer.createNTLMCredentials(lp); >+ return null; >+ } >+ >+ }); >+ this.proxyHelper = new JREProxyHelper(); >+ this.connectingSockets = new ConnectingSocketMonitor(1); >+ >+ prepareAuth(); >+ } >+ >+ private void prepareAuth() { >+ // SPNEGO is not supported, so remove it from the list >+ List authpref = new ArrayList(3); >+ authpref.add(AuthPolicy.NTLM); >+ authpref.add(AuthPolicy.DIGEST); >+ authpref.add(AuthPolicy.BASIC); >+ >+ httpClient.getParams().setParameter(AuthPNames.PROXY_AUTH_PREF, authpref); >+ httpClient.getParams().setParameter(AuthPNames.TARGET_AUTH_PREF, authpref); >+ } >+ >+ class HttpClientRemoteFileSystemRequest extends RemoteFileSystemRequest { >+ protected SocketEventSource socketEventSource; >+ >+ HttpClientRemoteFileSystemRequest() { >+ this.socketEventSource = new SocketEventSource() { >+ public Object getAdapter(Class adapter) { >+ if (adapter == null) { >+ return null; >+ } >+ if (adapter.isInstance(this)) { >+ return this; >+ } >+ if (adapter.isInstance(HttpClientRemoteFileSystemRequest.this)) { >+ return HttpClientRemoteFileSystemRequest.this; >+ } >+ return null; >+ } >+ }; >+ } >+ >+ public Object getAdapter(Class adapter) { >+ if (adapter == null) { >+ return null; >+ } >+ return socketEventSource.getAdapter(adapter); >+ } >+ >+ public void cancel() { >+ HttpClientFileSystemBrowser.this.cancel(); >+ } >+ } >+ >+ protected IRemoteFileSystemRequest createRemoteFileSystemRequest() { >+ return new HttpClientRemoteFileSystemRequest(); >+ } >+ >+ protected void cancel() { >+ if (isCanceled()) { >+ return; // break job cancel recursion >+ } >+ setCanceled(getException()); >+ super.cancel(); >+ if (headMethod != null) { >+ if (!headMethod.isAborted()) { >+ headMethod.abort(); >+ } >+ } >+ if (connectingSockets != null) { >+ // this should unblock socket connect calls, if any >+ for (Iterator iterator = connectingSockets.getConnectingSockets().iterator(); iterator.hasNext();) { >+ Socket socket = (Socket) iterator.next(); >+ try { >+ socket.close(); >+ } catch (IOException e) { >+ Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, this.getClass(), "cancel", e); //$NON-NLS-1$ >+ } >+ } >+ } >+ >+ } >+ >+ protected boolean hasForceNTLMProxyOption() { >+ return (System.getProperties().getProperty(HttpClientOptions.FORCE_NTLM_PROP) != null); >+ } >+ >+ protected void setupProxies() { >+ // If it's been set directly (via ECF API) then this overrides platform settings >+ if (proxy == null) { >+ try { >+ // give SOCKS priority see https://bugs.eclipse.org/bugs/show_bug.cgi?id=295030#c61 >+ proxy = ProxySetupHelper.getSocksProxy(directoryOrFile); >+ if (proxy == null) { >+ proxy = ProxySetupHelper.getProxy(directoryOrFile.toExternalForm()); >+ } >+ } catch (NoClassDefFoundError e) { >+ // If the proxy API is not available a NoClassDefFoundError will be thrown here. >+ // If that happens then we just want to continue on. >+ Activator.logNoProxyWarning(e); >+ >+ } >+ } >+ if (proxy != null) >+ setupProxy(proxy); >+ } >+ >+ protected void cleanUp() { >+ clearProxy(); >+ >+ super.cleanUp(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser#runRequest() >+ */ >+ protected void runRequest() throws Exception { >+ Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, this.getClass(), "runRequest"); //$NON-NLS-1$ >+ setupProxies(); >+ // set timeout >+ httpClient.getParams().setIntParameter(CoreConnectionPNames.SO_TIMEOUT, DEFAULT_CONNECTION_TIMEOUT); >+ httpClient.getParams().setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, DEFAULT_CONNECTION_TIMEOUT); >+ >+ String urlString = directoryOrFile.toString(); >+ // setup authentication >+ setupAuthentication(urlString); >+ >+ headMethod = new HttpHead(urlString); >+ // set max-age for cache control to 0 for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=249990 >+ headMethod.addHeader("Cache-Control", "max-age=0"); //$NON-NLS-1$//$NON-NLS-2$ >+ >+ long lastModified = 0; >+ long fileLength = -1; >+ connectingSockets.clear(); >+ int code = -1; >+ try { >+ Trace.trace(Activator.PLUGIN_ID, "browse=" + urlString); //$NON-NLS-1$ >+ >+ httpContext = new BasicHttpContext(); >+ httpResponse = httpClient.execute(headMethod, httpContext); >+ code = httpResponse.getStatusLine().getStatusCode(); >+ >+ Trace.trace(Activator.PLUGIN_ID, "browse resp=" + code); //$NON-NLS-1$ >+ >+ // Check for NTLM proxy in response headers >+ // This check is to deal with bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=252002 >+ boolean ntlmProxyFound = NTLMProxyDetector.detectNTLMProxy(httpContext); >+ if (ntlmProxyFound && !hasForceNTLMProxyOption()) >+ throw new BrowseFileTransferException("HttpClient Provider is not configured to support NTLM proxy authentication.", HttpClientOptions.NTLM_PROXY_RESPONSE_CODE); //$NON-NLS-1$ >+ >+ if (NTLMProxyDetector.detectSPNEGOProxy(httpContext)) >+ throw new BrowseFileTransferException("HttpClient Provider does not support the use of SPNEGO proxy authentication."); //$NON-NLS-1$ >+ >+ if (code == HttpURLConnection.HTTP_OK) { >+ Header contentLength = httpResponse.getLastHeader(CONTENT_LENGTH_HEADER); >+ if (contentLength != null) { >+ fileLength = Integer.parseInt(contentLength.getValue()); >+ } >+ >+ lastModified = getLastModifiedTimeFromHeader(); >+ } else if (code == HttpURLConnection.HTTP_NOT_FOUND) { >+ throw new BrowseFileTransferException(NLS.bind("File not found: {0}", urlString), code); //$NON-NLS-1$ >+ } else if (code == HttpURLConnection.HTTP_UNAUTHORIZED) { >+ throw new BrowseFileTransferException(Messages.HttpClientRetrieveFileTransfer_Unauthorized, code); >+ } else if (code == HttpURLConnection.HTTP_FORBIDDEN) { >+ throw new BrowseFileTransferException("Forbidden", code); //$NON-NLS-1$ >+ } else if (code == HttpURLConnection.HTTP_PROXY_AUTH) { >+ throw new BrowseFileTransferException(Messages.HttpClientRetrieveFileTransfer_Proxy_Auth_Required, code); >+ } else { >+ throw new BrowseFileTransferException(NLS.bind(Messages.HttpClientRetrieveFileTransfer_ERROR_GENERAL_RESPONSE_CODE, new Integer(code)), code); >+ } >+ remoteFiles = new IRemoteFile[1]; >+ remoteFiles[0] = new URLRemoteFile(lastModified, fileLength, fileID); >+ } catch (Exception e) { >+ Trace.throwing(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_THROWING, this.getClass(), "runRequest", e); //$NON-NLS-1$ >+ BrowseFileTransferException ex = (BrowseFileTransferException) ((e instanceof BrowseFileTransferException) ? e : new BrowseFileTransferException(NLS.bind(Messages.HttpClientRetrieveFileTransfer_EXCEPTION_COULD_NOT_CONNECT, urlString), e, code)); >+ throw ex; >+ } >+ } >+ >+ private long getLastModifiedTimeFromHeader() throws IOException { >+ Header lastModifiedHeader = httpResponse.getLastHeader("Last-Modified"); //$NON-NLS-1$ >+ if (lastModifiedHeader == null) >+ return 0L; >+ String lastModifiedString = lastModifiedHeader.getValue(); >+ long lastModified = 0; >+ if (lastModifiedString != null) { >+ try { >+ lastModified = DateUtils.parseDate(lastModifiedString).getTime(); >+ } catch (Exception e) { >+ throw new IOException(Messages.HttpClientRetrieveFileTransfer_EXCEPITION_INVALID_LAST_MODIFIED_FROM_SERVER); >+ } >+ } >+ return lastModified; >+ } >+ >+ Proxy getProxy() { >+ return proxy; >+ } >+ >+ /** >+ * Retrieves the credentials for requesting the file. >+ * @return the {@link Credentials} necessary to retrieve the file >+ * @throws UnsupportedCallbackException if the callback fails >+ * @throws IOException if IO fails >+ * @since 5.0 >+ */ >+ protected Credentials getFileRequestCredentials() throws UnsupportedCallbackException, IOException { >+ if (connectContext == null) >+ return null; >+ final CallbackHandler callbackHandler = connectContext.getCallbackHandler(); >+ if (callbackHandler == null) >+ return null; >+ final NameCallback usernameCallback = new NameCallback(USERNAME_PREFIX); >+ final ObjectCallback passwordCallback = new ObjectCallback(); >+ callbackHandler.handle(new Callback[] {usernameCallback, passwordCallback}); >+ username = usernameCallback.getName(); >+ password = (String) passwordCallback.getObject(); >+ return new UsernamePasswordCredentials(username, password); >+ } >+ >+ protected void setupAuthentication(String urlString) throws UnsupportedCallbackException, IOException { >+ Credentials credentials = null; >+ if (username == null) { >+ credentials = getFileRequestCredentials(); >+ } >+ >+ if (credentials != null && username != null) { >+ final AuthScope authScope = new AuthScope(HttpClientRetrieveFileTransfer.getHostFromURL(urlString), HttpClientRetrieveFileTransfer.getPortFromURL(urlString), AuthScope.ANY_REALM); >+ Trace.trace(Activator.PLUGIN_ID, "browse credentials=" + credentials); //$NON-NLS-1$ >+ httpClient.getCredentialsProvider().setCredentials(authScope, credentials); >+ } >+ } >+ >+ protected void setupProxy(Proxy proxy) { >+ if (proxy.getType().equals(Proxy.Type.HTTP)) { >+ final ProxyAddress address = proxy.getAddress(); >+ ConnRouteParams.setDefaultProxy(httpClient.getParams(), new HttpHost(address.getHostName(), address.getPort())); >+ } else if (proxy.getType().equals(Proxy.Type.SOCKS)) { >+ Trace.trace(Activator.PLUGIN_ID, "brows socksproxy=" + proxy.getAddress()); //$NON-NLS-1$ >+ proxyHelper.setupProxy(proxy); >+ } >+ } >+ >+ /** >+ * This method will clear out the proxy information (so that if this is >+ * reused for a request without a proxy, it will work correctly). >+ * @since 5.0 >+ */ >+ protected void clearProxy() { >+ ConnRouteParams.setDefaultProxy(httpClient.getParams(), null); >+ } >+ >+} >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientOptions.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientOptions.java >new file mode 100644 >index 0000000..9081b42 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientOptions.java >@@ -0,0 +1,47 @@ >+/******************************************************************************* >+* Copyright (c) 2009 EclipseSource 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: >+* EclipseSource - initial API and implementation >+******************************************************************************/ >+package org.eclipse.ecf.provider.filetransfer.httpclient; >+ >+/** >+ * @since 4.0 >+ */ >+public interface HttpClientOptions { >+ // HttpClient response code that indicates that NTLM proxy is asking for authentication >+ // and httpclient cannot handle NTLMv2 proxies >+ public int NTLM_PROXY_RESPONSE_CODE = 477; >+ // System property that indicates that NTLM proxy usage should be forced (i.e. not rejected) >+ // The property key is: org.eclipse.ecf.provider.filetransfer.httpclient.options.ForceNTLMProxy >+ // The value of the property must be non-null, but is not otherwise used. >+ public String FORCE_NTLM_PROP = "org.eclipse.ecf.provider.filetransfer.httpclient.options.ForceNTLMProxy"; //$NON-NLS-1$ >+ >+ // changing to 2 minutes (120000) as per bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=266246 >+ // 10/26/2009: Added being able to set with system property with name org.eclipse.ecf.provider.filetransfer.httpclient.retrieve.connectTimeout >+ // for https://bugs.eclipse.org/bugs/show_bug.cgi?id=292995 >+ /** >+ * @since 4.0 >+ */ >+ public static final int RETRIEVE_DEFAULT_CONNECTION_TIMEOUT = new Integer(System.getProperty("org.eclipse.ecf.provider.filetransfer.httpclient.retrieve.connectTimeout", "120000")).intValue(); //$NON-NLS-1$ //$NON-NLS-2$ >+ // changing to 2 minutes (120000) as per bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=266246 >+ // 10/26/2009: Added being able to set with system property with name org.eclipse.ecf.provider.filetransfer.httpclient.retrieve.readTimeout >+ // for https://bugs.eclipse.org/bugs/show_bug.cgi?id=292995 >+ /** >+ * @since 4.0 >+ */ >+ public static final int RETRIEVE_DEFAULT_READ_TIMEOUT = new Integer(System.getProperty("org.eclipse.ecf.provider.filetransfer.httpclient.retrieve.readTimeout", "120000")).intValue(); //$NON-NLS-1$ //$NON-NLS-2$ >+ >+ // changing to 2 minutes (120000) as per bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=266246 >+ // 10/26/2009: Added being able to set with system property with name org.eclipse.ecf.provider.filetransfer.httpclient.browse.connectTimeout >+ // for https://bugs.eclipse.org/bugs/show_bug.cgi?id=292995 >+ /** >+ * @since 4.0 >+ */ >+ public static final int BROWSE_DEFAULT_CONNECTION_TIMEOUT = new Integer(System.getProperty("org.eclipse.ecf.provider.filetransfer.httpclient.browse.connectTimeout", "120000")).intValue(); //$NON-NLS-1$ //$NON-NLS-2$; >+ >+} >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransfer.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransfer.java >new file mode 100644 >index 0000000..63942a1 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransfer.java >@@ -0,0 +1,1083 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2010 Composent, Inc., IBM 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: >+ * Composent, Inc. - initial API and implementation >+ * Maarten Meijer - bug 237936, added gzip encoded transfer default >+ * Henrich Kraemer - bug 263869, testHttpsReceiveFile fails using HTTP proxy >+ * Henrich Kraemer - bug 263613, [transport] Update site contacting / downloading is not cancelable >+ * Thomas Joiner - HttpClient 4 implementation >+ ******************************************************************************/ >+package org.eclipse.ecf.provider.filetransfer.httpclient; >+ >+import java.io.IOException; >+import java.io.InputStream; >+import java.net.HttpURLConnection; >+import java.net.InetAddress; >+import java.net.Socket; >+import java.net.UnknownHostException; >+import java.util.ArrayList; >+import java.util.Collections; >+import java.util.HashMap; >+import java.util.Iterator; >+import java.util.List; >+import java.util.Map; >+import javax.net.SocketFactory; >+import javax.net.ssl.SSLSocketFactory; >+import org.apache.http.Header; >+import org.apache.http.HttpHost; >+import org.apache.http.HttpResponse; >+import org.apache.http.ProtocolVersion; >+import org.apache.http.auth.AuthScope; >+import org.apache.http.auth.Credentials; >+import org.apache.http.auth.NTCredentials; >+import org.apache.http.auth.UsernamePasswordCredentials; >+import org.apache.http.auth.params.AuthPNames; >+import org.apache.http.client.methods.HttpGet; >+import org.apache.http.client.params.AuthPolicy; >+import org.apache.http.client.protocol.RequestAcceptEncoding; >+import org.apache.http.client.protocol.ResponseContentEncoding; >+import org.apache.http.conn.params.ConnRouteParams; >+import org.apache.http.conn.scheme.Scheme; >+import org.apache.http.conn.scheme.SchemeRegistry; >+import org.apache.http.impl.client.DefaultHttpClient; >+import org.apache.http.impl.cookie.DateUtils; >+import org.apache.http.params.CoreConnectionPNames; >+import org.apache.http.protocol.BasicHttpContext; >+import org.apache.http.protocol.HttpContext; >+import org.apache.http.util.EntityUtils; >+import org.eclipse.core.runtime.Assert; >+import org.eclipse.core.runtime.IPath; >+import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.NullProgressMonitor; >+import org.eclipse.core.runtime.Path; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.ecf.core.identity.ID; >+import org.eclipse.ecf.core.security.Callback; >+import org.eclipse.ecf.core.security.CallbackHandler; >+import org.eclipse.ecf.core.security.IConnectContext; >+import org.eclipse.ecf.core.security.NameCallback; >+import org.eclipse.ecf.core.security.ObjectCallback; >+import org.eclipse.ecf.core.security.UnsupportedCallbackException; >+import org.eclipse.ecf.core.util.ECFRuntimeException; >+import org.eclipse.ecf.core.util.Proxy; >+import org.eclipse.ecf.core.util.ProxyAddress; >+import org.eclipse.ecf.core.util.Trace; >+import org.eclipse.ecf.filetransfer.BrowseFileTransferException; >+import org.eclipse.ecf.filetransfer.FileTransferJob; >+import org.eclipse.ecf.filetransfer.IFileRangeSpecification; >+import org.eclipse.ecf.filetransfer.IFileTransferPausable; >+import org.eclipse.ecf.filetransfer.IFileTransferRunnable; >+import org.eclipse.ecf.filetransfer.IRetrieveFileTransferOptions; >+import org.eclipse.ecf.filetransfer.IncomingFileTransferException; >+import org.eclipse.ecf.filetransfer.InvalidFileRangeSpecificationException; >+import org.eclipse.ecf.filetransfer.events.IFileTransferConnectStartEvent; >+import org.eclipse.ecf.filetransfer.events.socket.ISocketEventSource; >+import org.eclipse.ecf.filetransfer.events.socket.ISocketListener; >+import org.eclipse.ecf.filetransfer.identity.IFileID; >+import org.eclipse.ecf.internal.provider.filetransfer.httpclient.Activator; >+import org.eclipse.ecf.internal.provider.filetransfer.httpclient.ConnectingSocketMonitor; >+import org.eclipse.ecf.internal.provider.filetransfer.httpclient.DebugOptions; >+import org.eclipse.ecf.internal.provider.filetransfer.httpclient.ECFHttpClientProtocolSocketFactory; >+import org.eclipse.ecf.internal.provider.filetransfer.httpclient.ECFHttpClientSecureProtocolSocketFactory; >+import org.eclipse.ecf.internal.provider.filetransfer.httpclient.HttpClientProxyCredentialProvider; >+import org.eclipse.ecf.internal.provider.filetransfer.httpclient.ISSLSocketFactoryModifier; >+import org.eclipse.ecf.internal.provider.filetransfer.httpclient.Messages; >+import org.eclipse.ecf.provider.filetransfer.events.socket.SocketEventSource; >+import org.eclipse.ecf.provider.filetransfer.identity.FileTransferID; >+import org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer; >+import org.eclipse.ecf.provider.filetransfer.retrieve.HttpHelper; >+import org.eclipse.ecf.provider.filetransfer.util.JREProxyHelper; >+import org.eclipse.ecf.provider.filetransfer.util.ProxySetupHelper; >+import org.eclipse.osgi.util.NLS; >+ >+public class HttpClientRetrieveFileTransfer extends AbstractRetrieveFileTransfer { >+ >+ private static final String USERNAME_PREFIX = Messages.HttpClientRetrieveFileTransfer_Username_Prefix; >+ >+ // changing to 2 minutes (120000) as per bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=266246 >+ // 10/26/2009: Added being able to set with system property with name org.eclipse.ecf.provider.filetransfer.httpclient.retrieve.connectTimeout >+ // for https://bugs.eclipse.org/bugs/show_bug.cgi?id=292995 >+ protected static final int DEFAULT_CONNECTION_TIMEOUT = HttpClientOptions.RETRIEVE_DEFAULT_CONNECTION_TIMEOUT; >+ // changing to 2 minutes (120000) as per bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=266246 >+ // 10/26/2009: Added being able to set with system property with name org.eclipse.ecf.provider.filetransfer.httpclient.retrieve.readTimeout >+ // for https://bugs.eclipse.org/bugs/show_bug.cgi?id=292995 >+ protected static final int DEFAULT_READ_TIMEOUT = HttpClientOptions.RETRIEVE_DEFAULT_READ_TIMEOUT; >+ >+ protected static final int HTTP_PORT = 80; >+ >+ protected static final int HTTPS_PORT = 443; >+ >+ protected static final int MAX_RETRY = 2; >+ >+ protected static final String HTTPS = Messages.FileTransferNamespace_Https_Protocol; >+ >+ protected static final String HTTP = Messages.FileTransferNamespace_Http_Protocol; >+ >+ protected static final String[] supportedProtocols = {HTTP, HTTPS}; >+ >+ private static final String LAST_MODIFIED_HEADER = "Last-Modified"; //$NON-NLS-1$ >+ >+ private HttpGet getMethod = null; >+ >+ private HttpResponse httpResponse = null; >+ >+ private HttpContext httpContext = null; >+ >+ private DefaultHttpClient httpClient = null; >+ >+ private String username; >+ >+ private String password; >+ >+ private int responseCode = -1; >+ private volatile boolean doneFired = false; >+ >+ private String remoteFileName; >+ >+ protected int httpVersion = 1; >+ >+ protected IFileID fileid = null; >+ >+ protected JREProxyHelper proxyHelper = null; >+ >+ private SocketEventSource socketEventSource; >+ >+ private ConnectingSocketMonitor connectingSockets; >+ private FileTransferJob connectJob; >+ >+ /** >+ * @since 5.0 >+ */ >+ public HttpClientRetrieveFileTransfer(DefaultHttpClient httpClient) { >+ this.httpClient = httpClient; >+ Assert.isNotNull(this.httpClient); >+ this.httpClient.setCredentialsProvider(new ECFCredentialsProvider()); >+ proxyHelper = new JREProxyHelper(); >+ connectingSockets = new ConnectingSocketMonitor(1); >+ socketEventSource = new SocketEventSource() { >+ public Object getAdapter(Class adapter) { >+ if (adapter == null) { >+ return null; >+ } >+ if (adapter.isInstance(this)) { >+ return this; >+ } >+ return HttpClientRetrieveFileTransfer.this.getAdapter(adapter); >+ } >+ >+ }; >+ >+ registerSchemes(socketEventSource, connectingSockets); >+ } >+ >+ private void registerSchemes(ISocketEventSource source, ISocketListener socketListener) { >+ SchemeRegistry schemeRegistry = this.httpClient.getConnectionManager().getSchemeRegistry(); >+ >+ Scheme http = new Scheme(HttpClientRetrieveFileTransfer.HTTP, HTTP_PORT, new ECFHttpClientProtocolSocketFactory(SocketFactory.getDefault(), source, socketListener)); >+ >+ Trace.trace(Activator.PLUGIN_ID, "registering http scheme"); //$NON-NLS-1$ >+ schemeRegistry.register(http); >+ >+ ISSLSocketFactoryModifier sslSocketFactoryModifier = Activator.getDefault().getSSLSocketFactoryModifier(); >+ >+ if (sslSocketFactoryModifier == null) { >+ sslSocketFactoryModifier = new HttpClientDefaultSSLSocketFactoryModifier(); >+ } >+ >+ SSLSocketFactory sslSocketFactory = null; >+ try { >+ sslSocketFactory = sslSocketFactoryModifier.getSSLSocketFactory(); >+ } catch (IOException e) { >+ Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, ISSLSocketFactoryModifier.class, "getSSLSocketFactory()", e); //$NON-NLS-1$ >+ Trace.throwing(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_THROWING, HttpClientRetrieveFileTransfer.class, "registerSchemes()", e); //$NON-NLS-1$ >+ throw new ECFRuntimeException("Unable to instantiate schemes for HttpClient.", e); //$NON-NLS-1$ >+ } >+ >+ Scheme https = new Scheme(HttpClientRetrieveFileTransfer.HTTPS, HTTPS_PORT, new ECFHttpClientSecureProtocolSocketFactory(sslSocketFactory, source, socketListener)); >+ Trace.trace(Activator.PLUGIN_ID, "registering https scheme; modifier=" + sslSocketFactoryModifier); //$NON-NLS-1$ >+ schemeRegistry.register(https); >+ >+ // SPNEGO is not supported, so remove it from the list >+ List authpref = new ArrayList(3); >+ authpref.add(AuthPolicy.NTLM); >+ authpref.add(AuthPolicy.DIGEST); >+ authpref.add(AuthPolicy.BASIC); >+ >+ httpClient.getParams().setParameter(AuthPNames.PROXY_AUTH_PREF, authpref); >+ httpClient.getParams().setParameter(AuthPNames.TARGET_AUTH_PREF, authpref); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer#getRemoteFileName() >+ */ >+ public String getRemoteFileName() { >+ return remoteFileName; >+ } >+ >+ public synchronized void cancel() { >+ Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, this.getClass(), "cancel"); //$NON-NLS-1$ >+ if (isCanceled()) { >+ return; // break job cancel recursion >+ } >+ setDoneCanceled(exception); >+ boolean fireDoneEvent = true; >+ if (connectJob != null) { >+ Trace.trace(Activator.PLUGIN_ID, "calling connectJob.cancel()"); //$NON-NLS-1$ >+ connectJob.cancel(); >+ } >+ synchronized (jobLock) { >+ if (job != null) { >+ // Its the transfer jobs responsibility to throw the event. >+ fireDoneEvent = false; >+ Trace.trace(Activator.PLUGIN_ID, "calling transfer job.cancel()"); //$NON-NLS-1$ >+ job.cancel(); >+ } >+ } >+ if (getMethod != null) { >+ if (!getMethod.isAborted()) { >+ Trace.trace(Activator.PLUGIN_ID, "calling getMethod.abort()"); //$NON-NLS-1$ >+ getMethod.abort(); >+ } >+ } >+ if (connectingSockets != null) { >+ // this should unblock socket connect calls, if any >+ for (Iterator iterator = connectingSockets.getConnectingSockets().iterator(); iterator.hasNext();) { >+ Socket socket = (Socket) iterator.next(); >+ try { >+ Trace.trace(Activator.PLUGIN_ID, "Call socket.close() for socket=" + socket.toString()); //$NON-NLS-1$ >+ socket.close(); >+ } catch (IOException e) { >+ Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, this.getClass(), "cancel", e); //$NON-NLS-1$ >+ } >+ } >+ } >+ hardClose(); >+ if (fireDoneEvent) { >+ fireTransferReceiveDoneEvent(); >+ } >+ Trace.exiting(Activator.PLUGIN_ID, DebugOptions.METHODS_EXITING, this.getClass(), "cancel");//$NON-NLS-1$ >+ >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer#hardClose() >+ */ >+ protected void hardClose() { >+ super.hardClose(); >+ if (getMethod != null) { >+ getMethod.abort(); >+ getMethod = null; >+ } >+ responseCode = -1; >+ if (proxyHelper != null) { >+ proxyHelper.dispose(); >+ proxyHelper = null; >+ } >+ } >+ >+ /** >+ * @since 5.0 >+ */ >+ protected Credentials getFileRequestCredentials() throws UnsupportedCallbackException, IOException { >+ if (connectContext == null) >+ return null; >+ final CallbackHandler callbackHandler = connectContext.getCallbackHandler(); >+ if (callbackHandler == null) >+ return null; >+ final NameCallback usernameCallback = new NameCallback(USERNAME_PREFIX); >+ final ObjectCallback passwordCallback = new ObjectCallback(); >+ callbackHandler.handle(new Callback[] {usernameCallback, passwordCallback}); >+ username = usernameCallback.getName(); >+ password = (String) passwordCallback.getObject(); >+ return new UsernamePasswordCredentials(username, password); >+ } >+ >+ protected void setupProxies() { >+ // If it's been set directly (via ECF API) then this overrides platform settings >+ if (proxy == null) { >+ try { >+ // give SOCKS priority see https://bugs.eclipse.org/bugs/show_bug.cgi?id=295030#c61 >+ proxy = ProxySetupHelper.getSocksProxy(getRemoteFileURL()); >+ if (proxy == null) { >+ proxy = ProxySetupHelper.getProxy(getRemoteFileURL().toExternalForm()); >+ } >+ } catch (NoClassDefFoundError e) { >+ // If the proxy API is not available a NoClassDefFoundError will be thrown here. >+ // If that happens then we just want to continue on. >+ Activator.logNoProxyWarning(e); >+ } >+ } >+ if (proxy != null) >+ setupProxy(proxy); >+ } >+ >+ protected synchronized void resetDoneAndException() { >+ // Doesn't match the description, but since it should be cleared before it is >+ // reused, this is the best place. >+ clearProxy(); >+ >+ super.resetDoneAndException(); >+ } >+ >+ protected void setupAuthentication(String urlString) throws UnsupportedCallbackException, IOException { >+ Credentials credentials = null; >+ if (username == null) { >+ credentials = getFileRequestCredentials(); >+ } >+ >+ if (credentials != null && username != null) { >+ final AuthScope authScope = new AuthScope(getHostFromURL(urlString), getPortFromURL(urlString), AuthScope.ANY_REALM); >+ Trace.trace(Activator.PLUGIN_ID, "retrieve credentials=" + credentials); //$NON-NLS-1$ >+ httpClient.getCredentialsProvider().setCredentials(authScope, credentials); >+ } >+ } >+ >+ protected void setRequestHeaderValues() throws InvalidFileRangeSpecificationException { >+ final IFileRangeSpecification rangeSpec = getFileRangeSpecification(); >+ if (rangeSpec != null) { >+ final long startPosition = rangeSpec.getStartPosition(); >+ final long endPosition = rangeSpec.getEndPosition(); >+ if (startPosition < 0) >+ throw new InvalidFileRangeSpecificationException(Messages.HttpClientRetrieveFileTransfer_RESUME_START_POSITION_LESS_THAN_ZERO, rangeSpec); >+ if (endPosition != -1L && endPosition <= startPosition) >+ throw new InvalidFileRangeSpecificationException(Messages.HttpClientRetrieveFileTransfer_RESUME_ERROR_END_POSITION_LESS_THAN_START, rangeSpec); >+ String rangeHeader = "bytes=" + startPosition + "-" + ((endPosition == -1L) ? "" : ("" + endPosition)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ >+ Trace.trace(Activator.PLUGIN_ID, "retrieve range header=" + rangeHeader); //$NON-NLS-1$ >+ setRangeHeader(rangeHeader); >+ } >+ // set max-age for cache control to 0 for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=249990 >+ getMethod.addHeader("Cache-Control", "max-age=0"); //$NON-NLS-1$//$NON-NLS-2$ >+ setRequestHeaderValuesFromOptions(); >+ } >+ >+ private void setRequestHeaderValuesFromOptions() { >+ Map localOptions = getOptions(); >+ if (localOptions != null) { >+ Object o = localOptions.get(IRetrieveFileTransferOptions.REQUEST_HEADERS); >+ if (o != null && o instanceof Map) { >+ Map requestHeaders = (Map) o; >+ for (Iterator i = requestHeaders.keySet().iterator(); i.hasNext();) { >+ Object n = i.next(); >+ Object v = requestHeaders.get(n); >+ if (n != null && n instanceof String && v != null && v instanceof String) >+ getMethod.addHeader((String) n, (String) v); >+ } >+ } >+ } >+ } >+ >+ private void setRangeHeader(String value) { >+ getMethod.addHeader("Range", value); //$NON-NLS-1$ >+ } >+ >+ private boolean isHTTP11() { >+ return (httpVersion >= 1); >+ } >+ >+ public int getResponseCode() { >+ if (responseCode != -1) >+ return responseCode; >+ ProtocolVersion version = getMethod.getProtocolVersion(); >+ if (version == null) { >+ responseCode = -1; >+ httpVersion = 1; >+ return responseCode; >+ } >+ httpVersion = version.getMinor(); >+ responseCode = httpResponse.getStatusLine().getStatusCode(); >+ return responseCode; >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.ecf.core.identity.IIdentifiable#getID() >+ */ >+ public ID getID() { >+ return fileid; >+ } >+ >+ private long getLastModifiedTimeFromHeader() throws IOException { >+ Header lastModifiedHeader = httpResponse.getLastHeader(LAST_MODIFIED_HEADER); >+ if (lastModifiedHeader == null) >+ throw new IOException(Messages.HttpClientRetrieveFileTransfer_INVALID_LAST_MODIFIED_TIME); >+ >+ String lastModifiedString = lastModifiedHeader.getValue(); >+ long lastModified = 0; >+ if (lastModifiedString != null) { >+ try { >+ lastModified = DateUtils.parseDate(lastModifiedString).getTime(); >+ } catch (Exception e) { >+ throw new IOException(Messages.HttpClientRetrieveFileTransfer_EXCEPITION_INVALID_LAST_MODIFIED_FROM_SERVER); >+ } >+ } >+ return lastModified; >+ } >+ >+ protected void getResponseHeaderValues() throws IOException { >+ if (getResponseCode() == -1) >+ throw new IOException(Messages.HttpClientRetrieveFileTransfer_INVALID_SERVER_RESPONSE_TO_PARTIAL_RANGE_REQUEST); >+ Header lastModifiedHeader = httpResponse.getLastHeader(LAST_MODIFIED_HEADER); >+ if (lastModifiedHeader != null) { >+ setLastModifiedTime(getLastModifiedTimeFromHeader()); >+ } >+ setFileLength(httpResponse.getEntity().getContentLength()); >+ fileid = new FileTransferID(getRetrieveNamespace(), getRemoteFileURL()); >+ >+ // Get content disposition header and get remote file name from it if possible. >+ Header contentDispositionHeader = httpResponse.getLastHeader(HttpHelper.CONTENT_DISPOSITION_HEADER); >+ if (contentDispositionHeader != null) { >+ remoteFileName = HttpHelper.getRemoteFileNameFromContentDispositionHeader(contentDispositionHeader.getValue()); >+ } >+ // If still null, get the path from httpclient.getMethod() >+ if (remoteFileName == null) { >+ // No name could be extracted using Content-Disposition. Let's try the >+ // path from the getMethod. >+ String pathStr = getMethod.getRequestLine().getUri(); >+ if (pathStr != null && pathStr.length() > 0) { >+ IPath path = Path.fromPortableString(pathStr); >+ if (path.segmentCount() > 0) >+ remoteFileName = path.lastSegment(); >+ } >+ // If still null, use the input file name >+ if (remoteFileName == null) >+ // Last resort. Use the path of the initial URL request >+ remoteFileName = super.getRemoteFileName(); >+ } >+ } >+ >+ final class ECFCredentialsProvider extends HttpClientProxyCredentialProvider { >+ >+ protected Proxy getECFProxy() { >+ return getProxy(); >+ } >+ >+ protected Credentials getNTLMCredentials(Proxy lp) { >+ if (hasForceNTLMProxyOption()) >+ return HttpClientRetrieveFileTransfer.createNTLMCredentials(lp); >+ return null; >+ } >+ >+ } >+ >+ Proxy getProxy() { >+ return proxy; >+ } >+ >+ protected void setInputStream(InputStream ins) { >+ remoteFileContents = ins; >+ } >+ >+ protected InputStream wrapTransferReadInputStream(InputStream inputStream, IProgressMonitor monitor) { >+ return inputStream; >+ } >+ >+ protected boolean hasForceNTLMProxyOption() { >+ Map localOptions = getOptions(); >+ if (localOptions != null && localOptions.get(HttpClientOptions.FORCE_NTLM_PROP) != null) >+ return true; >+ return (System.getProperties().getProperty(HttpClientOptions.FORCE_NTLM_PROP) != null); >+ } >+ >+ protected int getSocketReadTimeout() { >+ int result = DEFAULT_READ_TIMEOUT; >+ Map localOptions = getOptions(); >+ if (localOptions != null) { >+ // See if the connect timeout option is present, if so set >+ Object o = localOptions.get(IRetrieveFileTransferOptions.READ_TIMEOUT); >+ if (o != null) { >+ if (o instanceof Integer) { >+ result = ((Integer) o).intValue(); >+ } else if (o instanceof String) { >+ result = new Integer(((String) o)).intValue(); >+ } >+ return result; >+ } >+ o = localOptions.get("org.eclipse.ecf.provider.filetransfer.httpclient.retrieve.readTimeout"); //$NON-NLS-1$ >+ if (o != null) { >+ if (o instanceof Integer) { >+ result = ((Integer) o).intValue(); >+ } else if (o instanceof String) { >+ result = new Integer(((String) o)).intValue(); >+ } >+ } >+ } >+ return result; >+ } >+ >+ /** >+ * @since 4.0 >+ */ >+ protected int getConnectTimeout() { >+ int result = DEFAULT_CONNECTION_TIMEOUT; >+ Map localOptions = getOptions(); >+ if (localOptions != null) { >+ // See if the connect timeout option is present, if so set >+ Object o = localOptions.get(IRetrieveFileTransferOptions.CONNECT_TIMEOUT); >+ if (o != null) { >+ if (o instanceof Integer) { >+ result = ((Integer) o).intValue(); >+ } else if (o instanceof String) { >+ result = new Integer(((String) o)).intValue(); >+ } >+ return result; >+ } >+ o = localOptions.get("org.eclipse.ecf.provider.filetransfer.httpclient.retrieve.connectTimeout"); //$NON-NLS-1$ >+ if (o != null) { >+ if (o instanceof Integer) { >+ result = ((Integer) o).intValue(); >+ } else if (o instanceof String) { >+ result = new Integer(((String) o)).intValue(); >+ } >+ } >+ } >+ return result; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer#openStreams() >+ */ >+ protected void openStreams() throws IncomingFileTransferException { >+ >+ Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, this.getClass(), "openStreams"); //$NON-NLS-1$ >+ final String urlString = getRemoteFileURL().toString(); >+ this.doneFired = false; >+ >+ int code = -1; >+ >+ try { >+ httpClient.getParams().setIntParameter(CoreConnectionPNames.SO_TIMEOUT, getSocketReadTimeout()); >+ int connectTimeout = getConnectTimeout(); >+ httpClient.getParams().setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectTimeout); >+ >+ setupAuthentication(urlString); >+ >+ getMethod = new HttpGet(urlString); >+ // Define a CredentialsProvider - found that possibility while debugging in org.apache.commons.httpclient.HttpMethodDirector.processProxyAuthChallenge(HttpMethod) >+ // Seems to be another way to select the credentials. >+ setRequestHeaderValues(); >+ >+ Trace.trace(Activator.PLUGIN_ID, "retrieve=" + urlString); //$NON-NLS-1$ >+ // Set request header for possible gzip encoding, but only if >+ // 1) The file range specification is null (we want the whole file) >+ // 2) The target remote file does *not* end in .gz (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=280205) >+ if (getFileRangeSpecification() == null && !targetHasGzSuffix(super.getRemoteFileName())) { >+ Trace.trace(Activator.PLUGIN_ID, "Accept-Encoding: gzip,deflate added to request header"); //$NON-NLS-1$ >+ >+ // Add the interceptors to provide the gzip >+ httpClient.addRequestInterceptor(new RequestAcceptEncoding()); >+ httpClient.addResponseInterceptor(new ResponseContentEncoding()); >+ } else { >+ Trace.trace(Activator.PLUGIN_ID, "Accept-Encoding NOT added to header"); //$NON-NLS-1$ >+ } >+ >+ fireConnectStartEvent(); >+ if (checkAndHandleDone()) { >+ return; >+ } >+ >+ connectingSockets.clear(); >+ // Actually execute get and get response code (since redirect is set to true, then >+ // redirect response code handled internally >+ if (connectJob == null) { >+ performConnect(new NullProgressMonitor()); >+ } else { >+ connectJob.schedule(); >+ connectJob.join(); >+ connectJob = null; >+ } >+ if (checkAndHandleDone()) { >+ return; >+ } >+ >+ code = responseCode; >+ >+ responseHeaders = getResponseHeaders(); >+ >+ Trace.trace(Activator.PLUGIN_ID, "retrieve resp=" + code); //$NON-NLS-1$ >+ >+ // Check for NTLM proxy in response headers >+ // This check is to deal with bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=252002 >+ boolean ntlmProxyFound = NTLMProxyDetector.detectNTLMProxy(httpContext); >+ if (ntlmProxyFound && !hasForceNTLMProxyOption()) >+ throw new IncomingFileTransferException("HttpClient Provider is not configured to support NTLM proxy authentication.", HttpClientOptions.NTLM_PROXY_RESPONSE_CODE); //$NON-NLS-1$ >+ >+ if (NTLMProxyDetector.detectSPNEGOProxy(httpContext)) >+ throw new BrowseFileTransferException("HttpClient Provider does not support the use of SPNEGO proxy authentication."); //$NON-NLS-1$ >+ >+ if (code == HttpURLConnection.HTTP_PARTIAL || code == HttpURLConnection.HTTP_OK) { >+ getResponseHeaderValues(); >+ setInputStream(httpResponse.getEntity().getContent()); >+ fireReceiveStartEvent(); >+ } else if (code == HttpURLConnection.HTTP_NOT_FOUND) { >+ EntityUtils.consume(httpResponse.getEntity()); >+ throw new IncomingFileTransferException(NLS.bind("File not found: {0}", urlString), code); //$NON-NLS-1$ >+ } else if (code == HttpURLConnection.HTTP_UNAUTHORIZED) { >+ EntityUtils.consume(httpResponse.getEntity()); >+ throw new IncomingFileTransferException(Messages.HttpClientRetrieveFileTransfer_Unauthorized, code); >+ } else if (code == HttpURLConnection.HTTP_FORBIDDEN) { >+ EntityUtils.consume(httpResponse.getEntity()); >+ throw new IncomingFileTransferException("Forbidden", code); //$NON-NLS-1$ >+ } else if (code == HttpURLConnection.HTTP_PROXY_AUTH) { >+ EntityUtils.consume(httpResponse.getEntity()); >+ throw new IncomingFileTransferException(Messages.HttpClientRetrieveFileTransfer_Proxy_Auth_Required, code); >+ } else { >+ Trace.trace(Activator.PLUGIN_ID, EntityUtils.toString(httpResponse.getEntity())); >+ // EntityUtils.consume(httpResponse.getEntity()); >+ throw new IncomingFileTransferException(NLS.bind(Messages.HttpClientRetrieveFileTransfer_ERROR_GENERAL_RESPONSE_CODE, new Integer(code)), code); >+ } >+ } catch (final Exception e) { >+ Trace.throwing(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_THROWING, this.getClass(), "openStreams", e); //$NON-NLS-1$ >+ if (code == -1) { >+ if (!isDone()) { >+ setDoneException(e); >+ } >+ fireTransferReceiveDoneEvent(); >+ } else { >+ IncomingFileTransferException ex = (IncomingFileTransferException) ((e instanceof IncomingFileTransferException) ? e : new IncomingFileTransferException(NLS.bind(Messages.HttpClientRetrieveFileTransfer_EXCEPTION_COULD_NOT_CONNECT, urlString), e, code)); >+ throw ex; >+ } >+ } >+ Trace.exiting(Activator.PLUGIN_ID, DebugOptions.METHODS_EXITING, this.getClass(), "openStreams"); //$NON-NLS-1$ >+ } >+ >+ private Map getResponseHeaders() { >+ if (getMethod == null) >+ return null; >+ Header[] headers = httpResponse.getAllHeaders(); >+ Map result = null; >+ if (headers != null && headers.length > 0) { >+ result = new HashMap(); >+ for (int i = 0; i < headers.length; i++) { >+ String name = headers[i].getName(); >+ String val = headers[i].getValue(); >+ if (name != null && val != null) >+ result.put(name, val); >+ } >+ } >+ return Collections.unmodifiableMap(result); >+ } >+ >+ private boolean checkAndHandleDone() { >+ if (isDone()) { >+ // for cancel the done event should have been fired always. >+ if (!doneFired) { >+ fireTransferReceiveDoneEvent(); >+ } >+ return true; >+ } >+ return false; >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.ecf.filetransfer.IRetrieveFileTransferContainerAdapter#setConnectContextForAuthentication(org.eclipse.ecf.core.security.IConnectContext) >+ */ >+ public void setConnectContextForAuthentication(IConnectContext connectContext) { >+ super.setConnectContextForAuthentication(connectContext); >+ this.username = null; >+ this.password = null; >+ } >+ >+ protected static String getHostFromURL(String url) { >+ String result = url; >+ final int colonSlashSlash = url.indexOf("://"); //$NON-NLS-1$ >+ if (colonSlashSlash < 0) >+ return ""; //$NON-NLS-1$ >+ if (colonSlashSlash >= 0) { >+ result = url.substring(colonSlashSlash + 3); >+ } >+ >+ final int colonPort = result.indexOf(':'); >+ final int requestPath = result.indexOf('/'); >+ >+ int substringEnd; >+ >+ if (colonPort > 0 && requestPath > 0) >+ substringEnd = Math.min(colonPort, requestPath); >+ else if (colonPort > 0) >+ substringEnd = colonPort; >+ else if (requestPath > 0) >+ substringEnd = requestPath; >+ else >+ substringEnd = result.length(); >+ >+ return result.substring(0, substringEnd); >+ >+ } >+ >+ protected static int getPortFromURL(String url) { >+ final int colonSlashSlash = url.indexOf("://"); //$NON-NLS-1$ >+ if (colonSlashSlash < 0) >+ return urlUsesHttps(url) ? HTTPS_PORT : HTTP_PORT; >+ // This is wrong as if the url has no colonPort before '?' then it should return the default >+ >+ final int colonPort = url.indexOf(':', colonSlashSlash + 1); >+ if (colonPort < 0) >+ return urlUsesHttps(url) ? HTTPS_PORT : HTTP_PORT; >+ // Make sure that the colonPort is not from some part of the rest of the URL >+ int nextSlash = url.indexOf('/', colonSlashSlash + 3); >+ if (nextSlash != -1 && colonPort > nextSlash) >+ return urlUsesHttps(url) ? HTTPS_PORT : HTTP_PORT; >+ >+ final int requestPath = url.indexOf('/', colonPort + 1); >+ >+ int end; >+ if (requestPath < 0) >+ end = url.length(); >+ else >+ end = requestPath; >+ >+ return Integer.parseInt(url.substring(colonPort + 1, end)); >+ } >+ >+ protected static boolean urlUsesHttps(String url) { >+ url = url.trim(); >+ return url.startsWith(HTTPS); >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.ecf.internal.provider.filetransfer.AbstractRetrieveFileTransfer#supportsProtocol(java.lang.String) >+ */ >+ public static boolean supportsProtocol(String protocolString) { >+ for (int i = 0; i < supportedProtocols.length; i++) >+ if (supportedProtocols[i].equalsIgnoreCase(protocolString)) >+ return true; >+ return false; >+ } >+ >+ protected boolean isConnected() { >+ return (getMethod != null); >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer#doPause() >+ */ >+ protected boolean doPause() { >+ if (isPaused() || !isConnected() || isDone()) >+ return false; >+ this.paused = true; >+ return this.paused; >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer#doResume() >+ */ >+ protected boolean doResume() { >+ if (!isPaused() || isConnected()) >+ return false; >+ return openStreamsForResume(); >+ } >+ >+ protected void setResumeRequestHeaderValues() throws IOException { >+ if (this.bytesReceived <= 0 || this.fileLength <= this.bytesReceived) >+ throw new IOException(Messages.HttpClientRetrieveFileTransfer_RESUME_START_ERROR); >+ setRangeHeader("bytes=" + this.bytesReceived + "-"); //$NON-NLS-1$ //$NON-NLS-2$ >+ // set max-age for cache control to 0 for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=249990 >+ getMethod.addHeader("Cache-Control", "max-age=0"); //$NON-NLS-1$//$NON-NLS-2$ >+ setRequestHeaderValuesFromOptions(); >+ } >+ >+ private boolean openStreamsForResume() { >+ >+ Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, this.getClass(), "openStreamsForResume"); //$NON-NLS-1$ >+ final String urlString = getRemoteFileURL().toString(); >+ this.doneFired = false; >+ >+ int code = -1; >+ >+ try { >+ httpClient.getParams().setIntParameter(CoreConnectionPNames.SO_TIMEOUT, getSocketReadTimeout()); >+ int connectTimeout = getConnectTimeout(); >+ httpClient.getParams().setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectTimeout); >+ >+ setupAuthentication(urlString); >+ >+ getMethod = new HttpGet(urlString); >+ // Define a CredentialsProvider - found that possibility while debugging in org.apache.commons.httpclient.HttpMethodDirector.processProxyAuthChallenge(HttpMethod) >+ // Seems to be another way to select the credentials. >+ setResumeRequestHeaderValues(); >+ >+ Trace.trace(Activator.PLUGIN_ID, "resume=" + urlString); //$NON-NLS-1$ >+ >+ // Gzip encoding is not an option for resume >+ fireConnectStartEvent(); >+ if (checkAndHandleDone()) { >+ return false; >+ } >+ >+ connectingSockets.clear(); >+ // Actually execute get and get response code (since redirect is set to true, then >+ // redirect response code handled internally >+ if (connectJob == null) { >+ performConnect(new NullProgressMonitor()); >+ } else { >+ connectJob.schedule(); >+ connectJob.join(); >+ connectJob = null; >+ } >+ if (checkAndHandleDone()) { >+ return false; >+ } >+ >+ code = responseCode; >+ >+ responseHeaders = getResponseHeaders(); >+ >+ Trace.trace(Activator.PLUGIN_ID, "retrieve resp=" + code); //$NON-NLS-1$ >+ >+ if (code == HttpURLConnection.HTTP_PARTIAL || code == HttpURLConnection.HTTP_OK) { >+ getResumeResponseHeaderValues(); >+ setInputStream(httpResponse.getEntity().getContent()); >+ this.paused = false; >+ fireReceiveResumedEvent(); >+ } else if (code == HttpURLConnection.HTTP_NOT_FOUND) { >+ EntityUtils.consume(httpResponse.getEntity()); >+ throw new IncomingFileTransferException(NLS.bind("File not found: {0}", urlString), code, responseHeaders); //$NON-NLS-1$ >+ } else if (code == HttpURLConnection.HTTP_UNAUTHORIZED) { >+ EntityUtils.consume(httpResponse.getEntity()); >+ throw new IncomingFileTransferException(Messages.HttpClientRetrieveFileTransfer_Unauthorized, code, responseHeaders); >+ } else if (code == HttpURLConnection.HTTP_FORBIDDEN) { >+ EntityUtils.consume(httpResponse.getEntity()); >+ throw new IncomingFileTransferException("Forbidden", code, responseHeaders); //$NON-NLS-1$ >+ } else if (code == HttpURLConnection.HTTP_PROXY_AUTH) { >+ EntityUtils.consume(httpResponse.getEntity()); >+ throw new IncomingFileTransferException(Messages.HttpClientRetrieveFileTransfer_Proxy_Auth_Required, code, responseHeaders); >+ } else { >+ EntityUtils.consume(httpResponse.getEntity()); >+ throw new IncomingFileTransferException(NLS.bind(Messages.HttpClientRetrieveFileTransfer_ERROR_GENERAL_RESPONSE_CODE, new Integer(code)), code, responseHeaders); >+ } >+ Trace.exiting(Activator.PLUGIN_ID, DebugOptions.METHODS_EXITING, this.getClass(), "openStreamsForResume", Boolean.TRUE); //$NON-NLS-1$ >+ return true; >+ } catch (final Exception e) { >+ Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, this.getClass(), "openStreamsForResume", e); //$NON-NLS-1$ >+ if (code == -1) { >+ if (!isDone()) { >+ setDoneException(e); >+ } >+ } else { >+ setDoneException((e instanceof IncomingFileTransferException) ? e : new IncomingFileTransferException(NLS.bind(Messages.HttpClientRetrieveFileTransfer_EXCEPTION_COULD_NOT_CONNECT, urlString), e, code, responseHeaders)); >+ } >+ fireTransferReceiveDoneEvent(); >+ Trace.exiting(Activator.PLUGIN_ID, DebugOptions.METHODS_EXITING, this.getClass(), "openStreamsForResume", Boolean.FALSE); //$NON-NLS-1$ >+ return false; >+ } >+ } >+ >+ protected void getResumeResponseHeaderValues() throws IOException { >+ if (getResponseCode() != HttpURLConnection.HTTP_PARTIAL) >+ throw new IOException(); >+ if (lastModifiedTime != getLastModifiedTimeFromHeader()) >+ throw new IOException(Messages.HttpClientRetrieveFileTransfer_EXCEPTION_FILE_MODIFIED_SINCE_LAST_ACCESS); >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer#getAdapter(java.lang.Class) >+ */ >+ public Object getAdapter(Class adapter) { >+ if (adapter == null) >+ return null; >+ if (adapter.equals(IFileTransferPausable.class) && isHTTP11()) >+ return this; >+ if (adapter.equals(ISocketEventSource.class)) >+ return this.socketEventSource; >+ return super.getAdapter(adapter); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer#setupProxy(org.eclipse.ecf.core.util.Proxy) >+ */ >+ protected void setupProxy(Proxy proxy) { >+ Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, HttpClientRetrieveFileTransfer.class, "setupProxy " + proxy); //$NON-NLS-1$ >+ if (proxy.getType().equals(Proxy.Type.HTTP)) { >+ final ProxyAddress address = proxy.getAddress(); >+ ConnRouteParams.setDefaultProxy(httpClient.getParams(), new HttpHost(address.getHostName(), address.getPort())); >+ // getHostConfiguration().setProxy(address.getHostName(), address.getPort()); >+ } else if (proxy.getType().equals(Proxy.Type.SOCKS)) { >+ Trace.trace(Activator.PLUGIN_ID, "retrieve socksproxy=" + proxy.getAddress()); //$NON-NLS-1$ >+ proxyHelper.setupProxy(proxy); >+ } >+ } >+ >+ /** >+ * This method will clear out the proxy information (so that if this is >+ * reused for a request without a proxy, it will work correctly). >+ * @since 5.0 >+ */ >+ protected void clearProxy() { >+ Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, HttpClientRetrieveFileTransfer.class, "clearProxy()"); //$NON-NLS-1$ >+ ConnRouteParams.setDefaultProxy(httpClient.getParams(), null); >+ } >+ >+ /** >+ * @since 5.0 >+ */ >+ public static NTCredentials createNTLMCredentials(Proxy p) { >+ if (p == null) { >+ return null; >+ } >+ String un = getNTLMUserName(p); >+ String domain = getNTLMDomainName(p); >+ if (un == null || domain == null) >+ return null; >+ >+ String workstation = null; >+ try { >+ workstation = InetAddress.getLocalHost().getHostName(); >+ } catch (UnknownHostException e) { >+ Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, HttpClientRetrieveFileTransfer.class, "createNTLMCredentials", e); //$NON-NLS-1$ >+ } >+ >+ return new NTCredentials(un, p.getPassword(), workstation, domain); >+ } >+ >+ protected static String getNTLMDomainName(Proxy p) { >+ String domainUsername = p.getUsername(); >+ if (domainUsername == null) >+ return null; >+ int slashloc = domainUsername.indexOf('\\'); >+ if (slashloc == -1) >+ return null; >+ return domainUsername.substring(0, slashloc); >+ } >+ >+ protected static String getNTLMUserName(Proxy p) { >+ String domainUsername = p.getUsername(); >+ if (domainUsername == null) >+ return null; >+ int slashloc = domainUsername.indexOf('\\'); >+ if (slashloc == -1) >+ return null; >+ return domainUsername.substring(slashloc + 1); >+ } >+ >+ protected void fireConnectStartEvent() { >+ Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, this.getClass(), "fireConnectStartEvent"); //$NON-NLS-1$ >+ // TODO: should the following be in super.fireReceiveStartEvent(); >+ listener.handleTransferEvent(new IFileTransferConnectStartEvent() { >+ public IFileID getFileID() { >+ return remoteFileID; >+ } >+ >+ public void cancel() { >+ HttpClientRetrieveFileTransfer.this.cancel(); >+ } >+ >+ public FileTransferJob prepareConnectJob(FileTransferJob j) { >+ return HttpClientRetrieveFileTransfer.this.prepareConnectJob(j); >+ } >+ >+ public void connectUsingJob(FileTransferJob j) { >+ HttpClientRetrieveFileTransfer.this.connectUsingJob(j); >+ } >+ >+ public String toString() { >+ final StringBuffer sb = new StringBuffer("IFileTransferConnectStartEvent["); //$NON-NLS-1$ >+ sb.append(getFileID()); >+ sb.append("]"); //$NON-NLS-1$ >+ return sb.toString(); >+ } >+ >+ public Object getAdapter(Class adapter) { >+ return HttpClientRetrieveFileTransfer.this.getAdapter(adapter); >+ } >+ }); >+ } >+ >+ protected String createConnectJobName() { >+ return getRemoteFileURL().toString() + createRangeName() + Messages.HttpClientRetrieveFileTransfer_CONNECTING_JOB_NAME; >+ } >+ >+ protected FileTransferJob prepareConnectJob(FileTransferJob cjob) { >+ if (cjob == null) { >+ // Create our own >+ cjob = new FileTransferJob(createJobName()); >+ } >+ cjob.setFileTransfer(this); >+ cjob.setFileTransferRunnable(fileConnectRunnable); >+ return cjob; >+ } >+ >+ protected void connectUsingJob(FileTransferJob cjob) { >+ Assert.isNotNull(cjob); >+ this.connectJob = cjob; >+ } >+ >+ private IFileTransferRunnable fileConnectRunnable = new IFileTransferRunnable() { >+ public IStatus performFileTransfer(IProgressMonitor monitor) { >+ return performConnect(monitor); >+ } >+ }; >+ >+ private IStatus performConnect(IProgressMonitor monitor) { >+ // there might be more ticks in the future perhaps for >+ // connect socket, certificate validation, send request, authenticate, >+ int ticks = 1; >+ monitor.beginTask(getRemoteFileURL().toString() + Messages.HttpClientRetrieveFileTransfer_CONNECTING_TASK_NAME, ticks); >+ try { >+ if (monitor.isCanceled()) >+ throw newUserCancelledException(); >+ httpContext = new BasicHttpContext(); >+ httpResponse = httpClient.execute(getMethod, httpContext); >+ responseCode = httpResponse.getStatusLine().getStatusCode(); >+ Trace.trace(Activator.PLUGIN_ID, "retrieve resp=" + responseCode); //$NON-NLS-1$ >+ } catch (final Exception e) { >+ Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, this.getClass(), "performConnect", e); //$NON-NLS-1$ >+ if (!isDone()) { >+ setDoneException(e); >+ } >+ } finally { >+ monitor.done(); >+ } >+ return Status.OK_STATUS; >+ >+ } >+ >+ protected void finalize() throws Throwable { >+ try { >+ if (this.httpClient != null) { >+ this.httpClient.getConnectionManager().shutdown(); >+ } >+ } finally { >+ super.finalize(); >+ } >+ } >+ >+ protected void fireReceiveResumedEvent() { >+ Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, this.getClass(), "fireReceiveResumedEvent len=" + fileLength + ";rcvd=" + bytesReceived); //$NON-NLS-1$ //$NON-NLS-2$ >+ super.fireReceiveResumedEvent(); >+ } >+ >+ protected void fireTransferReceiveDataEvent() { >+ Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, this.getClass(), "fireTransferReceiveDataEvent len=" + fileLength + ";rcvd=" + bytesReceived); //$NON-NLS-1$ //$NON-NLS-2$ >+ super.fireTransferReceiveDataEvent(); >+ } >+ >+ protected void fireTransferReceiveDoneEvent() { >+ Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, this.getClass(), "fireTransferReceiveDoneEvent len=" + fileLength + ";rcvd=" + bytesReceived); //$NON-NLS-1$ //$NON-NLS-2$ >+ this.doneFired = true; >+ super.fireTransferReceiveDoneEvent(); >+ } >+ >+ protected void fireTransferReceivePausedEvent() { >+ Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, this.getClass(), "fireTransferReceivePausedEvent len=" + fileLength + ";rcvd=" + bytesReceived); //$NON-NLS-1$ //$NON-NLS-2$ >+ super.fireTransferReceivePausedEvent(); >+ } >+ >+} >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransferFactory.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransferFactory.java >new file mode 100644 >index 0000000..8c99614 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransferFactory.java >@@ -0,0 +1,24 @@ >+/**************************************************************************** >+ * Copyright (c) 2007 IBM, Composent 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: >+ * Composent, Inc. - initial API and implementation >+ * Thomas Joiner - HttpClient 4 implementation >+ *****************************************************************************/ >+package org.eclipse.ecf.provider.filetransfer.httpclient; >+ >+import org.apache.http.impl.client.DefaultHttpClient; >+import org.apache.http.impl.conn.SingleClientConnManager; >+import org.eclipse.ecf.filetransfer.service.IRetrieveFileTransfer; >+import org.eclipse.ecf.filetransfer.service.IRetrieveFileTransferFactory; >+ >+public class HttpClientRetrieveFileTransferFactory implements IRetrieveFileTransferFactory { >+ >+ public IRetrieveFileTransfer newInstance() { >+ return new HttpClientRetrieveFileTransfer(new DefaultHttpClient(new SingleClientConnManager())); >+ } >+} >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientSslTrustManager.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientSslTrustManager.java >new file mode 100644 >index 0000000..16250d4 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientSslTrustManager.java >@@ -0,0 +1,57 @@ >+/**************************************************************************** >+ * Copyright (c) 2004 Composent, 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: >+ * Composent, Inc. - initial API and implementation >+ *****************************************************************************/ >+ >+package org.eclipse.ecf.provider.filetransfer.httpclient; >+ >+import javax.net.ssl.X509TrustManager; >+ >+public class HttpClientSslTrustManager implements X509TrustManager { >+ // seems to be no purpose >+ public boolean checkClientTrusted(java.security.cert.X509Certificate[] chain) { >+ return true; >+ } >+ >+ // seems to be no purpose >+ public boolean isServerTrusted(java.security.cert.X509Certificate[] chain) { >+ return true; >+ } >+ >+ // seems to be no purpose >+ public boolean isClientTrusted(java.security.cert.X509Certificate[] chain) { >+ return true; >+ } >+ >+ /** >+ * @see javax.net.ssl.X509TrustManager#getAcceptedIssuers() >+ */ >+ public java.security.cert.X509Certificate[] getAcceptedIssuers() { >+ return null; >+ } >+ >+ /** >+ * @see javax.net.ssl.X509TrustManager#checkClientTrusted(java.security.cert.X509Certificate[], >+ * java.lang.String) >+ */ >+ public void checkClientTrusted(java.security.cert.X509Certificate[] chain, >+ String authType) { >+ // don't need to do any checks >+ } >+ >+ /** >+ * @see javax.net.ssl.X509TrustManager#checkServerTrusted(java.security.cert.X509Certificate[], >+ * java.lang.String) >+ */ >+ public void checkServerTrusted(java.security.cert.X509Certificate[] chain, >+ String authType) { >+ // don't need to do any checks >+ } >+ >+} >diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/NTLMProxyDetector.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/NTLMProxyDetector.java >new file mode 100644 >index 0000000..b40dbf8 >--- /dev/null >+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient/NTLMProxyDetector.java >@@ -0,0 +1,64 @@ >+/******************************************************************************* >+* Copyright (c) 2009 EclipseSource 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: >+* EclipseSource - initial API and implementation >+* Thomas Joiner - changed to work with HttpClient 4.1 and added SPNEGO detection >+******************************************************************************/ >+package org.eclipse.ecf.provider.filetransfer.httpclient; >+ >+import org.apache.http.auth.AuthScheme; >+import org.apache.http.auth.AuthState; >+import org.apache.http.client.HttpClient; >+import org.apache.http.client.protocol.ClientContext; >+import org.apache.http.protocol.HttpContext; >+ >+public class NTLMProxyDetector { >+ >+ private static final String PROXY_SPNEGO_VALUE = "NEGOTIATE"; //$NON-NLS-1$ >+ private static final String PROXY_NTLM_VALUE = "NTLM"; //$NON-NLS-1$ >+ >+ /** >+ * This method will detect if the request connected to a NTLM proxy >+ * given the {@link HttpContext} provided to one of the {@link HttpClient#execute()} >+ * methods. >+ * >+ * @param context the {@link HttpContext} given to the {@link HttpClient} at execution time >+ * @return true if it connected to an NTLM proxy >+ * @since 5.0 >+ */ >+ public static boolean detectNTLMProxy(HttpContext context) { >+ return isProxyType(context, PROXY_NTLM_VALUE); >+ } >+ >+ private static boolean isProxyType(HttpContext context, String scheme) { >+ if (context == null) >+ return false; >+ AuthState authState = (AuthState) context.getAttribute(ClientContext.PROXY_AUTH_STATE); >+ if (authState == null) >+ return false; >+ AuthScheme authScheme = authState.getAuthScheme(); >+ if (authScheme == null) >+ return false; >+ String schemeName = authScheme.getSchemeName(); >+ if (schemeName == null) >+ return false; >+ return schemeName.equalsIgnoreCase(scheme); >+ } >+ >+ /** >+ * This method will detect if the request connected to a SPNEGO proxy >+ * given the {@link HttpContext} provided to one of the {@link HttpClient#execute()} >+ * methods. >+ * >+ * @param context the {@link HttpContext} given to the {@link HttpClient} at execution time >+ * @return true if it connected to an SPNEGO proxy >+ * @since 5.0 >+ */ >+ public static boolean detectSPNEGOProxy(HttpContext context) { >+ return isProxyType(context, PROXY_SPNEGO_VALUE); >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 251740
:
195753
| 195763