From 24cd2e550dec5ccea26d403bf8eb2595c8114b19 Mon Sep 17 00:00:00 2001 From: slewis Date: Thu, 2 May 2019 14:16:23 -0700 Subject: Added httpclient45 provider contribution This contribution was via this bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=544447 and approved by EF on 5/2/2019 via this CQ: https://dev.eclipse.org/ipzilla/show_bug.cgi?id=19623 Change-Id: I9bf8e16f4a417cf5bd5de49a26caf1f8bbf56392 --- .../.classpath | 7 + .../.project | 39 + .../.settings/org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.jdt.core.prefs | 370 +++++++ .../.settings/org.eclipse.jdt.launching.prefs | 3 + .../.settings/org.eclipse.jdt.ui.prefs | 61 ++ .../.settings/org.eclipse.m2e.core.prefs | 4 + .../.settings/org.eclipse.pde.api.tools.prefs | 97 ++ .../.settings/org.eclipse.pde.ds.annotations.prefs | 8 + .../.settings/org.eclipse.pde.prefs | 27 + .../META-INF/MANIFEST.MF | 28 + ....win32.Win32HttpClientConfigurationModifier.xml | 4 + ...er.httpclient45.win32.Win32NTLMProxyHandler.xml | 7 + .../about.html | 262 +++++ .../asl-v20.txt | 202 ++++ .../build.properties | 11 + .../plugin.properties | 10 + .../pom.xml | 33 + .../Win32HttpClientConfigurationModifier.java | 150 +++ .../httpclient45/win32/Win32NTLMProxyHandler.java | 50 + .../.classpath | 7 + .../.gitignore | 2 + .../.options | 10 + .../.project | 39 + .../.settings/org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.jdt.core.prefs | 370 +++++++ .../.settings/org.eclipse.jdt.launching.prefs | 3 + .../.settings/org.eclipse.jdt.ui.prefs | 61 ++ .../.settings/org.eclipse.pde.api.tools.prefs | 97 ++ .../.settings/org.eclipse.pde.ds.annotations.prefs | 8 + .../.settings/org.eclipse.pde.prefs | 27 + .../META-INF/MANIFEST.MF | 56 ++ ...etransfer.httpclient45.ECFHttpClientFactory.xml | 7 + .../about.html | 265 +++++ .../asl-v20.txt | 202 ++++ .../build.properties | 15 + .../plugin.properties | 11 + .../plugin.xml | 32 + .../pom.xml | 39 + .../filetransfer/httpclient45/Activator.java | 348 +++++++ .../httpclient45/DefaultNTLMProxyHandler.java | 59 ++ .../httpclient45/ECFHttpClientFactory.java | 275 ++++++ .../HttpClientDefaultSSLSocketFactoryModifier.java | 78 ++ .../httpclient45/HttpClientModifierAdapter.java | 40 + .../HttpClientProxyCredentialProvider.java | 308 ++++++ .../httpclient45/HttpClientSslTrustManager.java | 56 ++ .../httpclient45/IHttpClientFactory.java | 25 + .../httpclient45/IHttpClientModifier.java | 26 + .../httpclient45/INTLMProxyHandler.java | 22 + .../filetransfer/httpclient45/Messages.java | 47 + .../httpclient45/NTLMProxyDetector.java | 64 ++ .../filetransfer/httpclient45/messages.properties | 16 + .../HttpClientBrowseFileTransferFactory.java | 79 ++ .../httpclient45/HttpClientFileSystemBrowser.java | 376 +++++++ .../httpclient45/HttpClientOptions.java | 30 + .../HttpClientRetrieveFileTransfer.java | 1044 ++++++++++++++++++++ .../HttpClientRetrieveFileTransferFactory.java | 25 + 57 files changed, 5546 insertions(+) create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.classpath create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.project create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.core.resources.prefs create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.jdt.core.prefs create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.jdt.launching.prefs create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.jdt.ui.prefs create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.m2e.core.prefs create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.pde.api.tools.prefs create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.pde.ds.annotations.prefs create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.pde.prefs create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/META-INF/MANIFEST.MF create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/OSGI-INF/services/org.eclipse.ecf.internal.provider.filetransfer.httpclient45.win32.Win32HttpClientConfigurationModifier.xml create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/OSGI-INF/services/org.eclipse.ecf.internal.provider.filetransfer.httpclient45.win32.Win32NTLMProxyHandler.xml create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/about.html create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/asl-v20.txt create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/build.properties create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/plugin.properties create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/pom.xml create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/win32/Win32HttpClientConfigurationModifier.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/win32/Win32NTLMProxyHandler.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.classpath create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.gitignore create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.options create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.project create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.core.resources.prefs create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.jdt.core.prefs create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.jdt.launching.prefs create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.jdt.ui.prefs create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.pde.api.tools.prefs create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.pde.ds.annotations.prefs create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.pde.prefs create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/META-INF/MANIFEST.MF create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/OSGI-INF/services/org.eclipse.ecf.internal.provider.filetransfer.httpclient45.ECFHttpClientFactory.xml create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/about.html create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/asl-v20.txt create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/build.properties create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/plugin.properties create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/plugin.xml create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/pom.xml create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/Activator.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/DefaultNTLMProxyHandler.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/ECFHttpClientFactory.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/HttpClientDefaultSSLSocketFactoryModifier.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/HttpClientModifierAdapter.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/HttpClientProxyCredentialProvider.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/HttpClientSslTrustManager.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/IHttpClientFactory.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/IHttpClientModifier.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/INTLMProxyHandler.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/Messages.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/NTLMProxyDetector.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/messages.properties create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientBrowseFileTransferFactory.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientFileSystemBrowser.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientOptions.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientRetrieveFileTransfer.java create mode 100644 providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientRetrieveFileTransferFactory.java (limited to 'providers/bundles') diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.classpath b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.classpath new file mode 100644 index 000000000..46cec6ed2 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.project b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.project new file mode 100644 index 000000000..b19fd7d77 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.project @@ -0,0 +1,39 @@ + + + org.eclipse.ecf.provider.filetransfer.httpclient45.win32 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.ds.core.builder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.core.resources.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..370ae2c69 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=ISO-8859-1 diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.jdt.core.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..4529666a5 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,370 @@ +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=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.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=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore +org.eclipse.jdt.core.compiler.problem.emptyStatement=warning +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=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.7 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +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_bitwise_operator=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_logical_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=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_string_concatenation=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_additive_operator=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_bitwise_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_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=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_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=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_bitwise_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_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=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_relational_operator=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_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=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_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true +org.eclipse.jdt.core.incompatibleJDKLevel=ignore +org.eclipse.jdt.core.incompleteClasspath=error diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.jdt.launching.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 000000000..c7eda7aff --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.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.httpclient45.win32/.settings/org.eclipse.jdt.ui.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..9e5e00ded --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.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.httpclient45.win32/.settings/org.eclipse.m2e.core.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 000000000..f897a7f1c --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.pde.api.tools.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 000000000..e11a1c57c --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,97 @@ +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 +API_USE_SCAN_FIELD_SEVERITY=Error +API_USE_SCAN_METHOD_SEVERITY=Error +API_USE_SCAN_TYPE_SEVERITY=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=Ignore +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 +MISSING_EE_DESCRIPTIONS=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.httpclient45.win32/.settings/org.eclipse.pde.ds.annotations.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.pde.ds.annotations.prefs new file mode 100644 index 000000000..5f275fd16 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.pde.ds.annotations.prefs @@ -0,0 +1,8 @@ +classpath=true +dsVersion=V1_2 +eclipse.preferences.version=1 +enabled=true +generateBundleActivationPolicyLazy=true +path=OSGI-INF/services/ +validationErrorLevel=error +validationErrorLevel.missingImplicitUnbindMethod=error diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.pde.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.settings/org.eclipse.pde.prefs new file mode 100644 index 000000000..05ef9da1a --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/.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.httpclient45.win32/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/META-INF/MANIFEST.MF new file mode 100644 index 000000000..aa6a3a4be --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/META-INF/MANIFEST.MF @@ -0,0 +1,28 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %plugin.name +Bundle-Vendor: %plugin.provider +Bundle-SymbolicName: org.eclipse.ecf.provider.filetransfer.httpclient45.win32;singleton:=true +Automatic-Module-Name: org.eclipse.ecf.provider.filetransfer.httpclient45.win32 +Bundle-Version: 1.0.0.qualifier +Bundle-Localization: plugin +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-ClassPath: . +Require-Bundle: org.eclipse.osgi.services;bundle-version="[3.4.0,4.0.0)", + org.eclipse.ecf;bundle-version="[3.4.0,4.0.0)", + org.eclipse.ecf.filetransfer;bundle-version="[5.0.0,6.0.0)", + org.eclipse.core.runtime;bundle-version="[3.10.0,4.0.0)" +Import-Package: + com.sun.jna.platform.win32;version="[4.1.0,5.0.0)", + org.eclipse.ecf.internal.provider.filetransfer.httpclient45;version="[0.1.0,1.0.0)", + org.apache.http.auth;version="[4.5.0,5.0.0)", + org.apache.http.client;version="[4.5.0,5.0.0)", + org.apache.http.client.config;version="[4.5.0,5.0.0)", + org.apache.http.client.protocol;version="[4.5.0,5.0.0)", + org.apache.http.config;version="[4.3.3,5.0.0)", + org.apache.http.impl.auth;version="[4.5.0,5.0.0)", + org.apache.http.impl.auth.win;version="[4.5.0,5.0.0)", + org.apache.http.impl.client;version="[4.5.0,5.0.0)" +Eclipse-PlatformFilter: (osgi.os=win32) +Service-Component: OSGI-INF/services/*.xml diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/OSGI-INF/services/org.eclipse.ecf.internal.provider.filetransfer.httpclient45.win32.Win32HttpClientConfigurationModifier.xml b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/OSGI-INF/services/org.eclipse.ecf.internal.provider.filetransfer.httpclient45.win32.Win32HttpClientConfigurationModifier.xml new file mode 100644 index 000000000..e35e54b2e --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/OSGI-INF/services/org.eclipse.ecf.internal.provider.filetransfer.httpclient45.win32.Win32HttpClientConfigurationModifier.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/OSGI-INF/services/org.eclipse.ecf.internal.provider.filetransfer.httpclient45.win32.Win32NTLMProxyHandler.xml b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/OSGI-INF/services/org.eclipse.ecf.internal.provider.filetransfer.httpclient45.win32.Win32NTLMProxyHandler.xml new file mode 100644 index 000000000..135a45b20 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/OSGI-INF/services/org.eclipse.ecf.internal.provider.filetransfer.httpclient45.win32.Win32NTLMProxyHandler.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/about.html b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/about.html new file mode 100644 index 000000000..f8268a6aa --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/about.html @@ -0,0 +1,262 @@ + + + + +About + + +

About This Content

+ +

April 25, 2019

+

License

+ +

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

+ +

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

+ +

Third Party Content

+

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.

+ +

Apache HttpComponents v4.5.6

+ +

This plugin is based on software developed by the Apache HttpComponents project at http://hc.apache.org/. +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 asl-v20.txt and +at http://www.apache.org/licenses/LICENSE-2.0. +

+ +

Java Native Access (JNA) v4.5.1

+ +

This plugin is based on software software developed by Timothy Wall <> as part of the Java Native Access project. Though the JNA project is dually licensed, the Eclipse Foundation elects to use the package under the ASL, version 2 (ASL__VERSION_2.html) license.

+ +

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 asl-v20.txt and +at http://www.apache.org/licenses/LICENSE-2.0. +

+ +

More specifically:

+ +

