Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff McAffer2007-11-06 14:01:42 +0000
committerJeff McAffer2007-11-06 14:01:42 +0000
commit0699382805e7246ea9d9084014f4238780101299 (patch)
tree09d821bd36fae4c9391ff5fe9eb7a74ea99f13f9
parent6d9b94d17127ca3efdb478010e5f70377cf88dad (diff)
downloadrt.equinox.p2-0699382805e7246ea9d9084014f4238780101299.tar.gz
rt.equinox.p2-0699382805e7246ea9d9084014f4238780101299.tar.xz
rt.equinox.p2-0699382805e7246ea9d9084014f4238780101299.zip
initial commit of consolidated optimizers
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/.settings/org.eclipse.jdt.core.prefs342
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/.settings/org.eclipse.jdt.ui.prefs60
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF23
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/about.html28
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/build.properties6
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/optimizer.launch23
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/plugin.properties12
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/plugin.xml19
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Activator.java30
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Application.java61
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/DeltaComputer.java171
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Activator.java30
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Application.java61
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java84
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Pack200Step.java107
18 files changed, 1096 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/.classpath b/bundles/org.eclipse.equinox.p2.artifact.optimizers/.classpath
new file mode 100644
index 000000000..7cdeb7319
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/.project b/bundles/org.eclipse.equinox.p2.artifact.optimizers/.project
new file mode 100644
index 000000000..fb4263660
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.equinox.p2.artifact.optimizers</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.artifact.optimizers/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..d1e9ee398
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,342 @@
+#Mon Nov 05 16:53:31 EST 2007
+eclipse.preferences.version=1
+instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.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=error
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
+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.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+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.missingSerialVersion=warning
+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=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=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=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+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.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
+org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=800
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.p2.artifact.optimizers/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..900e4e143
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,60 @@
+#Mon Nov 05 16:53:31 EST 2007
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_core
+formatter_settings_version=11
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=;
+org.eclipse.jdt.ui.ondemandthreshold=3
+org.eclipse.jdt.ui.staticondemandthreshold=3
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>
+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_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/bundles/org.eclipse.equinox.p2.artifact.optimizers/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.equinox.p2.artifact.optimizers/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 000000000..7913d20db
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,4 @@
+
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..d4f384a96
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.equinox.p2.artifact.optimizers;singleton:=true
+Bundle-Name: %pluginName
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-Version: 0.1.0.qualifier
+Bundle-Activator: org.eclipse.equinox.internal.p2.artifact.optimizers.pack200.Activator
+Import-Package: org.eclipse.equinox.app;version="1.0.0",
+ org.eclipse.equinox.p2.artifact.repository,
+ org.eclipse.equinox.p2.artifact.repository.processing,
+ org.eclipse.equinox.p2.core.helpers,
+ org.eclipse.equinox.p2.core.repository,
+ org.eclipse.equinox.p2.jarprocessor,
+ org.eclipse.equinox.p2.metadata,
+ org.eclipse.equinox.p2.metadata.repository,
+ org.osgi.framework;version="1.3.0"
+Eclipse-LazyStart: true
+Require-Bundle: org.eclipse.equinox.common
+Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
+ J2SE-1.4
+Export-Package: org.eclipse.equinox.internal.p2.artifact.optimizers.jardelta;x-internal:=true,
+ org.eclipse.equinox.internal.p2.artifact.optimizers.pack200;x-internal:=true
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/about.html b/bundles/org.eclipse.equinox.p2.artifact.optimizers/about.html
new file mode 100644
index 000000000..460233046
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 2, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/build.properties b/bundles/org.eclipse.equinox.p2.artifact.optimizers/build.properties
new file mode 100644
index 000000000..0dc34f783
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/optimizer.launch b/bundles/org.eclipse.equinox.p2.artifact.optimizers/optimizer.launch
new file mode 100644
index 000000000..19f17af94
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/optimizer.launch
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<launchConfiguration type="org.eclipse.pde.ui.EquinoxLauncher">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="automaticAdd" value="false"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/optimizer"/>
+<booleanAttribute key="default_auto_start" value="false"/>
+<intAttribute key="default_start_level" value="4"/>
+<booleanAttribute key="includeOptional" value="false"/>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-console -consolelog -application org.eclipse.equinox.p2.repositoryoptimizer.application &#13;&#10;-artifactRepository file:d:/tmp/equinox.p2/servers.mirror/artifactRepository/"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="target_bundles" value="org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime@default:default,org.eclipse.core.runtime.compatibility.registry@default:default,org.eclipse.equinox.app@default:true,org.eclipse.equinox.common@default:default,org.eclipse.equinox.launcher@default:default,org.eclipse.equinox.launcher.win32.win32.x86@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.osgi@:,org.eclipse.osgi.services@default:default,org.eclipse.update.configurator@default:default"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useDefaultConfigArea" value="true"/>
+<booleanAttribute key="useNamedJRE" value="true"/>
+<stringAttribute key="vminstall" value="ibm1.5sr1"/>
+<stringAttribute key="workspace_bundles" value="org.eclipse.ecf@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:true,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.download@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.metadata.generator@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.repositoryoptimizer@default:true"/>
+</launchConfiguration>
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/plugin.properties b/bundles/org.eclipse.equinox.p2.artifact.optimizers/plugin.properties
new file mode 100644
index 000000000..4f1955b3b
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/plugin.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+pluginName = Equinox p2 Artifact Optimizers (Incubation)
+providerName = Eclipse.org
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/plugin.xml b/bundles/org.eclipse.equinox.p2.artifact.optimizers/plugin.xml
new file mode 100644
index 000000000..fdbfa3bf7
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/plugin.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension id="jaroptimizer" point="org.eclipse.core.runtime.applications">
+ <application>
+ <run class="org.eclipse.equinox.internal.p2.artifact.optimizers.jardelta.Application"/>
+ </application>
+ </extension>
+
+ <extension id="pack200optimizer" point="org.eclipse.core.runtime.applications">
+ <application>
+ <run class="org.eclipse.equinox.internal.p2.artifact.optimizers.pack200.Application"/>
+ </application>
+ </extension>
+
+ <extension id="Pack200Packer" point="org.eclipse.equinox.p2.artifact.repository.processingSteps">
+ <step class="org.eclipse.equinox.internal.p2.artifact.optimizers.pack200.Pack200Step"/>
+ </extension>
+</plugin>
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Activator.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Activator.java
new file mode 100644
index 000000000..e23c1354c
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Activator.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.equinox.internal.p2.artifact.optimizers.jardelta;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+ public static final String ID = "org.eclipse.equinox.p2.artifact.optimizer.jardelta"; //$NON-NLS-1$
+ private static BundleContext context = null;
+
+ public static BundleContext getContext() {
+ return context;
+ }
+
+ public void start(BundleContext context) throws Exception {
+ Activator.context = context;
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Application.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Application.java
new file mode 100644
index 000000000..7de271a8a
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Application.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.internal.p2.artifact.optimizers.jardelta;
+
+import java.net.URL;
+import java.util.Map;
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.equinox.p2.artifact.repository.IArtifactRepository;
+import org.eclipse.equinox.p2.artifact.repository.IArtifactRepositoryManager;
+import org.eclipse.equinox.p2.core.helpers.ServiceHelper;
+
+public class Application implements IApplication {
+
+ private URL artifactRepositoryLocation;
+
+ public Object start(IApplicationContext context) throws Exception {
+ Map args = context.getArguments();
+ initializeFromArguments((String[]) args.get("application.args"));
+ IArtifactRepository repository = setupRepository(artifactRepositoryLocation);
+ // TODO add the processing in here.
+ return null;
+ }
+
+ private IArtifactRepository setupRepository(URL location) {
+ IArtifactRepositoryManager manager = (IArtifactRepositoryManager) ServiceHelper.getService(Activator.getContext(), IArtifactRepositoryManager.class.getName());
+ if (manager == null)
+ // TODO log here
+ return null;
+ return manager.loadRepository(location, null);
+ }
+
+ public void stop() {
+ }
+
+ public void initializeFromArguments(String[] args) throws Exception {
+ if (args == null)
+ return;
+ for (int i = 0; i < args.length; i++) {
+ // check for args without parameters (i.e., a flag arg)
+ // if (args[i].equals("-pack"))
+ // pack = true;
+
+ // check for args with parameters. If we are at the last argument or
+ // if the next one has a '-' as the first character, then we can't have
+ // an arg with a param so continue.
+ if (i == args.length - 1 || args[i + 1].startsWith("-")) //$NON-NLS-1$
+ continue;
+ String arg = args[++i];
+
+ if (args[i - 1].equalsIgnoreCase("-artifactRepository") | args[i - 1].equalsIgnoreCase("-ar"))
+ artifactRepositoryLocation = new URL(arg);
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/DeltaComputer.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/DeltaComputer.java
new file mode 100644
index 000000000..e0e85a69a
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/DeltaComputer.java
@@ -0,0 +1,171 @@
+package org.eclipse.equinox.internal.p2.artifact.optimizers.jardelta;
+
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+
+public class DeltaComputer {
+ private File target;
+ private File base;
+ private File destination;
+ private JarFile baseJar;
+ private JarFile targetJar;
+ private Set baseEntries;
+ private ArrayList additions;
+ private ArrayList changes;
+
+ public DeltaComputer(File base, File target, File destination) {
+ this.base = base;
+ this.target = target;
+ this.destination = destination;
+ }
+
+ public void run() {
+ try {
+ if (!openJars())
+ return;
+ computeDelta();
+ writeDelta();
+ } finally {
+ closeJars();
+ }
+ }
+
+ private void writeDelta() {
+ JarOutputStream result = null;
+ try {
+ result = new JarOutputStream(new FileOutputStream(destination));
+ // write out the removals. These are all the entries left in the baseEntries
+ // since they were not seen in the targetJar. Here just write out an empty
+ // entry with a name that signals the delta processor to delete.
+ for (Iterator i = baseEntries.iterator(); i.hasNext();)
+ writeEntry(result, new JarEntry(((JarEntry) i.next()).getName() + ".delete"), null);
+ // write out the additions.
+ for (Iterator i = additions.iterator(); i.hasNext();)
+ writeEntry(result, (JarEntry) i.next(), targetJar);
+ // write out the changes.
+ for (Iterator i = changes.iterator(); i.hasNext();)
+ writeEntry(result, (JarEntry) i.next(), targetJar);
+ } catch (IOException e) {
+ e.printStackTrace();
+ return;
+ }
+ }
+
+ private void writeEntry(JarOutputStream result, JarEntry entry, JarFile sourceJar) throws IOException {
+ // add the entry
+ result.putNextEntry(entry);
+ try {
+ // if there is a sourceJar copy over the content for the entry into the result
+ if (sourceJar != null) {
+ InputStream contents = sourceJar.getInputStream(entry);
+ try {
+ transferStreams(contents, result);
+ } finally {
+ contents.close();
+ }
+ }
+ } finally {
+ result.closeEntry();
+ }
+ }
+
+ /**
+ * Transfers all available bytes from the given input stream to the given
+ * output stream. Closes both streams if close == true, regardless of failure.
+ * Flushes the destination stream if close == false
+ *
+ * @param source
+ * @param destination
+ * @param close
+ * @throws IOException
+ */
+ public static void transferStreams(InputStream source, OutputStream destination) throws IOException {
+ source = new BufferedInputStream(source);
+ destination = new BufferedOutputStream(destination);
+ try {
+ byte[] buffer = new byte[8192];
+ while (true) {
+ int bytesRead = -1;
+ if ((bytesRead = source.read(buffer)) == -1)
+ break;
+ destination.write(buffer, 0, bytesRead);
+ }
+ } finally {
+ destination.flush();
+ }
+ }
+
+ private void computeDelta() {
+ ArrayList changes = new ArrayList();
+ ArrayList additions = new ArrayList();
+ // start out assuming that all the base entries are being removed
+ baseEntries = getEntries(baseJar);
+ for (Enumeration e = targetJar.entries(); e.hasMoreElements();) {
+ JarEntry entry = (JarEntry) e.nextElement();
+ check(entry);
+ }
+ }
+
+ private boolean openJars() {
+ try {
+ baseJar = new JarFile(base);
+ targetJar = new JarFile(target);
+ } catch (IOException e) {
+ return false;
+ }
+ return true;
+ }
+
+ private void closeJars() {
+ if (baseJar != null)
+ try {
+ baseJar.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ if (targetJar != null)
+ try {
+ targetJar.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Compare the given entry against the base JAR to see if/how it differs. Update the appropriate set
+ * based on the discovered difference.
+ * @param entry the entry to test
+ */
+ private void check(JarEntry entry) {
+ JarEntry baseEntry = baseJar.getJarEntry(entry.getName());
+ // if there is no entry then this is an addition. remember the addition and return;
+ if (baseEntry == null) {
+ additions.add(entry);
+ return;
+ }
+ // now we know each JAR has an entry for the name, compare and see how/if they differ
+ boolean changed = equals(entry, baseEntry);
+ if (changed)
+ changes.add(entry);
+ baseEntries.remove(baseEntry);
+ }
+
+ // compare the two entries. We already know that they have the same name.
+ private boolean equals(JarEntry entry, JarEntry baseEntry) {
+ if (entry.getSize() != baseEntry.getSize())
+ return false;
+ if (entry.getTime() != baseEntry.getTime())
+ return false;
+ return true;
+ }
+
+ private Set getEntries(JarFile jar) {
+ HashSet result = new HashSet(jar.size());
+ for (Enumeration e = jar.entries(); e.hasMoreElements();)
+ result.add(e.nextElement());
+ return result;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Activator.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Activator.java
new file mode 100644
index 000000000..91577f88d
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Activator.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.equinox.internal.p2.artifact.optimizers.pack200;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+ public static final String ID = "org.eclipse.equinox.p2.artifact.optimizer.pack200"; //$NON-NLS-1$
+ private static BundleContext context = null;
+
+ public static BundleContext getContext() {
+ return context;
+ }
+
+ public void start(BundleContext context) throws Exception {
+ Activator.context = context;
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Application.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Application.java
new file mode 100644
index 000000000..a529ae6c1
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Application.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.internal.p2.artifact.optimizers.pack200;
+
+import java.net.URL;
+import java.util.Map;
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.equinox.p2.artifact.repository.IArtifactRepository;
+import org.eclipse.equinox.p2.artifact.repository.IArtifactRepositoryManager;
+import org.eclipse.equinox.p2.core.helpers.ServiceHelper;
+
+public class Application implements IApplication {
+
+ private URL artifactRepositoryLocation;
+
+ public Object start(IApplicationContext context) throws Exception {
+ Map args = context.getArguments();
+ initializeFromArguments((String[]) args.get("application.args"));
+ IArtifactRepository repository = setupRepository(artifactRepositoryLocation);
+ new Optimizer(repository).run();
+ return null;
+ }
+
+ private IArtifactRepository setupRepository(URL location) {
+ IArtifactRepositoryManager manager = (IArtifactRepositoryManager) ServiceHelper.getService(Activator.getContext(), IArtifactRepositoryManager.class.getName());
+ if (manager == null)
+ // TODO log here
+ return null;
+ return manager.loadRepository(location, null);
+ }
+
+ public void stop() {
+ }
+
+ public void initializeFromArguments(String[] args) throws Exception {
+ if (args == null)
+ return;
+ for (int i = 0; i < args.length; i++) {
+ // check for args without parameters (i.e., a flag arg)
+ // if (args[i].equals("-pack"))
+ // pack = true;
+
+ // check for args with parameters. If we are at the last argument or
+ // if the next one has a '-' as the first character, then we can't have
+ // an arg with a param so continue.
+ if (i == args.length - 1 || args[i + 1].startsWith("-")) //$NON-NLS-1$
+ continue;
+ String arg = args[++i];
+
+ if (args[i - 1].equalsIgnoreCase("-artifactRepository") | args[i - 1].equalsIgnoreCase("-ar"))
+ artifactRepositoryLocation = new URL(arg);
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java
new file mode 100644
index 000000000..a8ab38c40
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.internal.p2.artifact.optimizers.pack200;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.equinox.p2.artifact.repository.*;
+import org.eclipse.equinox.p2.artifact.repository.processing.*;
+import org.eclipse.equinox.p2.metadata.IArtifactKey;
+
+public class Optimizer {
+ private static final String PACKED_FORMAT = "packed"; //$NON-NLS-1$
+ private IArtifactRepository repository;
+
+ public Optimizer(IArtifactRepository repository) {
+ this.repository = repository;
+ }
+
+ public void run() {
+ IArtifactKey[] keys = repository.getArtifactKeys();
+ for (int i = 0; i < keys.length; i++) {
+ IArtifactKey key = keys[i];
+ if (!key.getClassifier().equals("plugin"))
+ continue;
+ IArtifactDescriptor[] descriptors = repository.getArtifactDescriptors(key);
+ IArtifactDescriptor complete = null;
+ boolean optimized = false;
+ for (int j = 0; j < descriptors.length; j++) {
+ IArtifactDescriptor descriptor = descriptors[j];
+ if (descriptor.getProcessingSteps().length == 0)
+ complete = descriptor;
+ optimized |= isOptimized(descriptor);
+ }
+ if (!optimized)
+ optimize(complete);
+ }
+ }
+
+ private void optimize(IArtifactDescriptor descriptor) {
+ ArtifactDescriptor newDescriptor = new ArtifactDescriptor(descriptor);
+ ProcessingStepDescriptor[] steps = new ProcessingStepDescriptor[] {new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Pack200Unpacker", null, true)};
+ newDescriptor.setProcessingSteps(steps);
+ newDescriptor.setProperty(IArtifactDescriptor.FORMAT, PACKED_FORMAT);
+ OutputStream repositoryStream = null;
+ try {
+ repositoryStream = repository.getOutputStream(newDescriptor);
+
+ // Add in all the processing steps needed to optimize (e.g., pack200, ...)
+ ProcessingStepHandler handler = new ProcessingStepHandler();
+ OutputStream destination = handler.link(new ProcessingStep[] {new Pack200Step()}, repositoryStream, null);
+
+ // Do the actual work by asking the repo to get the artifact and put it in the destination.
+ repository.getArtifact(descriptor, destination, new NullProgressMonitor());
+ } finally {
+ if (repositoryStream != null)
+ try {
+ repositoryStream.close();
+ // TODO need to figure out how to get our processing steps linked into the repositoryStream
+ // so that the close() picks up any status issues.
+ IStatus status = ProcessingStepHandler.checkStatus(repositoryStream);
+ if (!status.isOK()) {
+ System.out.println("Skipping optimization of: " + descriptor.getArtifactKey());
+ System.out.println(status.toString());
+ }
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+
+ private boolean isOptimized(IArtifactDescriptor descriptor) {
+ return PACKED_FORMAT.equals(descriptor.getProperty(IArtifactDescriptor.FORMAT));
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Pack200Step.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Pack200Step.java
new file mode 100644
index 000000000..bb8b1cba5
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Pack200Step.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+* Copyright (c) 2007 compeople AG 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:
+* compeople AG (Stefan Liebig) - initial API and implementation
+* IBM - continuing development
+*******************************************************************************/
+package org.eclipse.equinox.internal.p2.artifact.optimizers.pack200;
+
+import java.io.*;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.equinox.p2.artifact.repository.processing.ProcessingStep;
+import org.eclipse.equinox.p2.core.helpers.FileUtils;
+import org.eclipse.equinox.p2.jarprocessor.JarProcessorExecutor;
+import org.eclipse.equinox.p2.jarprocessor.JarProcessorExecutor.Options;
+
+/**
+ * The Pack200Packer expects an input containing normal ".jar" data.
+ */
+public class Pack200Step extends ProcessingStep {
+ private static final String PACKED_SUFFIX = ".pack.gz"; //$NON-NLS-1$
+ private static final String JAR_SUFFIX = ".jar"; //$NON-NLS-1$
+
+ private File source;
+ private OutputStream tempStream;
+
+ public void write(int b) throws IOException {
+ OutputStream stream = getOutputStream();
+ stream.write(b);
+ }
+
+ private OutputStream getOutputStream() throws IOException {
+ if (tempStream != null)
+ return tempStream;
+ // store input stream in temporary file
+ source = File.createTempFile("p2.pack200", JAR_SUFFIX);
+ tempStream = new BufferedOutputStream(new FileOutputStream(source));
+ return tempStream;
+ }
+
+ private void performPack() throws IOException {
+ BufferedInputStream resultStream = null;
+ File resultFile = null;
+ File workDir = null;
+ try {
+ if (tempStream == null)
+ // hmmm, no one wrote to this stream so there is nothing to pass on
+ return;
+ // Ok, so there is content, close the tempStream
+ tempStream.close();
+ // now create a temporary directory for the JarProcessor to work in
+ // TODO How to create a unique, temporary directory atomically?
+ workDir = File.createTempFile("p2.pack200.", "");
+ if (!workDir.delete())
+ throw new IOException("Could not delete file for creating temporary working dir.");
+ if (!workDir.mkdirs())
+ throw new IOException("Could not create temporary working dir.");
+
+ // unpack
+ Options options = new Options();
+ options.pack = true;
+ // TODO use false here assuming that all content is conditioned. Need to revise this
+ options.processAll = false;
+ options.input = source;
+ options.outputDir = workDir.getPath();
+ options.verbose = true;
+ new JarProcessorExecutor().runJarProcessor(options);
+
+ // now write the packed content to our destination
+ resultFile = new File(workDir, source.getName() + PACKED_SUFFIX);
+ if (resultFile.length() > 0) {
+ resultStream = new BufferedInputStream(new FileInputStream(resultFile));
+ FileUtils.copyStream(resultStream, true, destination, false);
+ } else {
+ status = new Status(IStatus.ERROR, Activator.ID, "Empty file packed: " + resultFile);
+ }
+ } finally {
+ if (source != null)
+ source.delete();
+ if (resultFile != null)
+ resultFile.delete();
+ if (workDir != null) {
+ FileUtils.deleteAll(workDir);
+ // TODO try twice since there seems to be some cases where the dir is not
+ // deleted the first time. At least on Windows...
+ FileUtils.deleteAll(workDir);
+ }
+ }
+ }
+
+ public void close() throws IOException {
+ // When we go to close we must have seen all the content we are going to see
+ // So before closing, run unpack and write the unpacked result to the destination
+ performPack();
+ super.close();
+ // TODO need to get real status here but curently the JAR processor does not give
+ // any reasonable return status
+ if (status == null)
+ status = Status.OK_STATUS;
+ }
+
+} \ No newline at end of file

Back to the top