Move org.eclipse.ui.examples.filesystem to eclipse.platform.resources
The project has been updated and merged with #110 into the Platform repository, meaning that it is no longer required to keep it here.
See: https://github.com/eclipse-platform/eclipse.platform.resources
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.classpath b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.classpath
deleted file mode 100644
index 751c8f2..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.cvsignore b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.cvsignore
deleted file mode 100644
index ba077a4..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.gitignore b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.gitignore
deleted file mode 100644
index 5e56e04..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/bin
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.project b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.project
deleted file mode 100644
index 1f6ca95..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.ui.examples.filesystem</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/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.settings/org.eclipse.jdt.core.prefs b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index b27df79..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,248 +0,0 @@
-#Fri Nov 03 17:12:59 GMT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false
-org.eclipse.jdt.core.formatter.comment.format_comments=false
-org.eclipse.jdt.core.formatter.comment.format_header=true
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=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_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.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
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.settings/org.eclipse.jdt.ui.prefs b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index d6a7fef..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Fri Nov 03 17:16:28 GMT 2006
-eclipse.preferences.version=1
-formatter_profile=_core
-formatter_settings_version=10
-org.eclipse.jdt.ui.ignorelowercasenames=true
-org.eclipse.jdt.ui.importorder=;
-org.eclipse.jdt.ui.ondemandthreshold=3
-org.eclipse.jdt.ui.staticondemandthreshold=99
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/META-INF/MANIFEST.MF b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/META-INF/MANIFEST.MF
deleted file mode 100644
index c1bb2d5..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,14 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Efs Examples Plug-in
-Bundle-SymbolicName: org.eclipse.ui.examples.filesystem;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Vendor: eclipse.org
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.core.filesystem,
- org.eclipse.core.resources,
- org.eclipse.ui.ide,
- org.eclipse.ui,
- org.eclipse.osgi,
- org.eclipse.core.runtime
-Eclipse-LazyStart: true
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/build.properties b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/build.properties
deleted file mode 100644
index e9863e2..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/plugin.xml b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/plugin.xml
deleted file mode 100644
index 8409efc..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/plugin.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <extension
- id="org.eclipse.core.filesystem.zip"
- point="org.eclipse.core.filesystem.filesystems">
- <filesystem scheme="zip">
- <run class="org.eclipse.core.internal.filesystem.zip.ZipFileSystem"/>
- </filesystem>
- </extension>
- <extension
- point="org.eclipse.core.filesystem.filesystems">
- <filesystem scheme="memory">
- <run class="org.eclipse.core.internal.filesystem.memory.MemoryFileSystem"/>
- </filesystem>
- </extension>
- <extension
- point="org.eclipse.ui.popupMenus">
- <objectContribution
- id="org.eclipse.ui.examples.filesystem.contribution1"
- objectClass="org.eclipse.core.resources.IFile">
- <action
- class="org.eclipse.ui.examples.filesystem.ExpandZipAction"
- enablesFor="1"
- id="org.eclipse.ui.examples.filesystem.expandZip"
- label="Expand Zip File"
- menubarPath="additions">
- <enablement>
- <or>
- <objectState name="extension" value="jar"/>
- <objectState name="extension" value="zip"/>
- </or>
- </enablement>
- </action>
- </objectContribution>
- </extension>
- <extension
- point="org.eclipse.ui.popupMenus">
- <objectContribution
- id="org.eclipse.ui.examples.filesystem.contribution2"
- objectClass="org.eclipse.core.resources.IFolder">
- <action
- class="org.eclipse.ui.examples.filesystem.CollapseZipAction"
- enablesFor="1"
- id="org.eclipse.ui.examples.filesystem.collapseZip"
- label="Collapse Zip File"
- menubarPath="additions">
- <enablement>
- <or>
- <objectState name="extension" value="jar"/>
- <objectState name="extension" value="zip"/>
- </or>
- </enablement>
- </action>
- </objectContribution>
- </extension>
- <extension
- point="org.eclipse.ui.popupMenus">
- <objectContribution
- id="org.eclipse.ui.examples.filesystem.contribution3"
- objectClass="org.eclipse.core.resources.IResource">
- <action
- class="org.eclipse.ui.examples.filesystem.IncludeResourceAction"
- enablesFor="1"
- id="org.eclipse.ui.examples.filesystem.includeResource"
- label="Include Resource"
- menubarPath="additions"/>
- <action
- class="org.eclipse.ui.examples.filesystem.ExcludeResourceAction"
- enablesFor="1"
- id="org.eclipse.ui.examples.filesystem.excludeResource"
- label="Exclude Resource"
- menubarPath="additions"/>
- </objectContribution>
- </extension>
- <extension
- point="org.eclipse.ui.popupMenus">
- <objectContribution
- id="org.eclipse.ui.examples.filesystem.contribution4"
- objectClass="org.eclipse.core.resources.IProject">
- <action
- class="org.eclipse.ui.examples.filesystem.CreatedNestedProjectsAction"
- enablesFor="1"
- id="org.eclipse.ui.examples.filesystem.createdNested"
- label="Create Nested Projects"
- menubarPath="additions"/>
- </objectContribution>
- </extension>
- <extension
- point="org.eclipse.ui.ide.filesystemSupport">
- <filesystemContributor
- class="org.eclipse.core.internal.filesystem.zip.ZipFileSystemContributor"
- label="Zip file"
- scheme="zip"/>
- <filesystemContributor
- class="org.eclipse.core.internal.filesystem.memory.MemoryFileSystemContributor"
- label="In Memory"
- scheme="memory"/>
- </extension>
- <extension
- point="org.eclipse.core.runtime.adapters">
- <factory
- adaptableType="org.eclipse.core.internal.filesystem.memory.MemoryFileStore"
- class="org.eclipse.core.internal.filesystem.memory.MemoryAdapterFactory">
- <adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/>
- </factory>
- </extension>
-
-</plugin>
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryAdapterFactory.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryAdapterFactory.java
deleted file mode 100644
index 962ee46..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryAdapterFactory.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.filesystem.memory;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-/**
- * A factory that adapts MemoryTree nodes to WorkbenchAdapter for display
- * in the UI.
- */
-public class MemoryAdapterFactory implements IAdapterFactory {
- private Class[] ADAPTER_LIST = new Class[] {IWorkbenchAdapter.class};
- private WorkbenchMemoryNode memoryAdapter = new WorkbenchMemoryNode();
-
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adaptableObject instanceof MemoryFileStore && adapterType.equals(IWorkbenchAdapter.class))
- return memoryAdapter;
- return null;
- }
-
- public Class[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
-}
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryFileStore.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryFileStore.java
deleted file mode 100644
index d54746e..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryFileStore.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.core.internal.filesystem.memory;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URI;
-import org.eclipse.core.filesystem.*;
-import org.eclipse.core.filesystem.provider.FileStore;
-import org.eclipse.core.runtime.*;
-
-/**
- * In memory file system implementation used for testing.
- */
-public class MemoryFileStore extends FileStore {
- private static final MemoryTree TREE = MemoryTree.TREE;
-
- private final IPath path;
-
- public MemoryFileStore(IPath path) {
- super();
- this.path = path.setDevice(null);
- }
-
- public String[] childNames(int options, IProgressMonitor monitor) {
- final String[] names = TREE.childNames(path);
- return names == null ? EMPTY_STRING_ARRAY : names;
- }
-
- public void delete(int options, IProgressMonitor monitor) throws CoreException {
- TREE.delete(path);
- }
-
- public IFileInfo fetchInfo(int options, IProgressMonitor monitor) {
- return TREE.fetchInfo(path);
- }
-
- public IFileStore getChild(String name) {
- return new MemoryFileStore(path.append(name));
- }
-
- public String getName() {
- final String name = path.lastSegment();
- return name == null ? "" : name;
- }
-
- public IFileStore getParent() {
- if (path.segmentCount() == 0)
- return null;
- return new MemoryFileStore(path.removeLastSegments(1));
- }
-
- public IFileStore mkdir(int options, IProgressMonitor monitor) throws CoreException {
- TREE.mkdir(path, (options & EFS.SHALLOW) == 0);
- return this;
- }
-
- public InputStream openInputStream(int options, IProgressMonitor monitor) throws CoreException {
- return TREE.openInputStream(path);
- }
-
- public OutputStream openOutputStream(int options, IProgressMonitor monitor) throws CoreException {
- return TREE.openOutputStream(path, options);
- }
-
- public void putInfo(IFileInfo info, int options, IProgressMonitor monitor) throws CoreException {
- TREE.putInfo(path, info, options);
- }
-
- public URI toURI() {
- return MemoryFileSystem.toURI(path);
- }
-}
\ No newline at end of file
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryFileSystem.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryFileSystem.java
deleted file mode 100644
index 309268f..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryFileSystem.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.core.internal.filesystem.memory;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.filesystem.provider.FileSystem;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-
-/**
- * A test file system that keeps everything in memory.
- */
-public class MemoryFileSystem extends FileSystem {
- public static final String SCHEME_MEMORY = "memory";
-
- /**
- * Converts a path to a URI in the memory file system.
- * @param path
- * @return
- */
- public static URI toURI(IPath path) {
- try {
- return new URI(MemoryFileSystem.SCHEME_MEMORY, null, path.setDevice(null).toPortableString(), null);
- } catch (URISyntaxException e) {
- //should not happen
- throw new RuntimeException(e);
- }
- }
-
- public MemoryFileSystem() {
- super();
- }
-
- public IFileStore getStore(URI uri) {
- return new MemoryFileStore(Path.fromPortableString(uri.getSchemeSpecificPart()));
- }
-
- public boolean isCaseSensitive() {
- return true;
- }
-}
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryFileSystemContributor.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryFileSystemContributor.java
deleted file mode 100644
index a7f6a80..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryFileSystemContributor.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.core.internal.filesystem.memory;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.ide.fileSystem.FileSystemContributor;
-
-/**
- * ZipFileSystemContributor is the zip example of a file system
- * contributor.
- *
- */
-public class MemoryFileSystemContributor extends FileSystemContributor {
-
- public MemoryFileSystemContributor() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.ide.fileSystem.FileSystemContributor#browseFileSystem(java.lang.String, org.eclipse.swt.widgets.Shell)
- */
- public URI browseFileSystem(String initialPath, Shell shell) {
- MemoryTreeSelectionDialog dialog = new MemoryTreeSelectionDialog(shell);
- if (dialog.open() != Window.OK)
- return null;
- Object[] result = dialog.getResult();
- if (result.length == 0)
- return null;
- return ((IFileStore) result[0]).toURI();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.ide.fileSystem.FileSystemContributor#getURI(java.lang.String)
- */
- public URI getURI(String string) {
- try {
- if (string.startsWith(MemoryFileSystem.SCHEME_MEMORY))
- return new URI(string);
- } catch (URISyntaxException e) {
- Policy.log(Policy.createStatus(e));
- e.printStackTrace();
- }
- return MemoryFileSystem.toURI(new Path(string));
- }
-}
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryTree.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryTree.java
deleted file mode 100644
index de34eaf..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryTree.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.core.internal.filesystem.memory;
-
-import java.io.*;
-import java.util.ArrayList;
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileInfo;
-import org.eclipse.core.filesystem.provider.FileInfo;
-import org.eclipse.core.runtime.*;
-
-/**
- * An in-memory file system.
- */
-public class MemoryTree {
- static class DirNode extends Node {
- private final ArrayList children = new ArrayList();
-
- DirNode(Node parent, String name) {
- super(parent, name);
- }
-
- void add(Node child) {
- children.add(child);
- }
-
- public String[] childNames() {
- String[] names = new String[children.size()];
- for (int i = 0, imax = children.size(); i < imax; i++) {
- Node child = (Node) children.get(i);
- names[i] = child.getInfo(false).getName();
- }
- return names;
- }
-
- /**
- * Returns the child with the given name, or null if not found.
- * @param name
- * @return
- */
- Node getChild(String name) {
- for (int i = 0, imax = children.size(); i < imax; i++) {
- Node child = (Node) children.get(i);
- if (child.getInfo(false).getName().equals(name))
- return child;
- }
- return null;
- }
-
- protected void initializeInfo(FileInfo fileInfo) {
- super.initializeInfo(fileInfo);
- fileInfo.setDirectory(true);
- }
-
- boolean isFile() {
- return false;
- }
-
- void remove(String name) {
- Node child = getChild(name);
- if (child != null)
- children.remove(child);
- }
-
- public String toString() {
- return super.toString() + ' ' + children;
- }
- }
-
- static class FileNode extends Node {
- byte[] contents = EMPTY_CONTENTS;
-
- FileNode(Node parent, String name) {
- super(parent, name);
- }
-
- boolean isFile() {
- return true;
- }
-
- public InputStream openInputStream() {
- return new ByteArrayInputStream(contents);
- }
-
- public OutputStream openOutputStream(final int options) {
- return new ByteArrayOutputStream() {
- public void close() throws IOException {
- super.close();
- setContents(toByteArray(), options);
- }
- };
- }
-
- protected void setContents(byte[] bytes, int options) {
- if ((options & EFS.APPEND) != 0) {
- //create reference in case of concurrent modification
- byte[] oldContents = this.contents;
- byte[] newContents = new byte[oldContents.length + bytes.length];
- System.arraycopy(oldContents, 0, newContents, 0, oldContents.length);
- System.arraycopy(bytes, 0, newContents, oldContents.length, bytes.length);
- this.contents = newContents;
- } else
- this.contents = bytes;
- info.setLastModified(System.currentTimeMillis());
- ((FileInfo) info).setLength(bytes.length);
- }
- }
-
- static abstract class Node extends PlatformObject {
- protected IFileInfo info;
-
- Node(Node parent, String name) {
- if (parent != null)
- ((DirNode) parent).add(this);
- FileInfo fileInfo = new FileInfo(name);
- initializeInfo(fileInfo);
- this.info = fileInfo;
- }
-
- IFileInfo getInfo(boolean copy) {
- return (IFileInfo) (copy ? ((FileInfo) info).clone() : info);
- }
-
- protected void initializeInfo(FileInfo fileInfo) {
- fileInfo.setExists(true);
- fileInfo.setLastModified(System.currentTimeMillis());
- }
-
- abstract boolean isFile();
-
- void putInfo(IFileInfo newInfo, int options) {
- if ((options & EFS.SET_ATTRIBUTES) != 0) {
- for (int i = 0; i < ALL_ATTRIBUTES.length; i++)
- info.setAttribute(ALL_ATTRIBUTES[i], newInfo.getAttribute(ALL_ATTRIBUTES[i]));
- }
- if ((options & EFS.SET_LAST_MODIFIED) != 0) {
- info.setLastModified(newInfo.getLastModified());
- }
- }
-
- /**
- * For debugging purposes only.
- */
- public String toString() {
- return info.getName();
- }
- }
-
- static final int[] ALL_ATTRIBUTES = new int[] {EFS.ATTRIBUTE_ARCHIVE, EFS.ATTRIBUTE_EXECUTABLE, EFS.ATTRIBUTE_HIDDEN, EFS.ATTRIBUTE_READ_ONLY,};
-
- public static final MemoryTree TREE = new MemoryTree();
-
- static final byte[] EMPTY_CONTENTS = new byte[0];
-
- private static final String ROOT_NAME = "<root>";
-
- private Node root = new DirNode(null, ROOT_NAME);
-
- private MemoryTree() {
- // TREE singleton should be used rather than direct instantiation
- }
-
- public String[] childNames(IPath path) {
- Node node = findNode(path);
- if (node == null || node.isFile())
- return null;
- return ((DirNode) node).childNames();
- }
-
- public void delete(IPath path) {
- //cannot delete the root
- if (path.segmentCount() == 0)
- return;
- Node parent = findNode(path.removeLastSegments(1));
- if (parent == null || parent.isFile())
- return;
- ((DirNode) parent).remove(path.lastSegment());
-
- }
-
- /**
- * Deletes the entire memory tree. Used during debugging and testing only.
- */
- public void deleteAll() {
- this.root = new DirNode(null, ROOT_NAME);
- }
-
- /**
- * Returns the file info for the given path. Never returns null.
- * @param path
- * @return
- */
- public synchronized IFileInfo fetchInfo(IPath path) {
- Node node = findNode(path);
- if (node == null)
- return new FileInfo(path.lastSegment());
- return node.getInfo(true);
- }
-
- /**
- * Returns the node at the given path, or null if not found.
- *
- * @param path
- * @return
- */
- private Node findNode(IPath path) {
- Node current = root;
- for (int i = 0, imax = path.segmentCount(); i < imax; i++) {
- if (current == null || current.isFile())
- return null;
- current = ((DirNode) current).getChild(path.segment(i));
- }
- return current;
- }
-
- public Node mkdir(IPath path, boolean deep) throws CoreException {
- Node dir = findNode(path);
- if (dir != null) {
- if (dir.isFile())
- Policy.error("A file exists with this name: " + path);
- return dir;
- }
- final IPath parentPath = path.removeLastSegments(1);
- Node parent = findNode(parentPath);
- if (parent != null) {
- if (parent.isFile())
- Policy.error("Parent is a file: " + path);
- } else {
- if (!deep)
- Policy.error("Parent does not exist: " + parentPath);
- parent = mkdir(parentPath, deep);
- }
- //create the child directory
- return new DirNode(parent, path.lastSegment());
- }
-
- public InputStream openInputStream(IPath path) throws CoreException {
- Node node = findNode(path);
- if (node == null)
- Policy.error("File not found: " + path);
- if (!node.isFile())
- Policy.error("Cannot open stream on directory: " + path);
- return ((FileNode) node).openInputStream();
- }
-
- public OutputStream openOutputStream(IPath path, int options) throws CoreException {
- Node node = findNode(path);
- //if we already have such a file, just open a stream on it
- if (node instanceof DirNode)
- Policy.error("Could not create file: " + path);
- if (node instanceof FileNode)
- return ((FileNode) node).openOutputStream(options);
- //if the parent exists we can create the file
- Node parent = findNode(path.removeLastSegments(1));
- if (!(parent instanceof DirNode))
- Policy.error("Could not create file: " + path);
- node = new FileNode(parent, path.lastSegment());
- return ((FileNode) node).openOutputStream(options);
- }
-
- public void putInfo(IPath path, IFileInfo info, int options) throws CoreException {
- Node node = findNode(path);
- if (node == null)
- Policy.error("File not found: " + path);
- node.putInfo(info, options);
- }
-}
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryTreeSelectionDialog.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryTreeSelectionDialog.java
deleted file mode 100644
index 74236c9..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/MemoryTreeSelectionDialog.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.filesystem.memory;
-
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-/**
- * A dialog that presents a tree of memory tree elements
- * for the user to select from.
- */
-public class MemoryTreeSelectionDialog extends SelectionDialog {
-
- /**
- * Button id for the button that creates a new file
- */
- private static final int CREATE_FILE_ID = 16;
- /**
- * Button id for the button that creates a new folder
- */
- private static final int CREATE_FOLDER_ID = 17;
-
- private Text nameField;
- TreeViewer tree;
-
- protected MemoryTreeSelectionDialog(Shell parentShell) {
- super(parentShell);
- }
-
- protected void buttonPressed(int buttonId) {
- if (buttonId == CREATE_FILE_ID || buttonId == CREATE_FOLDER_ID) {
- try {
- IFileStore parent = getSelectedFileStore();
- IFileStore toCreate;
- if (parent != null)
- toCreate = parent.getChild(nameField.getText());
- else
- toCreate = new MemoryFileStore(Path.ROOT.append(nameField.getText()));
- if (buttonId == CREATE_FILE_ID) {
- toCreate.openOutputStream(EFS.NONE, null).close();
- } else {
- toCreate.mkdir(EFS.NONE, null);
- }
- tree.refresh();
- } catch (Exception e) {
- IStatus status = Policy.createStatus(e);
- ErrorDialog.openError(getShell(), null, null, status);
- Policy.log(status);
- }
- } else {
- super.buttonPressed(buttonId);
- }
- }
-
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText("Select an element from the in-memory file system");
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite top = (Composite) super.createDialogArea(parent);
-
- tree = new TreeViewer(top, SWT.SINGLE | SWT.BORDER);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.heightHint = 300;
- tree.getControl().setLayoutData(data);
- tree.setContentProvider(new WorkbenchContentProvider());
- tree.setLabelProvider(new WorkbenchLabelProvider());
- tree.setInput(new MemoryFileStore(Path.ROOT));
-
- createNewElementArea(parent);
-
- return top;
- }
-
- /**
- * Creates the dialog region that allows the user to specify a new element name
- * @param parent
- */
- private void createNewElementArea(Composite parent) {
- Composite area = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 4;
- area.setLayout(layout);
- area.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- new Label(area, SWT.NONE).setText("Name: ");
- nameField = new Text(area, SWT.SINGLE | SWT.BORDER);
- GridData data = new GridData();
- data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
- nameField.setLayoutData(data);
-
- createButton(area, CREATE_FILE_ID, "New File", false);
- createButton(area, CREATE_FOLDER_ID, "New Folder", false);
- }
-
- /**
- * Returns the currently selected file store, or null if there is no select.
- * @return
- */
- private IFileStore getSelectedFileStore() {
- ISelection selection = tree.getSelection();
- if (selection instanceof IStructuredSelection) {
- IFileStore selected = (IFileStore) ((IStructuredSelection) selection).getFirstElement();
- if (selected != null)
- return selected;
- }
- return null;
- }
-
- protected int getShellStyle() {
- return super.getShellStyle() | SWT.RESIZE;
- }
-
- protected void okPressed() {
- IStructuredSelection selection = (IStructuredSelection) tree.getSelection();
- setResult(selection.toList());
- super.okPressed();
- }
-}
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/Policy.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/Policy.java
deleted file mode 100644
index 1a1c870..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/Policy.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.core.internal.filesystem.memory;
-
-import org.eclipse.core.runtime.*;
-
-/**
- *
- */
-public class Policy {
- public static final String PI_FILESYSTEM_EXAMPLE = "org.eclipse.ui.examples.filesystem"; //$NON-NLS-1$
-
- public static void error(String message) throws CoreException {
- throw new CoreException(new Status(IStatus.ERROR, PI_FILESYSTEM_EXAMPLE, 1, message, null));
- }
-
- private Policy() {
- super();
- }
-
- public static void log(IStatus status) {
- Platform.getLog(Platform.getBundle(PI_FILESYSTEM_EXAMPLE)).log(status);
- }
-
- public static IStatus createStatus(Throwable t) {
- if (t instanceof CoreException)
- return ((CoreException) t).getStatus();
- return new Status(IStatus.ERROR, PI_FILESYSTEM_EXAMPLE, 1, "Internal Error: " + t.getMessage(), t);
- }
-
-}
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/WorkbenchMemoryNode.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/WorkbenchMemoryNode.java
deleted file mode 100644
index 2495435..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/memory/WorkbenchMemoryNode.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.filesystem.memory;
-
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-/**
- *
- */
-public class WorkbenchMemoryNode implements IWorkbenchAdapter {
-
- public Object[] getChildren(Object parent) {
- try {
- return ((MemoryFileStore) parent).childStores(EFS.NONE, null);
- } catch (CoreException e) {
- return new Object[0];
- }
- }
-
- public ImageDescriptor getImageDescriptor(Object object) {
- return null;
- }
-
- public String getLabel(Object o) {
- return ((MemoryFileStore) o).getName();
- }
-
- public Object getParent(Object o) {
- return ((MemoryFileStore) o).getParent();
- }
-
-}
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/zip/ZipFileStore.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/zip/ZipFileStore.java
deleted file mode 100644
index 6511c2e..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/zip/ZipFileStore.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.core.internal.filesystem.zip;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-import org.eclipse.core.filesystem.*;
-import org.eclipse.core.filesystem.provider.FileInfo;
-import org.eclipse.core.filesystem.provider.FileStore;
-import org.eclipse.core.internal.filesystem.Messages;
-import org.eclipse.core.internal.filesystem.Policy;
-import org.eclipse.core.runtime.*;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * File store implementation representing a file or directory inside
- * a zip file.
- */
-public class ZipFileStore extends FileStore {
- /**
- * The path of this store within the zip file.
- */
- private IPath path;
-
- /**
- * The file store that represents the actual zip file.
- */
- private IFileStore rootStore;
-
- /**
- * Creates a new zip file store.
- * @param rootStore
- * @param path
- */
- public ZipFileStore(IFileStore rootStore, IPath path) {
- this.rootStore = rootStore;
- this.path = path.makeRelative();
- }
-
- private ZipEntry[] childEntries(IProgressMonitor monitor) throws CoreException {
- HashMap entries = new HashMap();
- ZipInputStream in = new ZipInputStream(rootStore.openInputStream(EFS.NONE, monitor));
- String myName = path.toString();
- try {
- ZipEntry current;
- while ((current = in.getNextEntry()) != null) {
- final String currentPath = current.getName();
- if (isParent(myName, currentPath))
- entries.put(currentPath, current);
- else if (isAncestor(myName, currentPath)) {
- int myNameLength = myName.length() + 1;
- int nameEnd = currentPath.indexOf('/', myNameLength);
- String dirName = nameEnd == -1 ? currentPath : currentPath.substring(0, nameEnd + 1);
- if (!entries.containsKey(dirName))
- entries.put(dirName, new ZipEntry(dirName));
- }
- }
- } catch (IOException e) {
- Policy.error(EFS.ERROR_READ, NLS.bind(Messages.couldNotRead, rootStore.toString()), e);
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (IOException e) {
- //ignore
- }
- }
- return (ZipEntry[]) entries.values().toArray(new ZipEntry[entries.size()]);
- }
-
- public IFileInfo[] childInfos(int options, IProgressMonitor monitor) throws CoreException {
- ZipEntry[] entries = childEntries(monitor);
- int entryCount = entries.length;
- IFileInfo[] infos = new IFileInfo[entryCount];
- for (int i = 0; i < entryCount; i++)
- infos[i] = convertZipEntryToFileInfo(entries[i]);
- return infos;
- }
-
- public String[] childNames(int options, IProgressMonitor monitor) throws CoreException {
- ZipEntry[] entries = childEntries(monitor);
- int entryCount = entries.length;
- String[] names = new String[entryCount];
- for (int i = 0; i < entryCount; i++)
- names[i] = computeName(entries[i]);
- return names;
- }
-
- /**
- * Computes the simple file name for a given zip entry.
- */
- private String computeName(ZipEntry entry) {
- //the entry name is a relative path, with an optional trailing separator
- //We need to strip off the trailing slash, and then take everything after the
- //last separator as the name
- String name = entry.getName();
- int end = name.length() - 1;
- if (name.charAt(end) == '/')
- end--;
- return name.substring(name.lastIndexOf('/', end) + 1, end + 1);
- }
-
- /**
- * Creates a file info object corresponding to a given zip entry
- *
- * @param entry the zip entry
- * @return The file info for a zip entry
- */
- private IFileInfo convertZipEntryToFileInfo(ZipEntry entry) {
- FileInfo info = new FileInfo(computeName(entry));
- info.setLastModified(entry.getTime());
- info.setExists(true);
- info.setDirectory(entry.isDirectory());
- info.setLength(entry.getSize());
- return info;
- }
-
- public IFileInfo fetchInfo(int options, IProgressMonitor monitor) throws CoreException {
- ZipInputStream in = new ZipInputStream(rootStore.openInputStream(EFS.NONE, monitor));
- try {
- String myPath = path.toString();
- ZipEntry current;
- while ((current = in.getNextEntry()) != null) {
- String currentPath = current.getName();
- if (myPath.equals(currentPath))
- return convertZipEntryToFileInfo(current);
- //directories don't always have their own entry, but it is implied by the existence of a child
- if (isAncestor(myPath, currentPath))
- return createDirectoryInfo(getName());
- }
- } catch (IOException e) {
- Policy.error(EFS.ERROR_READ, NLS.bind(Messages.couldNotRead, rootStore.toString()), e);
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (IOException e) {
- //ignore
- }
- }
- //does not exist
- return new FileInfo(getName());
- }
-
- /**
- * @return A directory info for this file store
- */
- private IFileInfo createDirectoryInfo(String name) {
- FileInfo result = new FileInfo(name);
- result.setExists(true);
- result.setDirectory(true);
- return result;
- }
-
- /**
- * Finds the zip entry with the given name in this zip file. Returns the
- * entry and leaves the input stream open positioned at the beginning of
- * the bytes of that entry. Returns null if the entry could not be found.
- */
- private ZipEntry findEntry(String name, ZipInputStream in) throws IOException {
- ZipEntry current;
- while ((current = in.getNextEntry()) != null) {
- if (current.getName().equals(name))
- return current;
- }
- return null;
- }
-
- public IFileStore getChild(String name) {
- return new ZipFileStore(rootStore, path.append(name));
- }
-
- public String getName() {
- String name = path.lastSegment();
- return name == null ? "" : name; //$NON-NLS-1$
- }
-
- public IFileStore getParent() {
- if (path.segmentCount() > 0)
- return new ZipFileStore(rootStore, path.removeLastSegments(1));
- //the root entry has no parent
- return null;
- }
-
- /**
- * Returns whether ancestor is a parent of child.
- * @param ancestor the potential ancestor
- * @param child the potential child
- * @return <code>true</code> or <code>false</code>
- */
- private boolean isAncestor(String ancestor, String child) {
- //children will start with myName and have no child path
- int ancestorLength = ancestor.length();
- if (ancestorLength == 0)
- return true;
- return child.startsWith(ancestor) && child.length() > ancestorLength && child.charAt(ancestorLength) == '/';
- }
-
- /**
- * Returns whether parent is the immediate parent of child.
- * @param parent the potential parent
- * @param child the potential child
- * @return <code>true</code> or <code>false</code>
- */
- private boolean isParent(String parent, String child) {
- //children will start with myName and have no child path
- int chop = parent.length() + 1;
- return child.startsWith(parent) && child.length() > chop && child.substring(chop).indexOf('/') == -1;
- }
-
- public InputStream openInputStream(int options, IProgressMonitor monitor) throws CoreException {
- ZipInputStream in = new ZipInputStream(rootStore.openInputStream(EFS.NONE, monitor));
- try {
- ZipEntry entry = findEntry(path.toString(), in);
- if (entry == null)
- Policy.error(EFS.ERROR_READ, NLS.bind(Messages.fileNotFound, toString()), null);
- if (entry.isDirectory())
- Policy.error(EFS.ERROR_READ, NLS.bind(Messages.notAFile, toString()), null);
- return in;
- } catch (IOException e) {
- try {
- if (in != null)
- in.close();
- } catch (IOException e1) {
- //ignore secondary failure
- }
- Policy.error(EFS.ERROR_READ, NLS.bind(Messages.couldNotRead, rootStore.toString()), e);
- }
- //can't get here
- return null;
- }
-
- public URI toURI() {
- try {
- return new URI(ZipFileSystem.SCHEME_ZIP, null, path.makeAbsolute().toString(), rootStore.toURI().toString(), null);
- } catch (URISyntaxException e) {
- //should not happen
- throw new RuntimeException(e);
- }
- }
-}
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/zip/ZipFileSystem.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/zip/ZipFileSystem.java
deleted file mode 100644
index 121ad99..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/zip/ZipFileSystem.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.core.internal.filesystem.zip;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.filesystem.provider.FileSystem;
-import org.eclipse.core.runtime.*;
-
-/**
- *
- */
-public class ZipFileSystem extends FileSystem {
- /**
- * Scheme constant (value "zip") indicating the zip file system scheme.
- */
- public static final String SCHEME_ZIP = "zip"; //$NON-NLS-1$
-
- public IFileStore getStore(URI uri) {
- if (SCHEME_ZIP.equals(uri.getScheme())) {
- IPath path = new Path(uri.getPath());
- try {
- return new ZipFileStore(EFS.getStore(new URI(uri.getQuery())), path);
- } catch (URISyntaxException e) {
- //ignore and fall through below
- } catch (CoreException e) {
- //ignore and fall through below
- }
- }
- return EFS.getNullFileSystem().getStore(uri);
- }
-}
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/zip/ZipFileSystemContributor.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/zip/ZipFileSystemContributor.java
deleted file mode 100644
index e8bd600..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/core/internal/filesystem/zip/ZipFileSystemContributor.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.core.internal.filesystem.zip;
-
-import java.io.File;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.ide.fileSystem.FileSystemContributor;
-
-/**
- * ZipFileSystemContributor is the zip example of a file system contributor.
- *
- */
-public class ZipFileSystemContributor extends FileSystemContributor {
-
- public ZipFileSystemContributor() {
- super();
- }
-
- public URI getURI(String pathString) {
- try {
- if (pathString.startsWith(ZipFileSystem.SCHEME_ZIP))
- return new URI(pathString);
- } catch (URISyntaxException e1) {
- return null;
- }
- if (File.separatorChar != '/')
- pathString = pathString.replace(File.separatorChar, '/');
- final int length = pathString.length();
- StringBuffer pathBuf = new StringBuffer(length + 1);
- pathBuf.append("file:"); //$NON-NLS-1$
- // There must be a leading slash in a hierarchical URI
- if (length > 0 && (pathString.charAt(0) != '/'))
- pathBuf.append('/');
- // additional double-slash for UNC paths to distinguish from host
- // separator
- if (pathString.startsWith("//")) //$NON-NLS-1$
- pathBuf.append('/').append('/');
- pathBuf.append(pathString);
- try {
- //scheme, host, path, query, fragment
- return new URI(ZipFileSystem.SCHEME_ZIP, null, "/", pathBuf.toString(), null); //$NON-NLS-1$
- } catch (URISyntaxException e) {
- return null;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.ide.fileSystem.FileSystemContributor#browseFileSystem(java.lang.String, org.eclipse.swt.widgets.Shell)
- */
- public URI browseFileSystem(String initialPath, Shell shell) {
-
- FileDialog dialog = new FileDialog(shell);
-
- if (initialPath.length() > 0)
- dialog.setFilterPath(initialPath);
-
- dialog.setFilterExtensions(new String[] {"*.zip"});//$NON-NLS-1$
-
- String selectedFile = dialog.open();
- if (selectedFile == null)
- return null;
- return getURI(selectedFile);
- }
-
-}
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/CollapseZipAction.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/CollapseZipAction.java
deleted file mode 100644
index 72d9087..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/CollapseZipAction.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.eclipse.ui.examples.filesystem;
-
-import java.net.URI;
-import org.eclipse.core.filesystem.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.*;
-
-public class CollapseZipAction implements IObjectActionDelegate {
-
- private ISelection selection;
- private IWorkbenchPart targetPart;
-
- /**
- * Constructor for Action1.
- */
- public CollapseZipAction() {
- super();
- }
-
- private void collapseZip(IFolder folder) {
- try {
- URI zipURI = new URI(folder.getLocationURI().getQuery());
- //check if the zip file is physically stored below the folder in the workspace
- IFileStore parentStore = EFS.getStore(folder.getParent().getLocationURI());
- URI childURI = parentStore.getChild(folder.getName()).toURI();
- if (URIUtil.equals(zipURI, childURI)) {
- //the zip file is in the workspace so just delete the link
- // and refresh the parent to create the resource
- folder.delete(IResource.NONE, null);
- folder.getParent().refreshLocal(IResource.DEPTH_INFINITE, null);
- } else {
- //otherwise the zip file must be a linked resource
- IFile file = folder.getParent().getFile(new Path(folder.getName()));
- file.createLink(zipURI, IResource.REPLACE, null);
- }
- } catch (Exception e) {
- MessageDialog.openError(getShell(), "Error", "Error opening zip file");
- e.printStackTrace();
- }
- }
-
- private Shell getShell() {
- return targetPart.getSite().getShell();
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- if (!(selection instanceof IStructuredSelection))
- return;
- Object element = ((IStructuredSelection) selection).getFirstElement();
- if (!(element instanceof IFolder))
- return;
- collapseZip((IFolder) element);
-
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- this.selection = selection;
- }
-
- /**
- * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- this.targetPart = targetPart;
- }
-
-}
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/CreatedNestedProjectsAction.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/CreatedNestedProjectsAction.java
deleted file mode 100644
index 2f7e1db..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/CreatedNestedProjectsAction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.eclipse.ui.examples.filesystem;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.*;
-
-/**
- * Popup menu action to find and create the projects nested within the
- * selected projects.
- *
- */
-public class CreatedNestedProjectsAction implements IObjectActionDelegate {
-
- private ISelection selection;
- private IWorkbenchPart targetPart;
-
- /**
- * Constructor for Action1.
- */
- public CreatedNestedProjectsAction() {
- super();
- }
-
- private Shell getShell() {
- return targetPart.getSite().getShell();
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- if (!(selection instanceof IStructuredSelection))
- return;
- Object element = ((IStructuredSelection) selection).getFirstElement();
- if (!(element instanceof IProject))
- return;
- new NestedProjectCreator().createNestedProjects(new IProject[] {((IProject) element)}, getShell());
-
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- this.selection = selection;
- }
-
- /**
- * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- this.targetPart = targetPart;
- }
-
-}
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/ExcludeResourceAction.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/ExcludeResourceAction.java
deleted file mode 100644
index 2c5b855..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/ExcludeResourceAction.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.eclipse.ui.examples.filesystem;
-
-import java.net.URI;
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.resources.*;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.*;
-
-public class ExcludeResourceAction implements IObjectActionDelegate {
-
- private ISelection selection;
- private IWorkbenchPart targetPart;
-
- /**
- * Constructor for Action1.
- */
- public ExcludeResourceAction() {
- super();
- }
-
- private void exclude(IResource resource) {
- try {
- URI nullURI = new URI(EFS.SCHEME_NULL, null, "/", null, null);
- if (resource.getType() == IResource.FILE) {
- IFile link = (IFile) resource;
- link.createLink(nullURI, IResource.REPLACE | IResource.ALLOW_MISSING_LOCAL, null);
- } else {
- IFolder link = (IFolder) resource;
- link.createLink(nullURI, IResource.REPLACE | IResource.ALLOW_MISSING_LOCAL, null);
- }
- } catch (Exception e) {
- MessageDialog.openError(getShell(), "Error", "Error excluding resource");
- e.printStackTrace();
- }
- }
-
- private Shell getShell() {
- return targetPart.getSite().getShell();
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- if (!(selection instanceof IStructuredSelection))
- return;
- Object element = ((IStructuredSelection) selection).getFirstElement();
- if (!(element instanceof IResource))
- return;
- IResource resource = (IResource) element;
- if (resource.isLinked())
- return;
- exclude(resource);
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- this.selection = selection;
- }
-
- /**
- * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- this.targetPart = targetPart;
- }
-
-}
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/ExpandZipAction.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/ExpandZipAction.java
deleted file mode 100644
index d34e49c..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/ExpandZipAction.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.eclipse.ui.examples.filesystem;
-
-import java.net.URI;
-import org.eclipse.core.internal.filesystem.zip.ZipFileSystem;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.*;
-
-public class ExpandZipAction implements IObjectActionDelegate {
-
- private ISelection selection;
- private IWorkbenchPart targetPart;
-
- /**
- * Constructor for Action1.
- */
- public ExpandZipAction() {
- super();
- }
-
- private void expandZip(IFile file) {
- try {
- URI zipURI = new URI(ZipFileSystem.SCHEME_ZIP, null, "/", file.getLocationURI().toString(), null);
- IFolder link = file.getParent().getFolder(new Path(file.getName()));
- link.createLink(zipURI, IResource.REPLACE, null);
- } catch (Exception e) {
- MessageDialog.openError(getShell(), "Error", "Error opening zip file");
- e.printStackTrace();
- }
- }
-
- private Shell getShell() {
- return targetPart.getSite().getShell();
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- if (!(selection instanceof IStructuredSelection))
- return;
- Object element = ((IStructuredSelection) selection).getFirstElement();
- if (!(element instanceof IFile))
- return;
- expandZip((IFile) element);
-
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- this.selection = selection;
- }
-
- /**
- * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- this.targetPart = targetPart;
- }
-
-}
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/IncludeResourceAction.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/IncludeResourceAction.java
deleted file mode 100644
index f1a1342..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/IncludeResourceAction.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package org.eclipse.ui.examples.filesystem;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.*;
-
-public class IncludeResourceAction implements IObjectActionDelegate {
-
- private ISelection selection;
- private IWorkbenchPart targetPart;
-
- /**
- * Constructor for Action1.
- */
- public IncludeResourceAction() {
- super();
- }
-
- private Shell getShell() {
- return targetPart.getSite().getShell();
- }
-
- private void include(IResource resource) {
- try {
- resource.delete(IResource.NONE, null);
- resource.getParent().refreshLocal(IResource.DEPTH_INFINITE, null);
- } catch (Exception e) {
- MessageDialog.openError(getShell(), "Error", "Error including resource");
- e.printStackTrace();
- }
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- if (!(selection instanceof IStructuredSelection))
- return;
- Object element = ((IStructuredSelection) selection).getFirstElement();
- if (!(element instanceof IResource))
- return;
- IResource resource = (IResource) element;
- if (!resource.isLinked())
- return;
- include(resource);
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- this.selection = selection;
- }
-
- /**
- * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- this.targetPart = targetPart;
- }
-}
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/NestedProjectCreator.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/NestedProjectCreator.java
deleted file mode 100644
index ea3219e..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/NestedProjectCreator.java
+++ /dev/null
@@ -1,318 +0,0 @@
-package org.eclipse.ui.examples.filesystem;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import org.eclipse.core.filesystem.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.dialogs.ListSelectionDialog;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-/**
- * A utility class for locating uncreated projects that are physically
- * within the location of an existing project. The locator prompts the
- * user to ask which sub-projects they want to create, and then creates them.
- * @since 3.2
- */
-public class NestedProjectCreator {
- private IRunnableContext context = PlatformUI.getWorkbench().getProgressService();
- protected boolean excludeOverlap = true;
- protected final IWorkspace workspace = ResourcesPlugin.getWorkspace();
-
- /**
- * This is the main entry point for the project locator. This method performs
- * the search for nested projects, prompts the user to ask which ones they
- * want to create, and creates those that the user asked to create.
- * <p>
- * This method must be called from the UI thread.
- * </p>
- *
- * @param projects The projects to locate nested projects in
- * @param parentShell The shell for parenting dialogs
- */
- public void createNestedProjects(IProject[] projects, Shell parentShell) {
- try {
- doCreateNestedProjects(projects, parentShell);
- } catch (InvocationTargetException e) {
- final IStatus status = getStatus(e.getTargetException());
- Policy.log(status);
- ErrorDialog.openError(parentShell, null, null, status);
- } catch (InterruptedException e) {
- //just abort from cancelation
- }
- }
-
- /**
- * @throws InvocationTargetException
- * @throws InterruptedException
- */
- private void doCreateNestedProjects(final IProject[] projects, Shell shell) throws InvocationTargetException, InterruptedException {
- final Object[] result = new Object[1];
- context.run(true, true, new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) {
- result[0] = findNestedProjects(projects);
- }
- });
- if (result[0] == null)
- return;
- IProjectDescription[] rawDescriptions = (IProjectDescription[]) result[0];
- if (rawDescriptions.length == 0)
- return;
- final IProjectDescription[] finalDescriptions = promptForCreation(shell, rawDescriptions);
- if (finalDescriptions.length == 0)
- return;
- String message = "Should the folder corresponding to the created projects be excluded from the existing parent project?";
- excludeOverlap = MessageDialog.openQuestion(shell, "Exclude overlapping resources?", message);
- //create the projects
- final IWorkspaceRoot root = workspace.getRoot();
- context.run(true, true, new WorkspaceModifyOperation() {
- protected void execute(IProgressMonitor monitor) throws CoreException {
- try {
- monitor.beginTask("Creating Projects", finalDescriptions.length * 2);
- for (int i = 0; i < finalDescriptions.length; i++) {
- IProject project = root.getProject(finalDescriptions[i].getName());
- if (excludeOverlap)
- excludeOverlap(finalDescriptions[i]);
- project.create(finalDescriptions[i], new SubProgressMonitor(monitor, 1));
- project.open(new SubProgressMonitor(monitor, 1));
- }
- } finally {
- monitor.done();
- }
- }
- });
-
- }
-
- /**
- * The given project is about to be created. Exclude any corresponding
- * resources in an overlapping parent project.
- * @param project
- * @param description
- */
- protected void excludeOverlap(IProjectDescription description) throws CoreException {
- URI location = description.getLocationURI();
- if (location == null) {
- //default location for this project is below the root location
- URI rootLocation = workspace.getRoot().getLocationURI();
- location = EFS.getStore(rootLocation).getChild(description.getName()).toURI();
- }
- IContainer[] containers = workspace.getRoot().findContainersForLocationURI(location);
- URI nullURI;
- try {
- nullURI = new URI(EFS.SCHEME_NULL, null, "/", null, null); //$NON-NLS-1$
- } catch (URISyntaxException e) {
- Policy.log("Cannot exclude resource due to missing null file system", e); //$NON-NLS-1$
- //if this happens we cannot exclude the resource
- return;
- }
- for (int i = 0; i < containers.length; i++) {
- if (containers[i].getType() != IResource.FOLDER)
- continue;
- IFolder folder = (IFolder) containers[i];
- //don't replace links
- if (!folder.isLinked())
- folder.createLink(nullURI, IResource.REPLACE | IResource.ALLOW_MISSING_LOCAL, null);
- }
- }
-
- /**
- * Returns descriptions of projects physically nested within the
- * given projects that do not yet exist in the workspace. This method
- * does not create any projects.
- * <p>
- * This method does not need to be called in the UI thread.
- * </p>
- *
- * @param projects The projects to search in.
- * @return The descriptions of projects physically located within
- * the given project.
- */
- public IProjectDescription[] findNestedProjects(IProject[] projects) {
- final ArrayList descriptions = new ArrayList();
- for (int i = 0; i < projects.length; i++) {
- if (!projects[i].isAccessible())
- continue;
- try {
- projects[i].accept(new IResourceProxyVisitor() {
- /**
- * @param descriptions
- * @param description
- */
- private void addDescription(final ArrayList descriptions, IProjectDescription description) {
- IProject project = workspace.getRoot().getProject(description.getName());
- if (!project.exists())
- descriptions.add(description);
- }
-
- /**
- * This linked resource may be blocking resources in the project's
- * location from the workspace. Search for project descriptions
- * in the sub-tree of the project location corresponding to this resource.
- * @param link
- * @param descriptions
- */
- private void searchInLink(IResource link) {
- IProject project = link.getProject();
- if (project == null || !project.isAccessible())
- return;
- IFileStore projectStore;
- try {
- projectStore = EFS.getStore(project.getLocationURI());
- } catch (CoreException e) {
- //ignore projects in invalid locations
- return;
- }
- IFileStore linkStore = projectStore.getChild(link.getProjectRelativePath());
- searchInStore(linkStore);
-
- }
-
- /**
- * Searches for project description files within the given store,
- * and adds any found descriptions to the supplied list.
- * @param store
- * @param descriptions
- */
- private void searchInStore(IFileStore store) {
- try {
- if (store.getName().equals(IProjectDescription.DESCRIPTION_FILE_NAME)) {
- IFileInfo info = store.fetchInfo();
- if (!info.isDirectory()) {
- InputStream input = null;
- try {
- input = store.openInputStream(EFS.NONE, null);
- IProjectDescription description = workspace.loadProjectDescription(input);
- description.setLocationURI(store.getParent().toURI());
- addDescription(descriptions, description);
- } finally {
- safeClose(input);
- }
- return;
- }
- }
- //recurse on children
- IFileStore[] children = store.childStores(EFS.NONE, null);
- for (int j = 0; j < children.length; j++)
- searchInStore(children[j]);
- } catch (CoreException e) {
- //ignore if there are problems accessing the file system
- }
- }
-
- public boolean visit(IResourceProxy proxy) throws CoreException {
- if (proxy.getType() == IResource.FILE && proxy.getName().equals(IProjectDescription.DESCRIPTION_FILE_NAME)) {
- IFile file = (IFile) proxy.requestResource();
- final InputStream input = file.getContents();
- try {
- IProjectDescription description = workspace.loadProjectDescription(input);
- description.setLocationURI(file.getParent().getLocationURI());
- addDescription(descriptions, description);
- } catch (CoreException e) {
- //ignore this project
- } finally {
- safeClose(input);
- }
- } else if (proxy.isLinked()) {
- //search in the directory hidden by the link
- searchInLink(proxy.requestResource());
- return false;
- }
- return true;
- }
- }, IResource.NONE);
- } catch (CoreException e) {
- //if the project cannot be visited just ignore it
- }
- }
- return (IProjectDescription[]) descriptions.toArray(new IProjectDescription[descriptions.size()]);
- }
-
- /**
- * Returns a label provider that is capable of displaying project descriptions.
- * This provider just converts IProjectDescription->IProject, and then
- * uses the standard {@link WorkbenchLabelProvider}.
- */
- private ILabelProvider getProjectDescriptionLabelProvider() {
- return new LabelProvider() {
- private LabelProvider realProvider = new WorkbenchLabelProvider();
- private IWorkspaceRoot root = workspace.getRoot();
-
- public Image getImage(Object element) {
- return realProvider.getImage(getProject(element));
- }
-
- private Object getProject(Object element) {
- if (element instanceof IProjectDescription)
- return root.getProject(((IProjectDescription) element).getName());
- return null;
- }
-
- public String getText(Object element) {
- return realProvider.getText(getProject(element));
- }
- };
- }
-
- /**
- * Returns a status corresponding to the given throwable.
- */
- private IStatus getStatus(Throwable t) {
- if (t instanceof CoreException)
- return ((CoreException) t).getStatus();
- return new Status(IStatus.ERROR, Policy.PI_FILESYSTEM_EXAMPLE, 1, "Internal Error", t); //$NON-NLS-1$
- }
-
- /**
- * Given a set of project descriptions, prompt the user to ask if they want
- * to create them. Returns the project descriptions that the user asks to create.
- *
- * @param parentShell The shell to use when parenting dialogs
- * @param descriptions The descriptions that can be created
- * @return The descriptions that the user has selected for creation
- */
- public IProjectDescription[] promptForCreation(Shell parentShell, IProjectDescription[] descriptions) {
- String message = "The following projects were found. Select the projects to be created.";
- ListSelectionDialog dialog = new ListSelectionDialog(parentShell, descriptions, new ArrayContentProvider(), getProjectDescriptionLabelProvider(), message);
- dialog.open();
- Object[] result = dialog.getResult();
- IProjectDescription[] castedResult = new IProjectDescription[result.length];
- System.arraycopy(result, 0, castedResult, 0, result.length);
- return castedResult;
- }
-
- /**
- * @param input
- */
- protected void safeClose(InputStream input) {
- if (input == null)
- return;
- try {
- input.close();
- } catch (IOException e) {
- //ignore
- }
- }
-
- /**
- * Sets the runnable context that should be used to show progress during
- * any long running operations.
- * @param rc The context to use
- */
- public void setRunnableContext(IRunnableContext rc) {
- context = rc != null ? rc : PlatformUI.getWorkbench().getProgressService();
- }
-}
diff --git a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/Policy.java b/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/Policy.java
deleted file mode 100644
index 1f2fa27..0000000
--- a/platform-ui/plugins/org.eclipse.ui.examples.filesystem/src/org/eclipse/ui/examples/filesystem/Policy.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.examples.filesystem;
-
-import org.eclipse.core.runtime.*;
-import org.osgi.framework.Bundle;
-
-/**
- *
- */
-public class Policy {
- private static Bundle bundle;
- public static final String PI_FILESYSTEM_EXAMPLE = "org.eclipse.ui.examples.filesystem"; //$NON-NLS-1$
-
- private static Bundle getBundle() {
- if (bundle == null)
- bundle = Platform.getBundle(PI_FILESYSTEM_EXAMPLE);
- return bundle;
- }
-
- public static void log(IStatus status) {
- Platform.getLog(getBundle()).log(status);
- }
-
- public static void log(String message, IStatus status) {
- final ILog log = Platform.getLog(getBundle());
- log.log(new Status(status.getSeverity(), PI_FILESYSTEM_EXAMPLE, 1, message, null));
- log.log(status);
- }
-
- public static void log(String message, Throwable t) {
- final ILog log = Platform.getLog(getBundle());
- log.log(new Status(IStatus.ERROR, PI_FILESYSTEM_EXAMPLE, 1, message, t));
- }
-}