+ +
+
+                                 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.
+
+ + + \ No newline at end of file diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/asl-v20.txt b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/asl-v20.txt new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/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.httpclient45.win32/build.properties b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/build.properties new file mode 100644 index 000000000..2287ba5e1 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/build.properties @@ -0,0 +1,11 @@ +source.. = src/ +bin.includes = META-INF/,\ + .,\ + OSGI-INF/,\ + about.html,\ + plugin.properties,\ + asl-v20.txt +src.includes = about.html,\ + asl-v20.txt +## OSGi Services types for Tycho +jars.extra.classpath = platform:/plugin/org.eclipse.osgi.services diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/plugin.properties b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/plugin.properties new file mode 100644 index 000000000..776a753c9 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/plugin.properties @@ -0,0 +1,10 @@ +############################################################################ +# Copyright (c) 2019 Yatta Solutions 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 HttpComponents 4.5 Filetransfer Windows Components +plugin.provider=Eclipse.org - ECF diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/pom.xml b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/pom.xml new file mode 100644 index 000000000..7675400ae --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + + org.eclipse.ecf + ecf-parent + 1.0.0-SNAPSHOT + ../../../ + + org.eclipse.ecf + org.eclipse.ecf.provider.filetransfer.httpclient45.win32 + 1.0.0-SNAPSHOT + eclipse-plugin + + + + + org.eclipse.tycho + target-platform-configuration + + + + win32 + * + * + + + + + + + diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/win32/Win32HttpClientConfigurationModifier.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/win32/Win32HttpClientConfigurationModifier.java new file mode 100644 index 000000000..761d77f00 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/win32/Win32HttpClientConfigurationModifier.java @@ -0,0 +1,150 @@ +/******************************************************************************* +* Copyright (c) 2019 Yatta Solutions 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: +* Yatta Solutions - initial API and implementation +******************************************************************************/ +package org.eclipse.ecf.internal.provider.filetransfer.httpclient45.win32; + +import com.sun.jna.platform.win32.Sspi; +import java.util.Map; +import org.apache.http.auth.AuthSchemeProvider; +import org.apache.http.client.CredentialsProvider; +import org.apache.http.client.config.AuthSchemes; +import org.apache.http.client.config.RequestConfig.Builder; +import org.apache.http.client.protocol.HttpClientContext; +import org.apache.http.config.Lookup; +import org.apache.http.config.Registry; +import org.apache.http.config.RegistryBuilder; +import org.apache.http.impl.auth.BasicSchemeFactory; +import org.apache.http.impl.auth.DigestSchemeFactory; +import org.apache.http.impl.auth.KerberosSchemeFactory; +import org.apache.http.impl.auth.win.WindowsCredentialsProvider; +import org.apache.http.impl.auth.win.WindowsNTLMSchemeFactory; +import org.apache.http.impl.auth.win.WindowsNegotiateSchemeFactory; +import org.apache.http.impl.client.HttpClientBuilder; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.HttpClientModifierAdapter; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; + +@Component +public class Win32HttpClientConfigurationModifier extends HttpClientModifierAdapter { + + public static final String ID = "org.eclipse.ecf.provider.filetransfer.httpclient45.win32"; //$NON-NLS-1$ + + public static final String SERVICE_PRINCIPAL_NAME_ATTRIBUTE = "servicePrincipal"; //$NON-NLS-1$ + + public static final String SERVICE_PRINCIPAL_NAME_PROPERTY = ID + "." + SERVICE_PRINCIPAL_NAME_ATTRIBUTE; //$NON-NLS-1$ + + private static Boolean winAuthAvailable; + + private String servicePrincipalName; + + public static boolean isWinAuthAvailable() { + if (winAuthAvailable == null) { + // from org.apache.http.impl.client.WinHttpClients.isWinAuthAvailable() + try { + winAuthAvailable = Sspi.MAX_TOKEN_SIZE > 0; + } catch (Exception ignore) { // Likely ClassNotFound + winAuthAvailable = false; + } + } + return winAuthAvailable; + } + + @Override + public HttpClientBuilder modifyClient(HttpClientBuilder builder) { + if (!isWinAuthAvailable()) { + return builder; + } + HttpClientBuilder winBuilder = builder == null ? HttpClientBuilder.create() : builder; + Lookup authSchemeRegistry = createAuthSchemeRegistry(); + return winBuilder.setDefaultAuthSchemeRegistry(authSchemeRegistry); + } + + @Override + @SuppressWarnings("restriction") + public CredentialsProvider modifyCredentialsProvider(CredentialsProvider credentialsProvider) { + if (credentialsProvider == null || !isWinAuthAvailable() || credentialsProvider instanceof WindowsCredentialsProvider) { + return credentialsProvider; + } + + CredentialsProvider winCredentialsProvider = new WindowsCredentialsProvider(credentialsProvider); + return winCredentialsProvider; + } + + @Override + public HttpClientContext modifyContext(HttpClientContext context) { + Lookup authSchemeRegistry = context.getAuthSchemeRegistry(); + if (authSchemeRegistry == null) { + authSchemeRegistry = createAuthSchemeRegistry(); + } else { + authSchemeRegistry = modifyAuthSchemeRegistry(authSchemeRegistry); + } + context.setAuthSchemeRegistry(authSchemeRegistry); + return context; + } + + public void setServicePrincipalName(String servicePrincipalName) { + this.servicePrincipalName = servicePrincipalName; + } + + public String getServicePrincipalName() { + return servicePrincipalName; + } + + private Lookup createAuthSchemeRegistry() { + Registry authSchemeRegistry = setWinAuthSchemes(RegistryBuilder. create().register(AuthSchemes.BASIC, new BasicSchemeFactory()).register(AuthSchemes.DIGEST, new DigestSchemeFactory()).register(AuthSchemes.KERBEROS, new KerberosSchemeFactory())).build(); + return authSchemeRegistry; + } + + private Lookup modifyAuthSchemeRegistry(Lookup authSchemeRegistry) { + RegistryBuilder builder = RegistryBuilder.create(); + for (String scheme : new String[] {AuthSchemes.BASIC, AuthSchemes.DIGEST, AuthSchemes.KERBEROS}) { + AuthSchemeProvider provider = authSchemeRegistry.lookup(scheme); + if (provider != null) { + builder.register(scheme, provider); + } + } + if (authSchemeRegistry.lookup(AuthSchemes.KERBEROS) == null) { + builder.register(AuthSchemes.KERBEROS, new KerberosSchemeFactory()); + } + setWinAuthSchemes(builder); + return builder.build(); + } + + @SuppressWarnings("restriction") + private RegistryBuilder setWinAuthSchemes(RegistryBuilder builder) { + return builder.register(AuthSchemes.NTLM, new WindowsNTLMSchemeFactory(servicePrincipalName)).register(AuthSchemes.SPNEGO, new WindowsNegotiateSchemeFactory(servicePrincipalName)); + } + + @Activate + public synchronized void activate(BundleContext context, Map properties) { + this.servicePrincipalName = getServicePrincipalName(properties); + } + + private String getServicePrincipalName(Map properties) { + Object servicePrincipalValue = properties.get(SERVICE_PRINCIPAL_NAME_ATTRIBUTE); + if (servicePrincipalValue != null) { + return servicePrincipalValue.toString(); + } + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + if (bundle != null) { + return bundle.getBundleContext().getProperty(SERVICE_PRINCIPAL_NAME_PROPERTY); + } + return System.getProperty(SERVICE_PRINCIPAL_NAME_PROPERTY); + } + + @Override + public Builder modifyRequestConfig(Builder config, HttpClientContext context, Map options) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/win32/Win32NTLMProxyHandler.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/win32/Win32NTLMProxyHandler.java new file mode 100644 index 000000000..ce7f80329 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45.win32/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/win32/Win32NTLMProxyHandler.java @@ -0,0 +1,50 @@ +/******************************************************************************* +* Copyright (c) 2019 Yatta Solutions 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: +* Yatta Solutions - initial API and implementation +******************************************************************************/ +package org.eclipse.ecf.internal.provider.filetransfer.httpclient45.win32; + +import java.util.Map; +import org.eclipse.ecf.core.util.Proxy; +import org.eclipse.ecf.filetransfer.BrowseFileTransferException; +import org.eclipse.ecf.filetransfer.IncomingFileTransferException; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.DefaultNTLMProxyHandler; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.INTLMProxyHandler; +import org.osgi.service.component.annotations.Component; + +@Component(service = {INTLMProxyHandler.class}) +public class Win32NTLMProxyHandler extends DefaultNTLMProxyHandler { + + @Override + public boolean allowNTLMAuthentication(Map connectOptions) { + DefaultNTLMProxyHandler.setSeenNTLM(); + return true; + } + + protected boolean isExplicitAllowNTLMAuthentication() { + return super.allowNTLMAuthentication(null); + } + + @Override + public void handleNTLMProxy(Proxy proxy, int code) throws IncomingFileTransferException { + DefaultNTLMProxyHandler.setSeenNTLM(); + if (Win32HttpClientConfigurationModifier.isWinAuthAvailable() && (code != 407 || isExplicitAllowNTLMAuthentication())) { + return; + } + super.handleNTLMProxy(proxy, code); + } + + @Override + public void handleSPNEGOProxy(Proxy proxy, int code) throws BrowseFileTransferException { + if (Win32HttpClientConfigurationModifier.isWinAuthAvailable() && (code != 407 || isExplicitAllowNTLMAuthentication())) { + return; + } + super.handleSPNEGOProxy(proxy, code); + } + +} diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.classpath b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.classpath new file mode 100644 index 000000000..b9a5b1ec6 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.gitignore b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.gitignore new file mode 100644 index 000000000..8e92efe09 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.gitignore @@ -0,0 +1,2 @@ +bin +/.settings/org.eclipse.m2e.core.prefs diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.options b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.options new file mode 100644 index 000000000..849ada6b0 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.options @@ -0,0 +1,10 @@ +org.eclipse.ecf.provider.filetransfer.httpclient4/debug=false +org.eclipse.ecf.provider.filetransfer.httpclient4/debug/exceptions/catching=false +org.eclipse.ecf.provider.filetransfer.httpclient4/debug/exceptions/throwing=false +org.eclipse.ecf.provider.filetransfer.httpclient4/debug/methods/entering=false +org.eclipse.ecf.provider.filetransfer.httpclient4/debug/methods/exiting=false +org.eclipse.ecf.provider.filetransfer.httpclient45/debug=false +org.eclipse.ecf.provider.filetransfer.httpclient45/debug/exceptions/catching=false +org.eclipse.ecf.provider.filetransfer.httpclient45/debug/exceptions/throwing=false +org.eclipse.ecf.provider.filetransfer.httpclient45/debug/methods/entering=false +org.eclipse.ecf.provider.filetransfer.httpclient45/debug/methods/exiting=false diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.project b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.project new file mode 100644 index 000000000..c7e95de15 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.project @@ -0,0 +1,39 @@ + + + org.eclipse.ecf.provider.filetransfer.httpclient45 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.ds.core.builder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.core.resources.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..370ae2c69 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=ISO-8859-1 diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.jdt.core.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..4529666a5 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,370 @@ +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=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.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=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore +org.eclipse.jdt.core.compiler.problem.emptyStatement=warning +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=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.7 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +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_bitwise_operator=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_logical_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=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_string_concatenation=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_additive_operator=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_bitwise_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_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=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_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=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_bitwise_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_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=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_relational_operator=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_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=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_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true +org.eclipse.jdt.core.incompatibleJDKLevel=ignore +org.eclipse.jdt.core.incompleteClasspath=error diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.jdt.launching.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 000000000..c7eda7aff --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.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.httpclient45/.settings/org.eclipse.jdt.ui.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..9e5e00ded --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.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.httpclient45/.settings/org.eclipse.pde.api.tools.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 000000000..e11a1c57c --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,97 @@ +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 +API_USE_SCAN_FIELD_SEVERITY=Error +API_USE_SCAN_METHOD_SEVERITY=Error +API_USE_SCAN_TYPE_SEVERITY=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=Ignore +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 +MISSING_EE_DESCRIPTIONS=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.httpclient45/.settings/org.eclipse.pde.ds.annotations.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.pde.ds.annotations.prefs new file mode 100644 index 000000000..5f275fd16 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.pde.ds.annotations.prefs @@ -0,0 +1,8 @@ +classpath=true +dsVersion=V1_2 +eclipse.preferences.version=1 +enabled=true +generateBundleActivationPolicyLazy=true +path=OSGI-INF/services/ +validationErrorLevel=error +validationErrorLevel.missingImplicitUnbindMethod=error diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.pde.prefs b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.settings/org.eclipse.pde.prefs new file mode 100644 index 000000000..05ef9da1a --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/.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.httpclient45/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/META-INF/MANIFEST.MF new file mode 100644 index 000000000..46d7fb893 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/META-INF/MANIFEST.MF @@ -0,0 +1,56 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %plugin.name +Bundle-Vendor: %plugin.provider +Bundle-SymbolicName: org.eclipse.ecf.provider.filetransfer.httpclient45;singleton:=true +Automatic-Module-Name: org.eclipse.ecf.provider.filetransfer.httpclient45 +Bundle-Version: 1.0.0.qualifier +Bundle-Localization: plugin +Bundle-Activator: org.eclipse.ecf.internal.provider.filetransfer.httpclient45.Activator +Bundle-ClassPath: . +Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.0.0,4.0.0)", + org.eclipse.ecf.provider.filetransfer;bundle-version="[3.2.200,4.0.0)", + org.eclipse.ecf;bundle-version="[3.4.0,4.0.0)", + org.eclipse.ecf.filetransfer;bundle-version="[5.0.0,6.0.0)" +Import-Package: org.apache.http;version="[4.4.0,5.0.0)", + org.apache.http.auth;version="[4.5.0,5.0.0)", + org.apache.http.client;version="[4.5.0,5.0.0)", + org.apache.http.client.config;version="[4.5.0,5.0.0)", + org.apache.http.client.methods;version="[4.5.0,5.0.0)", + org.apache.http.client.protocol;version="[4.5.0,5.0.0)", + org.apache.http.client.utils;version="[4.5.0,5.0.0)", + org.apache.http.config;version="[4.4.0,5.0.0)", + org.apache.http.conn.socket;version="[4.5.0,5.0.0)", + org.apache.http.conn.ssl;version="[4.5.0,5.0.0)", + org.apache.http.conn.util;version="[4.5.0,5.0.0)", + org.apache.http.impl.auth;version="[4.5.0,5.0.0)", + org.apache.http.impl.client;version="[4.5.0,5.0.0)", + org.apache.http.message;version="[4.4.0,5.0.0)", + org.apache.http.protocol;version="[4.4.0,5.0.0)", + org.apache.http.util;version="[4.4.0,5.0.0)", + org.eclipse.core.runtime.jobs, + org.eclipse.osgi.service.debug;version="[1.2.0,2.0.0)", + org.eclipse.osgi.util;version="[1.0.0,2.0.0)", + org.osgi.framework;version="[1.2.0,2.0.0)", + org.osgi.service.log;version="[1.2.0,2.0.0)", + org.osgi.util.tracker;version="[1.2.0,2.0.0)" +Export-Package: org.eclipse.ecf.internal.provider.filetransfer.httpclient45;version="0.1.0";x-friends:="org.eclipse.ecf.provider.filetransfer.httpclient45.win32", + org.eclipse.ecf.provider.filetransfer.httpclient45;version="0.1.0"; + uses:="org.eclipse.ecf.internal.provider.filetransfer.httpclient45, + org.apache.http.auth, + org.apache.http.client.methods, + org.apache.http.client.protocol, + org.apache.http.impl.client, + org.eclipse.core.runtime, + org.eclipse.ecf.core.identity, + org.eclipse.ecf.core.security, + org.eclipse.ecf.core.util, + org.eclipse.ecf.filetransfer, + org.eclipse.ecf.filetransfer.service, + org.eclipse.ecf.filetransfer.identity, + org.eclipse.ecf.provider.filetransfer.browse, + org.eclipse.ecf.provider.filetransfer.retrieve, + org.eclipse.ecf.provider.filetransfer.util" +Service-Component: OSGI-INF/services/*.xml +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-ActivationPolicy: lazy diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/OSGI-INF/services/org.eclipse.ecf.internal.provider.filetransfer.httpclient45.ECFHttpClientFactory.xml b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/OSGI-INF/services/org.eclipse.ecf.internal.provider.filetransfer.httpclient45.ECFHttpClientFactory.xml new file mode 100644 index 000000000..46ed9c121 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/OSGI-INF/services/org.eclipse.ecf.internal.provider.filetransfer.httpclient45.ECFHttpClientFactory.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/about.html b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/about.html new file mode 100644 index 000000000..e29463d1d --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/about.html @@ -0,0 +1,265 @@ + + + + +About + + +

About This Content

+ +

April 25, 2019

+

License

+ +

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

+ +

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

+ +

Third Party Content

+

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.

+ +

Apache HttpComponents v4.5.6

+ +

This plugin is based on software developed by the Apache HttpComponents project at http://hc.apache.org/. +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 asl-v20.txt and +at http://www.apache.org/licenses/LICENSE-2.0. +

+ +

Apache Commons Logging v1.2.0

+ +

This plugin is based on software developed by the Apache Commons Codec project at http://jakarta.apache.org/commons/logging/. +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 asl-v20.txt and +at http://www.apache.org/licenses/LICENSE-2.0. +

+ +

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 http://www.apache.org/licenses/LICENSE-2.0. +

+ +

More specifically:

+ +

+ +
+
+                                 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.
+
+ + + \ No newline at end of file diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/asl-v20.txt b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/asl-v20.txt new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/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.httpclient45/build.properties b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/build.properties new file mode 100644 index 000000000..d9caeabf3 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/build.properties @@ -0,0 +1,15 @@ +source.. = src/ +bin.includes = META-INF/,\ + .,\ + OSGI-INF/,\ + plugin.xml,\ + about.html,\ + plugin.properties,\ + asl-v20.txt,\ + .options +src.includes = about.html,\ + asl-v20.txt +## JDT Null Analysis for Eclipse +additional.bundles = org.eclipse.jdt.annotation +## JDT Null Analysis and OSGi Services types for Tycho +jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation,platform:/plugin/org.eclipse.osgi.services diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/plugin.properties b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/plugin.properties new file mode 100644 index 000000000..9d3f48dea --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/plugin.properties @@ -0,0 +1,11 @@ +############################################################################ +# Copyright (c) 2019 Yatta Solutions 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 HttpComponents 4.5 Filetransfer Provider +plugin.provider=Eclipse.org - ECF + diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/plugin.xml b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/plugin.xml new file mode 100644 index 000000000..9b2868a44 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/plugin.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/pom.xml b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/pom.xml new file mode 100644 index 000000000..59f3852f0 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + + org.eclipse.ecf + ecf-parent + 1.0.0-SNAPSHOT + ../../../ + + org.eclipse.ecf + org.eclipse.ecf.provider.filetransfer.httpclient45 + 1.0.0-SNAPSHOT + eclipse-plugin + + + + + org.eclipse.tycho + target-platform-configuration + + + + + + + + + p2-installable-unit + org.eclipse.osgi.services + 3.6.0 + + + + + + + + diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/Activator.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/Activator.java new file mode 100644 index 000000000..abcd8aaf2 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/Activator.java @@ -0,0 +1,348 @@ +/**************************************************************************** + * Copyright (c) 2019 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 + * Yatta Solutions - HttpClient 4.5 implementation + *****************************************************************************/ +package org.eclipse.ecf.internal.provider.filetransfer.httpclient45; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.Dictionary; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; +import javax.net.ssl.SSLSocketFactory; +import org.apache.http.client.HttpClient; +import org.apache.http.impl.client.CloseableHttpClient; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.ecf.core.util.ECFRuntimeException; +import org.eclipse.ecf.core.util.LogHelper; +import org.eclipse.ecf.core.util.Trace; +import org.eclipse.ecf.filetransfer.service.IRemoteFileSystemBrowser; +import org.eclipse.ecf.filetransfer.service.IRetrieveFileTransfer; +import org.eclipse.ecf.internal.provider.filetransfer.DebugOptions; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.ECFHttpClientFactory.ModifierRunner; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.Constants; +import org.osgi.framework.InvalidSyntaxException; +import org.osgi.framework.ServiceReference; +import org.osgi.service.log.LogService; +import org.osgi.util.tracker.ServiceTracker; +import org.osgi.util.tracker.ServiceTrackerCustomizer; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator implements BundleActivator { + + private static final class ScopedHttpClientCustomizer implements ServiceTrackerCustomizer { + private final String neededScope; + private final BundleContext context; + + public ScopedHttpClientCustomizer(BundleContext context, String neededScope) { + this.context = context; + this.neededScope = neededScope; + } + + @Override + public CloseableHttpClient addingService(ServiceReference reference) { + if (!hasScope(reference, neededScope)) { + return null; + } + HttpClient service = context.getService(reference); + if (service instanceof CloseableHttpClient) { + return (CloseableHttpClient) service; + } + context.ungetService(reference); + return null; + } + + private boolean hasScope(ServiceReference reference, String neededScope) { + Object scopeProperty = reference.getProperty("http.client.scope"); //$NON-NLS-1$ + if (scopeProperty == null || !(scopeProperty instanceof String)) { + return false; + } + String[] scopes = ((String) scopeProperty).split("\\s*,\\s*"); //$NON-NLS-1$ + boolean hasScope = false; + for (String scope : scopes) { + if (neededScope.equals(scope) || (scope.endsWith("*") && neededScope.startsWith(scope.substring(0, scope.length() - 1)))) { + return true; + } + } + return false; + } + + @Override + public void modifiedService(ServiceReference reference, CloseableHttpClient service) { + if (!hasScope(reference, neededScope)) { + context.ungetService(reference); + } + } + + @Override + public void removedService(ServiceReference reference, CloseableHttpClient service) { + context.ungetService(reference); + } + } + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.ecf.provider.filetransfer.httpclient45"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + private BundleContext context = null; + + private ServiceTracker logServiceTracker = null; + + private ServiceTracker sslSocketFactoryTracker; + + private ServiceTracker ntlmProxyHandlerTracker; + + private ServiceTracker httpClientFactoryTracker; + + private ServiceTracker browseClientTracker; + + private ServiceTracker retrieveClientTracker; + + /** + * The constructor + */ + public Activator() { + // + } + + public BundleContext getContext() { + return context; + } + + @Override + public void start(BundleContext ctxt) throws Exception { + plugin = this; + this.context = ctxt; + applyDebugOptions(ctxt); + } + + private void applyDebugOptions(BundleContext ctxt) { + ServiceReference debugRef = ctxt.getServiceReference(org.eclipse.osgi.service.debug.DebugOptions.class); + org.eclipse.osgi.service.debug.DebugOptions debugOptions = debugRef == null ? null : ctxt.getService(debugRef); + if (debugOptions == null) { + return; + } + try { + if (!debugOptions.isDebugEnabled()) { + return; + } + Map options = debugOptions.getOptions(); + String ourDebugPrefix = PLUGIN_ID + "/"; + String ecfDebugPrefix = "org.eclipse.ecf.provider.filetransfer.httpclient4/"; + for (Map.Entry entry : options.entrySet()) { + if (entry.getKey() != null && entry.getKey().startsWith(ourDebugPrefix)) { + String ecfOption = ecfDebugPrefix + entry.getKey().substring(ourDebugPrefix.length()); + String ecfValue = options.get(ecfOption); + if (ecfValue == null) { + debugOptions.setOption(ecfOption, entry.getValue()); + } + } + } + } finally { + ctxt.ungetService(debugRef); + } + } + + @Override + public synchronized void stop(BundleContext ctxt) throws Exception { + if (sslSocketFactoryTracker != null) { + sslSocketFactoryTracker.close(); + } + + if (logServiceTracker != null) { + logServiceTracker.close(); + } + + if (ntlmProxyHandlerTracker != null) { + ntlmProxyHandlerTracker.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; + } + + private synchronized LogService getLogService() { + if (logServiceTracker == null) { + logServiceTracker = new ServiceTracker(this.context, LogService.class, null); + logServiceTracker.open(); + } + return logServiceTracker.getService(); + } + + public void log(IStatus status) { + LogService logService = getLogService(); + if (logService != null) { + logService.log(LogHelper.getLogCode(status), LogHelper.getLogMessage(status), status.getException()); + } + } + + public synchronized SSLSocketFactory getSSLSocketFactory() { + if (sslSocketFactoryTracker == null) { + sslSocketFactoryTracker = new ServiceTracker(this.context, SSLSocketFactory.class, null); + sslSocketFactoryTracker.open(); + } + SSLSocketFactory service = sslSocketFactoryTracker.getService(); + return service; + } + + public synchronized INTLMProxyHandler getNTLMProxyHandler() { + if (ntlmProxyHandlerTracker == null) { + ntlmProxyHandlerTracker = new ServiceTracker(this.context, INTLMProxyHandler.class, null); + ntlmProxyHandlerTracker.open(); + } + INTLMProxyHandler service = ntlmProxyHandlerTracker.getService(); + if (service == null) { + service = new DefaultNTLMProxyHandler(); + } + return service; + } + + public synchronized IHttpClientFactory getHttpClientFactory() { + if (httpClientFactoryTracker == null) { + httpClientFactoryTracker = new ServiceTracker(this.context, IHttpClientFactory.class, null); + httpClientFactoryTracker.open(); + } + IHttpClientFactory service = httpClientFactoryTracker.getService(); + if (service == null) { + service = new ECFHttpClientFactory(); + Dictionary serviceProperties = new Hashtable(); + serviceProperties.put(Constants.SERVICE_RANKING, Integer.MIN_VALUE); + context.registerService(IHttpClientFactory.class, service, serviceProperties); + } + return service; + } + + public synchronized CloseableHttpClient getBrowseHttpClient() { + if (browseClientTracker == null) { + browseClientTracker = new ServiceTracker(context, HttpClient.class, new ScopedHttpClientCustomizer(context, IRemoteFileSystemBrowser.class.getName())); + browseClientTracker.open(); + } + CloseableHttpClient service = browseClientTracker.getService(); + if (service == null) { + service = registerHttpClient(); + } + return service; + } + + public synchronized CloseableHttpClient getRetrieveHttpClient() { + if (retrieveClientTracker == null) { + retrieveClientTracker = new ServiceTracker(context, HttpClient.class, new ScopedHttpClientCustomizer(context, IRetrieveFileTransfer.class.getName())); + retrieveClientTracker.open(); + } + CloseableHttpClient service = retrieveClientTracker.getService(); + if (service == null) { + service = registerHttpClient(); + } + return service; + } + + private CloseableHttpClient registerHttpClient() { + CloseableHttpClient client = getHttpClientFactory().newClient().build(); + + Dictionary serviceProperties = new Hashtable(); + serviceProperties.put(Constants.SERVICE_RANKING, Integer.MIN_VALUE); + serviceProperties.put("http.client.scope", "org.eclipse.ecf.filetransfer.service.*"); + context.registerService(new String[] {HttpClient.class.getName(), CloseableHttpClient.class.getName()}, client, serviceProperties); + + return client; + } + + 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$ + } + } + + protected T runModifiers(T value, ModifierRunner modifierRunner) { + T modifiedValue = value; + List> orderedServices = getModifierReferences(); + for (ServiceReference serviceReference : orderedServices) { + IHttpClientModifier modifier = this.context.getService(serviceReference); + try { + if (modifier == null) { + continue; + } + T newValue = modifierRunner.run(modifier, modifiedValue); + if (newValue != null) { + modifiedValue = newValue; + } + } finally { + this.context.ungetService(serviceReference); + } + } + return modifiedValue; + } + + private List> getModifierReferences() { + Collection> serviceReferences; + try { + serviceReferences = this.context.getServiceReferences(IHttpClientModifier.class, null); + } catch (InvalidSyntaxException e) { + // Can't happen + throw new ECFRuntimeException(e); + } + List> orderedServices = new ArrayList>(serviceReferences); + if (orderedServices.size() < 2) { + return orderedServices; + } + Collections.sort(orderedServices, new Comparator>() { + + @Override + public int compare(ServiceReference o1, ServiceReference o2) { + if (o1 == o2) { + return 0; + } + int ranking1 = getServiceRanking(o1); + int ranking2 = getServiceRanking(o2); + // Lowest ranking first + return ranking1 - ranking2; + } + + private int getServiceRanking(ServiceReference reference) { + Object rankingValue = reference.getProperty(Constants.SERVICE_RANKING); + if (rankingValue instanceof Integer) { + return (Integer) rankingValue; + } else if (rankingValue instanceof String) { + try { + return Integer.parseInt((String) rankingValue); + } catch (NumberFormatException e) { + Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, Activator.class, "getServiceRanking", e); //$NON-NLS-1$ + } + + } + return 0; + } + + }); + return orderedServices; + } + +} diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/DefaultNTLMProxyHandler.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/DefaultNTLMProxyHandler.java new file mode 100644 index 000000000..93f60a60f --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/DefaultNTLMProxyHandler.java @@ -0,0 +1,59 @@ +/******************************************************************************* +* Copyright (c) 2019 Yatta Solutions 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: +* Yatta Solutions - initial API and implementation +******************************************************************************/ +package org.eclipse.ecf.internal.provider.filetransfer.httpclient45; + +import java.util.Map; +import org.apache.http.HttpStatus; +import org.eclipse.ecf.core.util.Proxy; +import org.eclipse.ecf.filetransfer.BrowseFileTransferException; +import org.eclipse.ecf.filetransfer.IncomingFileTransferException; +import org.eclipse.ecf.provider.filetransfer.httpclient45.HttpClientOptions; + +public class DefaultNTLMProxyHandler implements INTLMProxyHandler { + private static boolean seenNTLM; + + public static boolean seenNTLM() { + return seenNTLM; + } + + public static void setSeenNTLM() { + seenNTLM = true; + } + + public static void resetSeenNTLM() { + seenNTLM = false; + } + + @Override + public boolean allowNTLMAuthentication(Map connectOptions) { + seenNTLM = true; + if (connectOptions != null && connectOptions.get(HttpClientOptions.FORCE_NTLM_PROP) != null) { + return true; + } + return (System.getProperty(HttpClientOptions.FORCE_NTLM_PROP) != null); + } + + @Override + public void handleNTLMProxy(Proxy proxy, int code) throws IncomingFileTransferException { + seenNTLM = true; + if (code >= HttpStatus.SC_BAD_REQUEST) { + throw new IncomingFileTransferException("HttpClient Provider is not configured to support NTLM proxy authentication.", //$NON-NLS-1$ + HttpClientOptions.NTLM_PROXY_RESPONSE_CODE); + } + } + + @Override + public void handleSPNEGOProxy(Proxy proxy, int code) throws BrowseFileTransferException { + if (code >= HttpStatus.SC_BAD_REQUEST) { + throw new BrowseFileTransferException("HttpClient Provider does not support the use of SPNEGO proxy authentication."); //$NON-NLS-1$ + } + } + +} diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/ECFHttpClientFactory.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/ECFHttpClientFactory.java new file mode 100644 index 000000000..1b6715034 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/ECFHttpClientFactory.java @@ -0,0 +1,275 @@ +/******************************************************************************* +* Copyright (c) 2019 Yatta Solutions 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: +* Yatta Solutions - initial API and implementation +******************************************************************************/ +package org.eclipse.ecf.internal.provider.filetransfer.httpclient45; + +import java.io.IOException; +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.SSLSocketFactory; +import org.apache.http.auth.AuthSchemeProvider; +import org.apache.http.client.CredentialsProvider; +import org.apache.http.client.config.AuthSchemes; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.config.RequestConfig.Builder; +import org.apache.http.client.protocol.HttpClientContext; +import org.apache.http.config.Registry; +import org.apache.http.config.RegistryBuilder; +import org.apache.http.config.SocketConfig; +import org.apache.http.conn.ssl.DefaultHostnameVerifier; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.conn.util.PublicSuffixMatcher; +import org.apache.http.conn.util.PublicSuffixMatcherLoader; +import org.apache.http.impl.auth.BasicSchemeFactory; +import org.apache.http.impl.auth.DigestSchemeFactory; +import org.apache.http.impl.auth.NTLMSchemeFactory; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.protocol.HttpContext; +import org.apache.http.util.TextUtils; +import org.eclipse.ecf.core.util.ECFRuntimeException; +import org.eclipse.ecf.core.util.Trace; +import org.eclipse.ecf.internal.provider.filetransfer.DebugOptions; +import org.eclipse.ecf.provider.filetransfer.httpclient45.HttpClientOptions; +import org.eclipse.ecf.provider.filetransfer.httpclient45.HttpClientRetrieveFileTransfer; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Deactivate; + +@Component +public class ECFHttpClientFactory implements IHttpClientFactory { + private static final List DEFAULT_PREFERRED_AUTH_SCHEMES_NO_NTLM = Arrays.asList(AuthSchemes.BASIC, AuthSchemes.DIGEST); + private static final List DEFAULT_PREFERRED_AUTH_SCHEMES = Arrays.asList(AuthSchemes.BASIC, AuthSchemes.DIGEST, AuthSchemes.NTLM); + public static final int DEFAULT_CONNECTION_TIMEOUT = HttpClientOptions.RETRIEVE_DEFAULT_CONNECTION_TIMEOUT; + public static final int DEFAULT_READ_TIMEOUT = HttpClientOptions.RETRIEVE_DEFAULT_READ_TIMEOUT; + + public static final int DEFAULT_CONNECTION_REQUEST_TIMEOUT = HttpClientOptions.RETRIEVE_DEFAULT_CONNECTION_TIMEOUT; + + public static final String NTLM_PROXY_HANDLER_ATTR = INTLMProxyHandler.class.getName(); + + private static final Registry DEFAULT_AUTH_SCHEME_REGISTRY = RegistryBuilder. create().register(AuthSchemes.BASIC, new BasicSchemeFactory()).register(AuthSchemes.DIGEST, new DigestSchemeFactory()).register(AuthSchemes.NTLM, new NTLMSchemeFactory()).build(); + + private static final SocketConfig DEFAULT_SOCKET_CONFIG = SocketConfig.copy(SocketConfig.DEFAULT).setSoTimeout(DEFAULT_READ_TIMEOUT).setTcpNoDelay(true)// Disable Nagle - see + // https://en.wikipedia.org/wiki/Nagle%27s_algorithm#Negative_effect_on_larger_writes + // TODO is it safe to set this to 0? This will forcefully terminate sockets on + // close instead of waiting for graceful close + // See + // http://docs.oracle.com/javase/6/docs/api/java/net/SocketOptions.html?is-external=true#SO_LINGER + // and https://issues.apache.org/jira/browse/HTTPCLIENT-1497 + // .setSoLinger(0) + .build(); + + private ReferenceQueue collectedClients; + private List> trackedClients; + + @Override + public HttpClientBuilder newClient() { + HttpClientBuilder builder = createHttpClientBuilder(); + configureSSLSocketFactory(builder); + builder.setDefaultCredentialsProvider(new HttpClientProxyCredentialProvider()); + builder.setDefaultRequestConfig(newRequestConfig(null, System.getProperties()).build()); + builder.setMaxConnPerRoute(100); + builder.setMaxConnTotal(300); + builder.setDefaultSocketConfig(DEFAULT_SOCKET_CONFIG); + builder.setDefaultAuthSchemeRegistry(DEFAULT_AUTH_SCHEME_REGISTRY); + builder = Activator.getDefault().runModifiers(builder, new ModifierRunner() { + + @Override + public HttpClientBuilder run(IHttpClientModifier modifier, HttpClientBuilder value) { + return modifier.modifyClient(value); + } + + }); + + return builder; + } + + protected HttpClientBuilder createHttpClientBuilder() { + return new HttpClientBuilder() { + @Override + public CloseableHttpClient build() { + CloseableHttpClient client = super.build(); + track(client); + return client; + } + }; + } + + @Override + public HttpClientContext newClientContext() { + HttpClientContext context = HttpClientContext.create(); + INTLMProxyHandler ntlmProxyHandler = Activator.getDefault().getNTLMProxyHandler(); + context.setAttribute(NTLM_PROXY_HANDLER_ATTR, ntlmProxyHandler); + context.setAuthSchemeRegistry(DEFAULT_AUTH_SCHEME_REGISTRY); + + context = Activator.getDefault().runModifiers(context, new ModifierRunner() { + + @Override + public HttpClientContext run(IHttpClientModifier modifier, HttpClientContext value) { + return modifier.modifyContext(value); + } + + }); + + return context; + } + + @Override + public RequestConfig.Builder newRequestConfig(final HttpClientContext context, final Map localOptions) { + Builder builder = RequestConfig.custom(); + int connectionRequestTimeout = DEFAULT_CONNECTION_REQUEST_TIMEOUT; + int connectionTimeout = DEFAULT_CONNECTION_TIMEOUT; + int readTimeout = DEFAULT_READ_TIMEOUT; + if (localOptions != null) { + connectionRequestTimeout = getIntOption(HttpClientOptions.RETRIEVE_CONNECTION_TIMEOUT_PROP, localOptions, connectionRequestTimeout); + connectionTimeout = getIntOption(HttpClientOptions.RETRIEVE_CONNECTION_TIMEOUT_PROP, localOptions, connectionTimeout); + readTimeout = getIntOption(HttpClientOptions.RETRIEVE_READ_TIMEOUT_PROP, localOptions, readTimeout); + } + builder.setConnectionRequestTimeout(connectionRequestTimeout).setConnectTimeout(connectionTimeout).setSocketTimeout(readTimeout); + + boolean allowNTLMAuthentication = getNTLMProxyHandler(context).allowNTLMAuthentication(localOptions); + Collection preferredAuthSchemes = allowNTLMAuthentication ? DEFAULT_PREFERRED_AUTH_SCHEMES : DEFAULT_PREFERRED_AUTH_SCHEMES_NO_NTLM; + builder.setProxyPreferredAuthSchemes(preferredAuthSchemes); + builder.setTargetPreferredAuthSchemes(preferredAuthSchemes); + + builder = Activator.getDefault().runModifiers(builder, new ModifierRunner() { + + @Override + public RequestConfig.Builder run(IHttpClientModifier modifier, RequestConfig.Builder value) { + return modifier.modifyRequestConfig(value, context, localOptions); + } + + }); + return builder; + } + + private int getIntOption(String key, final Map localOptions, int defaultValue) { + Object option = localOptions.get(key); + if (option != null) { + int value = defaultValue; + if (option instanceof Number) { + value = ((Number) option).intValue(); + } else if (option instanceof String) { + try { + value = Integer.parseInt((String) option); + } catch (NumberFormatException e) { + Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, HttpClientRetrieveFileTransfer.class, "getDnsHostName", e); //$NON-NLS-1$ + } + } + return value; + } + return defaultValue; + } + + private static void configureSSLSocketFactory(HttpClientBuilder builder) { + SSLSocketFactory sslSocketFactory = Activator.getDefault().getSSLSocketFactory(); + if (sslSocketFactory == null) { + try { + sslSocketFactory = new HttpClientDefaultSSLSocketFactoryModifier().getSSLSocketFactory(); + } catch (IOException e) { + Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, HttpClientDefaultSSLSocketFactoryModifier.class, "getSSLSocketFactory()", e); //$NON-NLS-1$ + throw new ECFRuntimeException("Unable to instantiate schemes for HttpClient.", e); //$NON-NLS-1$ + } + } + if (sslSocketFactory == SSLSocketFactory.getDefault()) { + sslSocketFactory = null; + } + if (sslSocketFactory != null) { + PublicSuffixMatcher publicSuffixMatcherCopy = PublicSuffixMatcherLoader.getDefault(); + String systemHttpsProtocols = System.getProperty("https.protocols"); + String systemCipherSuites = System.getProperty("https.cipherSuites"); + String[] supportedProtocols = split(systemHttpsProtocols); + String[] supportedCipherSuites = split(systemCipherSuites); + HostnameVerifier hostnameVerifierCopy = new DefaultHostnameVerifier(publicSuffixMatcherCopy); + SSLConnectionSocketFactory sslConnectionSocketFactory = new SSLConnectionSocketFactory(sslSocketFactory, supportedProtocols, supportedCipherSuites, hostnameVerifierCopy); + builder.setSSLSocketFactory(sslConnectionSocketFactory); + } + } + + private synchronized void track(CloseableHttpClient client) { + clearCollectedClients(); + if (collectedClients == null) { + collectedClients = new ReferenceQueue(); + trackedClients = new LinkedList>(); + } + trackedClients.add(new WeakReference(client, collectedClients)); + } + + private synchronized void clearCollectedClients() { + if (collectedClients == null) { + return; + } + for (Reference collectedReference = collectedClients.poll(); collectedReference != null; collectedReference = collectedClients.poll()) { + trackedClients.remove(collectedReference); + } + } + + public synchronized void close() { + if (trackedClients != null) { + for (WeakReference clientRef : trackedClients) { + CloseableHttpClient client = clientRef.get(); + if (client == null) { + continue; + } + try { + client.close(); + } catch (IOException ex) { + Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, ECFHttpClientFactory.class, "close", ex); //$NON-NLS-1$ + } + } + trackedClients = null; + collectedClients = null; + } + } + + @Deactivate + public void deactivate() { + close(); + } + + private static String[] split(final String s) { + if (TextUtils.isBlank(s)) { + return null; + } + return s.split(" *, *"); + } + + public static CredentialsProvider modifyCredentialsProvider(CredentialsProvider credentialsProvider) { + return Activator.getDefault().runModifiers(credentialsProvider, new ModifierRunner() { + + @Override + public CredentialsProvider run(IHttpClientModifier modifier, CredentialsProvider value) { + return modifier.modifyCredentialsProvider(value); + } + + }); + } + + public static INTLMProxyHandler getNTLMProxyHandler(HttpContext httpContext) { + Object value = httpContext == null ? null : httpContext.getAttribute(ECFHttpClientFactory.NTLM_PROXY_HANDLER_ATTR); + if (value instanceof INTLMProxyHandler) { + return (INTLMProxyHandler) value; + } + INTLMProxyHandler handler = Activator.getDefault().getNTLMProxyHandler(); + if (handler != null && httpContext != null && value == null) { + httpContext.setAttribute(ECFHttpClientFactory.NTLM_PROXY_HANDLER_ATTR, handler); + } + return handler; + } + + protected static interface ModifierRunner { + T run(IHttpClientModifier modifier, T value); + } +} diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/HttpClientDefaultSSLSocketFactoryModifier.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/HttpClientDefaultSSLSocketFactoryModifier.java new file mode 100644 index 000000000..8d3fa7b34 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/HttpClientDefaultSSLSocketFactoryModifier.java @@ -0,0 +1,78 @@ +/**************************************************************************** + * Copyright (c) 2019 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 + * Yatta Solutions - HttpClient 4.5 implementation + *****************************************************************************/ + +package org.eclipse.ecf.internal.provider.filetransfer.httpclient45; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.TrustManager; + +public class HttpClientDefaultSSLSocketFactoryModifier { + public static final String DEFAULT_SSL_PROTOCOL = "https.protocols"; //$NON-NLS-1$ + + private SSLContext sslContext = null; + + private String defaultProtocolNames = System.getProperty(DEFAULT_SSL_PROTOCOL); + + private static final String[] jreProtocols = new String[] {"TLSv1.2", "TLSv1.1", "TLSv1", "SSLv3"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + + public HttpClientDefaultSSLSocketFactoryModifier() { + // empty + } + + public synchronized 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 synchronized SSLContext getSSLContext(String protocols) { + SSLContext resultContext = null; + if (protocols != null) { + + String[] httpsProtocols = protocols.split(","); //$NON-NLS-1$ + // trim to make sure + for (int i = 0; i < httpsProtocols.length; i++) + httpsProtocols[i] = httpsProtocols[i].trim(); + // Now put into defaultProtocolsList in order of jreProtocols + List splitProtocolsList = Arrays.asList(httpsProtocols); + List defaultProtocolsList = new ArrayList(); + for (int i = 0; i < jreProtocols.length; i++) + if (splitProtocolsList.contains(jreProtocols[i])) + defaultProtocolsList.add(jreProtocols[i]); + // In order of jre protocols, attempt to create and init SSLContext + for (String protocol : defaultProtocolsList) { + try { + resultContext = SSLContext.getInstance(protocol); + resultContext.init(null, new TrustManager[] {new HttpClientSslTrustManager()}, null); + break; + } catch (Exception e) { + // just continue to look for SSLContexts with the next + // protocolName + } + } + } + return resultContext; + } +} diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/HttpClientModifierAdapter.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/HttpClientModifierAdapter.java new file mode 100644 index 000000000..6dd1f818c --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/HttpClientModifierAdapter.java @@ -0,0 +1,40 @@ +/******************************************************************************* +* Copyright (c) 2019 Yatta Solutions 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: +* Yatta Solutions - initial API and implementation +******************************************************************************/ +package org.eclipse.ecf.internal.provider.filetransfer.httpclient45; + +import java.util.Map; +import org.apache.http.client.CredentialsProvider; +import org.apache.http.client.config.RequestConfig.Builder; +import org.apache.http.client.protocol.HttpClientContext; +import org.apache.http.impl.client.HttpClientBuilder; + +public class HttpClientModifierAdapter implements IHttpClientModifier { + + @Override + public HttpClientBuilder modifyClient(HttpClientBuilder builder) { + return builder; + } + + @Override + public CredentialsProvider modifyCredentialsProvider(CredentialsProvider credentialsProvider) { + return credentialsProvider; + } + + @Override + public HttpClientContext modifyContext(HttpClientContext context) { + return context; + } + + @Override + public Builder modifyRequestConfig(Builder config, HttpClientContext context, Map options) { + return config; + } + +} diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/HttpClientProxyCredentialProvider.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/HttpClientProxyCredentialProvider.java new file mode 100644 index 000000000..41ee02662 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/HttpClientProxyCredentialProvider.java @@ -0,0 +1,308 @@ +/******************************************************************************* + * Copyright (c) 2019 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 + * Yatta Solutions - HttpClient 4.5 implementation + *******************************************************************************/ +package org.eclipse.ecf.internal.provider.filetransfer.httpclient45; + +import java.net.InetAddress; +import java.net.UnknownHostException; +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.impl.client.BasicCredentialsProvider; +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.internal.provider.filetransfer.DebugOptions; +import org.eclipse.ecf.provider.filetransfer.httpclient45.HttpClientRetrieveFileTransfer; +import org.osgi.framework.FrameworkUtil; + +public class HttpClientProxyCredentialProvider extends BasicCredentialsProvider { + private static final String COMPUTERNAME_ENV = "COMPUTERNAME"; //$NON-NLS-1$ + private static final String HOSTNAME_ENV = "HOSTNAME"; //$NON-NLS-1$ + private static final String LOGONSERVER_ENV = "LOGONSERVER"; //$NON-NLS-1$ + private static final String USER_DOMAIN_ENV = "USERDOMAIN"; //$NON-NLS-1$ + private static final String USER_DNS_DOMAIN_ENV = "USERDNSDOMAIN"; //$NON-NLS-1$ + + private static final char BACKSLASH = '\\'; + private static final char SLASH = '/'; + + private static final String OSGI_OS = "osgi.os"; //$NON-NLS-1$ + private static final String OSGI_OS_WIN32 = "win32"; //$NON-NLS-1$ + + private static final String NTLM_DOMAIN_PROPERTY = "http.auth.ntlm.domain"; //$NON-NLS-1$ + + protected Proxy getECFProxy() { + return null; + } + + protected boolean allowNTLMAuthentication() { + DefaultNTLMProxyHandler.setSeenNTLM(); + return Activator.getDefault().getNTLMProxyHandler().allowNTLMAuthentication(null); + } + + protected Credentials getNTLMCredentials(Credentials credentials) { + DefaultNTLMProxyHandler.setSeenNTLM(); + Credentials fixed = fixNTCredentials(credentials); + if (fixed == credentials || allowNTLMAuthentication()) { + return fixed; + } + return null; + } + + protected NTCredentials getNTLMCredentials(Proxy proxy) { + if (allowNTLMAuthentication()) { + return createNTLMCredentials(proxy); + } + return null; + } + + @Override + public Credentials getCredentials(AuthScope authscope) { + Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, HttpClientProxyCredentialProvider.class, "getCredentials " + authscope); //$NON-NLS-1$ + + // First check to see whether given authscope matches any authscope + // already cached. + Credentials result = super.getCredentials(authscope); + // If we have a match, return credentials + if (result != null) { + if ("ntlm".equalsIgnoreCase(authscope.getScheme())) { //$NON-NLS-1$ + // We might have gotten these from a password prompt, making them + // UsernamePasswordCredentials... + Credentials fixed = fixNTCredentials(result); + if (fixed != result) { + result = fixed; + setCredentials(authscope, fixed); + } + } + return result; + } + + // If we don't have a match, first get ECF proxy, if any + Proxy proxy = getECFProxy(); + if (proxy == null) + return null; + + // Make sure that authscope and proxy host and port match + if (!matchAuthScopeAndProxy(authscope, proxy)) + return null; + + // Then match scheme, and get credentials from proxy (if it's scheme we know about) + 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 credentials present for proxy then we're done + 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$ + } + + // Put found credentials in cache for next time + if (credentials != null) + setCredentials(authscope, credentials); + + return credentials; + } + + private static boolean matchAuthScopeAndProxy(AuthScope authscope, Proxy proxy) { + ProxyAddress proxyAddress = proxy.getAddress(); + return (authscope.getHost().equals(proxyAddress.getHostName()) && (authscope.getPort() == proxyAddress.getPort())); + } + + /** + * @param p + * proxy to create NTCredentials for + * @return NTCredentials new ntlm credentials given proxy + * @since 5.0 + */ + public static NTCredentials createNTLMCredentials(Proxy p) { + if (p == null) { + return null; + } + return createNTLMCredentials(p.getUsername(), p.getPassword()); + } + + /** + * @param p + * proxy to create NTCredentials for + * @return NTCredentials new ntlm credentials given proxy + * @since 5.0 + */ + protected static NTCredentials createNTLMCredentials(String username, String password) { + String un = getNTLMUserName(username); + String domain = getNTLMDomainName(username); + if (un == null || domain == null || un.isEmpty() || domain.isEmpty()) { + return null; + } + + String workstation = getNTLMWorkstation(); + + return new NTCredentials(un, password, workstation, domain); + } + + public static Credentials fixNTCredentials(Credentials credentials) { + if (credentials == null) { + return null; + } + if (credentials instanceof NTCredentials) { + NTCredentials ntCreds = (NTCredentials) credentials; + String userName = ntCreds.getUserName(); + String domainUser = getNTLMUserName(userName); + if (ntCreds.getDomain() == null || domainUser != userName) { + String domain = getNTLMDomainName(userName); + String workstation = getNTLMWorkstation(); + return new NTCredentials(domainUser, ntCreds.getPassword(), workstation, domain); + } + } else if (credentials instanceof UsernamePasswordCredentials) { + UsernamePasswordCredentials basicCredentials = (UsernamePasswordCredentials) credentials; + return createNTLMCredentials(basicCredentials.getUserName(), basicCredentials.getPassword()); + } + return credentials; + } + + public static String getNTLMWorkstation() { + String dnsName = getDnsHostName(); + if (dnsName != null) { + return dnsName; + } + String hostName = getEnvHostName(); + if (hostName != null) { + return hostName; + } + return null; + } + + private static boolean isWindows() { + String os = FrameworkUtil.getBundle(HttpClientProxyCredentialProvider.class).getBundleContext().getProperty(OSGI_OS); + return OSGI_OS_WIN32.equalsIgnoreCase(os); + } + + private static String getEnvHostName() { + boolean isWindows = isWindows(); + String envKey = isWindows ? COMPUTERNAME_ENV : HOSTNAME_ENV; + String hostName = System.getenv(envKey); + if (hostName == null && isWindows) { + hostName = System.getenv(HOSTNAME_ENV); + } + return hostName; + } + + private static String getDnsHostName() { + try { + InetAddress localHost = InetAddress.getLocalHost(); + if (!localHost.isLoopbackAddress()) { + String hostName = localHost.getHostName(); + if (hostName != null && !"".equals(hostName) && !"localhost".equals(hostName) //$NON-NLS-1$ //$NON-NLS-2$ + && !hostName.equals(localHost.getHostAddress())) { + return hostName; + } + } + } catch (UnknownHostException e) { + Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, HttpClientRetrieveFileTransfer.class, "getDnsHostName", e); //$NON-NLS-1$ + } + return null; + } + + public static String getNTLMDomainName(String userName) { + String domain = getDomainFromUserName(userName); + if (domain != null) { + return domain; + } + domain = getDomainFromSystemProperties(); + if (domain != null) { + return domain; + } + return getDomainFromEnv(); + } + + private static String getDomainFromEnv() { + // FIXME some systems seem to need the DNS domain name instead of the NetBIOS + // name (from USERDNSDOMAIN env variable) + String domain = System.getenv(USER_DOMAIN_ENV); + if (domain != null) { + if (isRealDomain(domain)) { + return domain; + } + return null; + } + domain = System.getenv(USER_DNS_DOMAIN_ENV); + if (domain != null) { + return domain; + } + return null; + } + + private static String getDomainFromSystemProperties() { + String domain; + domain = System.getProperty(NTLM_DOMAIN_PROPERTY); + return domain; + } + + private static boolean isRealDomain(String domain) { + String hostName = getEnvHostName(); + if (!domain.equalsIgnoreCase(hostName)) { + return true; + } + if (isWindows()) { + String logonHost = System.getenv(LOGONSERVER_ENV); + if (logonHost != null && !logonHost.equalsIgnoreCase(Character.toString(BACKSLASH) + BACKSLASH + domain)) { + return true; + } + } + return false; + } + + private static String getDomainFromUserName(String userName) { + if (userName == null) { + return null; + } + int pos = getNTLMDomainUserSeparatorPos(userName); + if (pos != -1) { + return userName.substring(0, pos); + } + return null; + } + + private static int getNTLMDomainUserSeparatorPos(String userName) { + int pos = userName.indexOf(BACKSLASH); + if (pos == -1) { + pos = userName.indexOf(SLASH); + } + return pos; + } + + public static String getNTLMUserName(String userName) { + if (userName == null) { + return null; + } + int pos = getNTLMDomainUserSeparatorPos(userName); + if (pos == -1) { + return userName; + } + if (userName.length() > pos + 1 && (userName.charAt(pos + 1) == SLASH || userName.charAt(pos + 1) == BACKSLASH)) { + pos++; + } + if (userName.length() >= pos + 1) { + return userName.substring(pos + 1); + } + return userName; + } + +} diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/HttpClientSslTrustManager.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/HttpClientSslTrustManager.java new file mode 100644 index 000000000..58244fcee --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/HttpClientSslTrustManager.java @@ -0,0 +1,56 @@ +/**************************************************************************** + * Copyright (c) 2019 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 + * Yatta Solutions - HttpClient 4.5 implementation + *****************************************************************************/ + +package org.eclipse.ecf.internal.provider.filetransfer.httpclient45; + +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.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/IHttpClientFactory.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/IHttpClientFactory.java new file mode 100644 index 000000000..b71c5a32e --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/IHttpClientFactory.java @@ -0,0 +1,25 @@ +/******************************************************************************* +* Copyright (c) 2019 Yatta Solutions 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: +* Yatta Solutions - initial API and implementation +******************************************************************************/ +package org.eclipse.ecf.internal.provider.filetransfer.httpclient45; + +import java.util.Map; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.protocol.HttpClientContext; +import org.apache.http.impl.client.HttpClientBuilder; + +public interface IHttpClientFactory { + + HttpClientBuilder newClient(); + + HttpClientContext newClientContext(); + + RequestConfig.Builder newRequestConfig(HttpClientContext context, Map localOptions); + +} \ No newline at end of file diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/IHttpClientModifier.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/IHttpClientModifier.java new file mode 100644 index 000000000..76b0fa6db --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/IHttpClientModifier.java @@ -0,0 +1,26 @@ +/******************************************************************************* +* Copyright (c) 2019 Yatta Solutions 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: +* Yatta Solutions - initial API and implementation +******************************************************************************/ +package org.eclipse.ecf.internal.provider.filetransfer.httpclient45; + +import java.util.Map; +import org.apache.http.client.CredentialsProvider; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.protocol.HttpClientContext; +import org.apache.http.impl.client.HttpClientBuilder; + +public interface IHttpClientModifier { + HttpClientBuilder modifyClient(HttpClientBuilder builder); + + CredentialsProvider modifyCredentialsProvider(CredentialsProvider credentialsProvider); + + HttpClientContext modifyContext(HttpClientContext context); + + RequestConfig.Builder modifyRequestConfig(RequestConfig.Builder config, HttpClientContext context, Map options); +} diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/INTLMProxyHandler.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/INTLMProxyHandler.java new file mode 100644 index 000000000..02680f7f8 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/INTLMProxyHandler.java @@ -0,0 +1,22 @@ +/******************************************************************************* +* Copyright (c) 2019 Yatta Solutions 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: +* Yatta Solutions - initial API and implementation +******************************************************************************/ +package org.eclipse.ecf.internal.provider.filetransfer.httpclient45; + +import java.util.Map; +import org.eclipse.ecf.core.util.ECFException; +import org.eclipse.ecf.core.util.Proxy; + +public interface INTLMProxyHandler { + void handleNTLMProxy(Proxy proxy, int code) throws ECFException; + + void handleSPNEGOProxy(Proxy proxy, int code) throws ECFException; + + boolean allowNTLMAuthentication(Map connectOptions); +} diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/Messages.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/Messages.java new file mode 100644 index 000000000..358bfdda5 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/Messages.java @@ -0,0 +1,47 @@ +/**************************************************************************** + * Copyright (c) 2019 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 + * Yatta Solutions - HttpClient 4.5 implementation + *****************************************************************************/ + +package org.eclipse.ecf.internal.provider.filetransfer.httpclient45; + +import org.eclipse.osgi.util.NLS; + +/** + * + */ +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.ecf.internal.provider.filetransfer.httpclient45.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.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/NTLMProxyDetector.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/NTLMProxyDetector.java new file mode 100644 index 000000000..918ac3583 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/NTLMProxyDetector.java @@ -0,0 +1,64 @@ +/******************************************************************************* +* Copyright (c) 2019 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 +* Yatta Solutions - HttpClient 4.5 implementation +******************************************************************************/ +package org.eclipse.ecf.internal.provider.filetransfer.httpclient45; + +import org.apache.http.auth.AuthScheme; +import org.apache.http.auth.AuthState; +import org.apache.http.client.protocol.HttpClientContext; +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 HttpContext provided to one of the HttpClient#execute() + * methods. + * + * @param context the HttpContext given to the 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(HttpClientContext.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 HttpContext provided to one of the HttpClient#execute() + * methods. + * + * @param context the HttpContext given to the 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); + } +} diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/messages.properties b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/messages.properties new file mode 100644 index 000000000..b94674d30 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient45/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=HttpComponents 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.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientBrowseFileTransferFactory.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientBrowseFileTransferFactory.java new file mode 100644 index 000000000..d57fe3157 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientBrowseFileTransferFactory.java @@ -0,0 +1,79 @@ +/**************************************************************************** + * Copyright (c) 2019 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 + * Yatta Solutions - HttpClient 4.5 implementation + *****************************************************************************/ +package org.eclipse.ecf.provider.filetransfer.httpclient45; + +import java.net.MalformedURLException; +import java.net.URL; +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.internal.provider.filetransfer.httpclient45.Activator; +import org.eclipse.ecf.provider.filetransfer.identity.FileTransferNamespace; +import org.eclipse.osgi.util.NLS; + +public class HttpClientBrowseFileTransferFactory implements IRemoteFileSystemBrowserFactory { + + @Override + public IRemoteFileSystemBrowser newInstance() { + return new IRemoteFileSystemBrowser() { + + private Proxy proxy; + private IConnectContext connectContext; + + @Override + public Namespace getBrowseNamespace() { + return IDFactory.getDefault().getNamespaceByName(FileTransferNamespace.PROTOCOL); + } + + @Override + 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(Activator.getDefault().getBrowseHttpClient(), directoryOrFileId, listener, url, connectContext, proxy); + return browser.sendBrowseRequest(); + } + + @Override + public void setConnectContextForAuthentication(IConnectContext connectContext) { + this.connectContext = connectContext; + } + + @Override + public void setProxy(Proxy proxy) { + this.proxy = proxy; + } + + @Override + public T getAdapter(Class adapter) { + return null; + } + + }; + + } +} diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientFileSystemBrowser.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientFileSystemBrowser.java new file mode 100644 index 000000000..c25757ce7 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientFileSystemBrowser.java @@ -0,0 +1,376 @@ +/**************************************************************************** + * Copyright (c) 2019 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 + * Yatta Solutions - HttpClient 4.5 implementation + *****************************************************************************/ + +package org.eclipse.ecf.provider.filetransfer.httpclient45; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URL; +import org.apache.http.Header; +import org.apache.http.HttpHeaders; +import org.apache.http.HttpHost; +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.apache.http.client.HttpClient; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpHead; +import org.apache.http.client.protocol.HttpClientContext; +import org.apache.http.client.utils.DateUtils; +import org.apache.http.impl.client.CloseableHttpClient; +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.DebugOptions; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.Activator; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.DefaultNTLMProxyHandler; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.ECFHttpClientFactory; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.HttpClientProxyCredentialProvider; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.IHttpClientFactory; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.INTLMProxyHandler; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.Messages; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.NTLMProxyDetector; +import org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser; +import org.eclipse.ecf.provider.filetransfer.browse.URLRemoteFile; +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$ + + 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; + + protected String username = null; + + protected String password = null; + + protected CloseableHttpClient httpClient = null; + + private RequestConfig.Builder requestConfigBuilder; + + private HttpClientProxyCredentialProvider credentialsProvider; + + protected volatile HttpHead headMethod; + + /** + * This is the response returned by {@link HttpClient} when it executes + * {@link #headMethod}. + * @since 5.0 + */ + protected volatile CloseableHttpResponse 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 HttpClientContext httpContext; + + /** + * @param httpClient http client + * @param directoryOrFileID directory or file id + * @param listener listener + * @param directoryOrFileURL directory or file id + * @param connectContext connect context + * @param proxy proxy + * @since 5.0 + */ + public HttpClientFileSystemBrowser(CloseableHttpClient httpClient, IFileID directoryOrFileID, IRemoteFileSystemListener listener, URL directoryOrFileURL, IConnectContext connectContext, Proxy proxy) { + super(directoryOrFileID, listener, directoryOrFileURL, connectContext, proxy); + Assert.isNotNull(httpClient); + this.httpClient = httpClient; + + credentialsProvider = new HttpClientProxyCredentialProvider() { + + @Override + protected Proxy getECFProxy() { + return getProxy(); + } + + @Override + protected boolean allowNTLMAuthentication() { + DefaultNTLMProxyHandler.setSeenNTLM(); + return ECFHttpClientFactory.getNTLMProxyHandler(httpContext).allowNTLMAuthentication(null); + } + + }; + IHttpClientFactory httpClientFactory = Activator.getDefault().getHttpClientFactory(); + CredentialsProvider contextCredentialsProvider = ECFHttpClientFactory.modifyCredentialsProvider(credentialsProvider); + httpContext = httpClientFactory.newClientContext(); + httpContext.setCredentialsProvider(contextCredentialsProvider); + this.proxyHelper = new JREProxyHelper(); + + } + + class HttpClientRemoteFileSystemRequest extends RemoteFileSystemRequest { + HttpClientRemoteFileSystemRequest() { + } + + @Override + public T getAdapter(Class adapter) { + if (adapter == null) { + return null; + } + if (adapter.isInstance(this)) { + return adapter.cast(this); + } + return null; + } + + @Override + public void cancel() { + HttpClientFileSystemBrowser.this.cancel(); + } + } + + @Override + protected IRemoteFileSystemRequest createRemoteFileSystemRequest() { + return new HttpClientRemoteFileSystemRequest(); + } + + @Override + protected void cancel() { + if (isCanceled()) { + return; // break job cancel recursion + } + setCanceled(getException()); + super.cancel(); + if (headMethod != null) { + if (!headMethod.isAborted()) { + headMethod.abort(); + } + } + } + + @Override + 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); + } + + @Override + protected void cleanUp() { + clearProxy(); + headMethod = null; + requestConfigBuilder = null; + + super.cleanUp(); + } + + /* (non-Javadoc) + * @see org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser#runRequest() + */ + @Override + protected void runRequest() throws Exception { + Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, this.getClass(), "runRequest"); //$NON-NLS-1$ + + String urlString = directoryOrFile.toString(); + + requestConfigBuilder = Activator.getDefault().getHttpClientFactory().newRequestConfig(httpContext, null); + requestConfigBuilder.setSocketTimeout(DEFAULT_CONNECTION_TIMEOUT).setConnectTimeout(DEFAULT_CONNECTION_TIMEOUT); + + setupProxies(); + + // setup authentication + setupAuthentication(urlString); + + headMethod = new HttpHead(urlString); + headMethod.setConfig(requestConfigBuilder.build()); + + int maxAge = Integer.getInteger("org.eclipse.ecf.http.cache.max-age", 0).intValue(); //$NON-NLS-1$ + // set max-age for cache control to 0 for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=249990 + // fix the fix for bug 249990 with bug 410813 + if (maxAge == 0) { + headMethod.addHeader(HttpHeaders.CACHE_CONTROL, "max-age=0"); //$NON-NLS-1$ + } else if (maxAge > 0) { + headMethod.addHeader(HttpHeaders.CACHE_CONTROL, "max-age=" + maxAge); //$NON-NLS-1$ + } + + long lastModified = 0; + long fileLength = -1; + + int code = -1; + try { + Trace.trace(Activator.PLUGIN_ID, "browse=" + urlString); //$NON-NLS-1$ + + 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) + getNTLMProxyHandler(httpContext).handleNTLMProxy(getProxy(), code); + + if (NTLMProxyDetector.detectSPNEGOProxy(httpContext)) + getNTLMProxyHandler(httpContext).handleSPNEGOProxy(getProxy(), code); + + 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; + } finally { + if (httpResponse != null) { + httpResponse.close(); + } + } + } + + private INTLMProxyHandler getNTLMProxyHandler(HttpContext httpContext) { + Object value = httpContext.getAttribute(ECFHttpClientFactory.NTLM_PROXY_HANDLER_ATTR); + if (value instanceof INTLMProxyHandler) { + return (INTLMProxyHandler) value; + } + return Activator.getDefault().getNTLMProxyHandler(); + } + + private long getLastModifiedTimeFromHeader() throws IOException { + Header lastModifiedHeader = httpResponse.getLastHeader(HttpHeaders.LAST_MODIFIED); + 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$ + credentialsProvider.setCredentials(authScope, credentials); + } + } + + @Override + protected void setupProxy(Proxy proxy) { + if (proxy.getType().equals(Proxy.Type.HTTP)) { + final ProxyAddress address = proxy.getAddress(); + requestConfigBuilder.setProxy(new HttpHost(address.getHostName(), address.getPort())); + } else if (proxy.getType().equals(Proxy.Type.SOCKS)) { + Trace.trace(Activator.PLUGIN_ID, "browse socksproxy=" + proxy.getAddress()); //$NON-NLS-1$ + requestConfigBuilder.setProxy(null); + 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() { + if (requestConfigBuilder != null) { + requestConfigBuilder.setProxy(null); + } + } + +} diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientOptions.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientOptions.java new file mode 100644 index 000000000..89f5aadc8 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientOptions.java @@ -0,0 +1,30 @@ +/******************************************************************************* +* Copyright (c) 2019 Yatta Solutions 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: +* Yatta Solutions - initial API and implementation +******************************************************************************/ +package org.eclipse.ecf.provider.filetransfer.httpclient45; + +/** + * @see org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientOptions + */ +public interface HttpClientOptions { + // Use configuration properties backward compatible to Httpclient4 provider + String BROWSE_CONNECTION_TIMEOUT_PROP = "org.eclipse.ecf.provider.filetransfer.httpclient4.browse.connectTimeout"; //$NON-NLS-1$ + String RETRIEVE_READ_TIMEOUT_PROP = "org.eclipse.ecf.provider.filetransfer.httpclient4.retrieve.readTimeout"; //$NON-NLS-1$ + String RETRIEVE_CONNECTION_TIMEOUT_PROP = "org.eclipse.ecf.provider.filetransfer.httpclient4.retrieve.connectTimeout"; //$NON-NLS-1$ + + int RETRIEVE_DEFAULT_CONNECTION_TIMEOUT = Integer + .parseInt(System.getProperty(RETRIEVE_CONNECTION_TIMEOUT_PROP, "120000")); //$NON-NLS-1$ + int RETRIEVE_DEFAULT_READ_TIMEOUT = Integer.parseInt(System.getProperty(RETRIEVE_READ_TIMEOUT_PROP, "120000")); //$NON-NLS-1$ + int BROWSE_DEFAULT_CONNECTION_TIMEOUT = Integer + .parseInt(System.getProperty(BROWSE_CONNECTION_TIMEOUT_PROP, "120000")); //$NON-NLS-1$ + + int NTLM_PROXY_RESPONSE_CODE = 477; + String FORCE_NTLM_PROP = "org.eclipse.ecf.provider.filetransfer.httpclient4.options.ForceNTLMProxy"; //$NON-NLS-1$ + +} diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientRetrieveFileTransfer.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientRetrieveFileTransfer.java new file mode 100644 index 000000000..ff38bbcc8 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientRetrieveFileTransfer.java @@ -0,0 +1,1044 @@ +/******************************************************************************* + * Copyright (c) 2019 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 + * Yatta Solutions - HttpClient 4.5 implementation + ******************************************************************************/ +package org.eclipse.ecf.provider.filetransfer.httpclient45; + +import java.io.FilterInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import org.apache.http.Header; +import org.apache.http.HttpHeaders; +import org.apache.http.HttpHost; +import org.apache.http.HttpStatus; +import org.apache.http.ProtocolVersion; +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.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.protocol.HttpClientContext; +import org.apache.http.client.utils.DateUtils; +import org.apache.http.impl.client.CloseableHttpClient; +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.Proxy; +import org.eclipse.ecf.core.util.ProxyAddress; +import org.eclipse.ecf.core.util.Trace; +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.identity.IFileID; +import org.eclipse.ecf.internal.provider.filetransfer.DebugOptions; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.Activator; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.ECFHttpClientFactory; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.HttpClientProxyCredentialProvider; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.IHttpClientFactory; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.Messages; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.NTLMProxyDetector; +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; + + 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 = "https"; //$NON-NLS-1$ + + protected static final String HTTP = "http"; //$NON-NLS-1$ + + protected static final String[] supportedProtocols = {HTTP, HTTPS}; + + private static final String LAST_MODIFIED_HEADER = "Last-Modified"; //$NON-NLS-1$ + + private HttpGet getMethod = null; + + private CloseableHttpResponse httpResponse = null; + + private CloseableHttpClient httpClient; + + private HttpClientContext httpContext; + + private RequestConfig.Builder requestConfigBuilder; + + 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; + + private ECFCredentialsProvider credentialsProvider; + + protected JREProxyHelper proxyHelper = null; + + private FileTransferJob connectJob; + + public HttpClientRetrieveFileTransfer(CloseableHttpClient client) { + Assert.isNotNull(client); + this.httpClient = client; + + IHttpClientFactory httpClientFactory = Activator.getDefault().getHttpClientFactory(); + credentialsProvider = new ECFCredentialsProvider(); + CredentialsProvider contextCredentialsProvider = ECFHttpClientFactory.modifyCredentialsProvider(credentialsProvider); + httpContext = httpClientFactory.newClientContext(); + httpContext.setCredentialsProvider(contextCredentialsProvider); + proxyHelper = new JREProxyHelper(); + } + + @Override + public String getRemoteFileName() { + return remoteFileName; + } + + @Override + 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 && !getMethod.isAborted()) { + Trace.trace(Activator.PLUGIN_ID, "calling getMethod.abort()"); //$NON-NLS-1$ + getMethod.abort(); + } + 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() + */ + @Override + protected void hardClose() { + // changed for addressing bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=389292 + if (getMethod != null) { + // First, if !isDone and paused + if (!isDone() && isPaused()) + getMethod.abort(); + // release in any case + // getMethod.releaseConnection(); + // and set to null + getMethod = null; + } + + if (httpResponse != null && !isDone() && isPaused()) { + try { + httpResponse.close(); + } catch (final IOException e) { + Activator.getDefault().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, "hardClose", e)); //$NON-NLS-1$ + } + httpResponse = null; + } + + // Close output stream...if we're supposed to + try { + if (localFileContents != null && closeOutputStream) + localFileContents.close(); + } catch (final IOException e) { + Activator.getDefault().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, "hardClose", e)); //$NON-NLS-1$ + } + // clear input and output streams + remoteFileContents = null; + localFileContents = null; + // reset response code + responseCode = -1; + // If we're done and proxy helper still exists, then dispose + if (proxyHelper != null && isDone()) { + proxyHelper.dispose(); + proxyHelper = null; + } + } + + /** + * @return Credentials file request credentials + * @throws UnsupportedCallbackException if some problem + * @throws IOException if some problem + * @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); + } + + @Override + 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); + } + + @Override + 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(); + getMethod = null; + requestConfigBuilder = null; + + super.resetDoneAndException(); + } + + private synchronized RequestConfig.Builder getRequestConfigBuilder() { + if (requestConfigBuilder == null) { + requestConfigBuilder = Activator.getDefault().getHttpClientFactory().newRequestConfig(httpContext, getOptions()); + } + return requestConfigBuilder; + } + + 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$ + credentialsProvider.setCredentials(authScope, credentials); + } + } + + protected void setRequestHeaderValues() throws InvalidFileRangeSpecificationException { + final IFileRangeSpecification rangeSpec = getFileRangeSpecification(); + setRangeHeader(rangeSpec, -1); + + int maxAge = Integer.getInteger("org.eclipse.ecf.http.cache.max-age", 0); //$NON-NLS-1$ + // set max-age for cache control to 0 for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=249990 + // fix the fix for bug 249990 with bug 410813 + if (maxAge == 0) { + getMethod.addHeader(HttpHeaders.CACHE_CONTROL, "max-age=0"); //$NON-NLS-1$ + } else if (maxAge > 0) { + getMethod.addHeader(HttpHeaders.CACHE_CONTROL, "max-age=" + maxAge); //$NON-NLS-1$ + } + setRequestHeaderValuesFromOptions(); + } + + private void setRangeHeader(final IFileRangeSpecification rangeSpec, final long resumePosition) throws InvalidFileRangeSpecificationException { + final long startPosition; + final long endPosition; + if (rangeSpec != null) { + startPosition = Math.max(resumePosition, rangeSpec.getStartPosition()); + 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); + } + } else if (resumePosition > 0) { + startPosition = resumePosition; + endPosition = -1L; + } else { + // No range header needed + return; + } + 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); + } + + 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.setHeader(HttpHeaders.RANGE, value); + } + + 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() + */ + @Override + 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 { + + @Override + protected Proxy getECFProxy() { + return getProxy(); + } + + @Override + protected boolean allowNTLMAuthentication() { + return ECFHttpClientFactory.getNTLMProxyHandler(httpContext).allowNTLMAuthentication(getOptions()); + } + + } + + Proxy getProxy() { + return proxy; + } + + @Override + protected void setInputStream(InputStream ins) { + remoteFileContents = ins; + } + + @Override + protected InputStream wrapTransferReadInputStream(InputStream inputStream, IProgressMonitor monitor) { + // Added to address bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=389292 + return new NoCloseWrapperInputStream(inputStream); + } + + // Added to address bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=389292 + class NoCloseWrapperInputStream extends FilterInputStream { + + protected NoCloseWrapperInputStream(InputStream in) { + super(in); + } + + @Override + public void close() { + // do nothing + } + } + + @Override + protected int getSocketReadTimeout() { + int result = ECFHttpClientFactory.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.httpclient4.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; + } + + /** + * @return int connect timeout + * @since 4.0 + */ + protected int getConnectTimeout() { + int result = ECFHttpClientFactory.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.httpclient4.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() + */ + @Override + 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 { + getMethod = new HttpGet(urlString); + RequestConfig.Builder rcfgBuilder = getRequestConfigBuilder(); + rcfgBuilder.setSocketTimeout(getSocketReadTimeout()).setConnectTimeout(getConnectTimeout()); + + setupAuthentication(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())) { + // The interceptors to provide gzip are always added and are enabled by default + Trace.trace(Activator.PLUGIN_ID, "Accept-Encoding: gzip,deflate added to request header"); //$NON-NLS-1$ + } else { + // Disable the interceptors to provide gzip + Trace.trace(Activator.PLUGIN_ID, "Accept-Encoding NOT added to header"); //$NON-NLS-1$ + rcfgBuilder.setContentCompressionEnabled(false); + } + getMethod.setConfig(rcfgBuilder.build()); + + fireConnectStartEvent(); + if (checkAndHandleDone()) { + return; + } + + // 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) + ECFHttpClientFactory.getNTLMProxyHandler(httpContext).handleNTLMProxy(getProxy(), code); + + if (NTLMProxyDetector.detectSPNEGOProxy(httpContext)) + ECFHttpClientFactory.getNTLMProxyHandler(httpContext).handleSPNEGOProxy(getProxy(), code); + + if (code == HttpStatus.SC_PARTIAL_CONTENT || code == HttpStatus.SC_OK) { + getResponseHeaderValues(); + setInputStream(httpResponse.getEntity().getContent()); + fireReceiveStartEvent(); + } else if (code == HttpStatus.SC_NOT_FOUND) { + EntityUtils.consume(httpResponse.getEntity()); + throw new IncomingFileTransferException(NLS.bind("File not found: {0}", urlString), code); //$NON-NLS-1$ + } else if (code == HttpStatus.SC_UNAUTHORIZED) { + EntityUtils.consume(httpResponse.getEntity()); + throw new IncomingFileTransferException(Messages.HttpClientRetrieveFileTransfer_Unauthorized, code); + } else if (code == HttpStatus.SC_FORBIDDEN) { + EntityUtils.consume(httpResponse.getEntity()); + throw new IncomingFileTransferException("Forbidden", code); //$NON-NLS-1$ + } else if (code == HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED) { + 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) + */ + @Override + 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 + + 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; + // Make sure the colonPort is not part of the credentials in URI + final int atServer = url.indexOf('@', colonSlashSlash + 1); + if (atServer != -1 && colonPort < atServer && atServer < nextSlash) + colonPort = url.indexOf(':', atServer + 1); + if (colonPort < 0) + 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-NLS-1$ + } + + /* + * (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() + */ + @Override + 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() + */ + @Override + protected boolean doResume() { + if (!isPaused() || isConnected()) + return false; + return openStreamsForResume(); + } + + protected void setResumeRequestHeaderValues() throws IOException, InvalidFileRangeSpecificationException { + if (this.bytesReceived <= 0 || this.fileLength <= this.bytesReceived) + throw new IOException(Messages.HttpClientRetrieveFileTransfer_RESUME_START_ERROR); + setRequestHeaderValues(); + final IFileRangeSpecification rangeSpec = getFileRangeSpecification(); + setRangeHeader(rangeSpec, bytesReceived); + + int maxAge = Integer.getInteger("org.eclipse.ecf.http.cache.max-age", 0); //$NON-NLS-1$ + // set max-age for cache control to 0 for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=249990 + // fix the fix for bug 249990 with bug 410813 + if (maxAge == 0) { + getMethod.addHeader(HttpHeaders.CACHE_CONTROL, "max-age=0"); //$NON-NLS-1$ + } else if (maxAge > 0) { + getMethod.addHeader(HttpHeaders.CACHE_CONTROL, "max-age=" + maxAge); //$NON-NLS-1$ + } + 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 { + getMethod = new HttpGet(urlString); + requestConfigBuilder.setContentCompressionEnabled(false); + + setupAuthentication(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$ + getMethod.setConfig(requestConfigBuilder.build()); + + // Gzip encoding is not an option for resume + fireConnectStartEvent(); + if (checkAndHandleDone()) { + return false; + } + + // 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 == HttpStatus.SC_PARTIAL_CONTENT || code == HttpStatus.SC_OK) { + getResumeResponseHeaderValues(); + setInputStream(httpResponse.getEntity().getContent()); + this.paused = false; + fireReceiveResumedEvent(); + } else if (code == HttpStatus.SC_NOT_FOUND) { + EntityUtils.consume(httpResponse.getEntity()); + throw new IncomingFileTransferException(NLS.bind("File not found: {0}", urlString), code, responseHeaders); //$NON-NLS-1$ + } else if (code == HttpStatus.SC_UNAUTHORIZED) { + EntityUtils.consume(httpResponse.getEntity()); + throw new IncomingFileTransferException(Messages.HttpClientRetrieveFileTransfer_Unauthorized, code, responseHeaders); + } else if (code == HttpStatus.SC_FORBIDDEN) { + EntityUtils.consume(httpResponse.getEntity()); + throw new IncomingFileTransferException("Forbidden", code, responseHeaders); //$NON-NLS-1$ + } else if (code == HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED) { + 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) + */ + @Override + public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) { + if (adapter == null) + return null; + if (adapter.equals(IFileTransferPausable.class) && isHTTP11()) + return this; + return super.getAdapter(adapter); + } + + /* (non-Javadoc) + * @see org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer#setupProxy(org.eclipse.ecf.core.util.Proxy) + */ + @Override + 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(); + getRequestConfigBuilder().setProxy(new HttpHost(address.getHostName(), address.getPort())); + } else if (proxy.getType().equals(Proxy.Type.SOCKS)) { + Trace.trace(Activator.PLUGIN_ID, "retrieve socksproxy=" + proxy.getAddress()); //$NON-NLS-1$ + getRequestConfigBuilder().setProxy(null); + 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$ + if (requestConfigBuilder != null) { + requestConfigBuilder.setProxy(null); + } + } + + 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() { + @Override + public IFileID getFileID() { + return remoteFileID; + } + + @Override + public void cancel() { + HttpClientRetrieveFileTransfer.this.cancel(); + } + + @Override + public FileTransferJob prepareConnectJob(FileTransferJob j) { + return HttpClientRetrieveFileTransfer.this.prepareConnectJob(j); + } + + @Override + public void connectUsingJob(FileTransferJob j) { + HttpClientRetrieveFileTransfer.this.connectUsingJob(j); + } + + @Override + public String toString() { + final StringBuffer sb = new StringBuffer("IFileTransferConnectStartEvent["); //$NON-NLS-1$ + sb.append(getFileID()); + sb.append("]"); //$NON-NLS-1$ + return sb.toString(); + } + + @Override + public T getAdapter(Class adapter) { + return adapter.cast(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() { + @Override + 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(); + 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; + + } + + @Override + 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(); + } + + @Override + 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(); + } + + @Override + 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(); + } + + @Override + 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.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientRetrieveFileTransferFactory.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientRetrieveFileTransferFactory.java new file mode 100644 index 000000000..a31456c47 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientRetrieveFileTransferFactory.java @@ -0,0 +1,25 @@ +/**************************************************************************** + * Copyright (c) 2019 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 + * Yatta Solutions - HttpClient 4.5 implementation + *****************************************************************************/ +package org.eclipse.ecf.provider.filetransfer.httpclient45; + +import org.eclipse.ecf.filetransfer.service.IRetrieveFileTransfer; +import org.eclipse.ecf.filetransfer.service.IRetrieveFileTransferFactory; +import org.eclipse.ecf.internal.provider.filetransfer.httpclient45.Activator; + +public class HttpClientRetrieveFileTransferFactory implements IRetrieveFileTransferFactory { + + @Override + public IRetrieveFileTransfer newInstance() { + return new HttpClientRetrieveFileTransfer(Activator.getDefault().getRetrieveHttpClient()); + } +} -- cgit v1.2.3