Merge remote-tracking branch 'upstream/master'

Conflicts:
	src/main/java/com/rometools/fetcher/impl/HttpClientFeedFetcher.java
This commit is contained in:
Jani Halinen 2014-05-30 00:07:01 +03:00
commit 50078f449e
28 changed files with 363 additions and 761 deletions

View file

@ -1,56 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="2">
<profile kind="CleanUpProfile" name="ROME" version="2">
<setting id="cleanup.remove_unused_private_fields" value="true"/>
<setting id="cleanup.always_use_parentheses_in_expressions" value="false"/>
<setting id="cleanup.never_use_blocks" value="false"/>
<setting id="cleanup.remove_unused_private_methods" value="true"/>
<setting id="cleanup.add_missing_deprecated_annotations" value="true"/>
<setting id="cleanup.convert_to_enhanced_for_loop" value="true"/>
<setting id="cleanup.remove_unnecessary_nls_tags" value="true"/>
<setting id="cleanup.sort_members" value="false"/>
<setting id="cleanup.remove_unused_local_variables" value="false"/>
<setting id="cleanup.never_use_parentheses_in_expressions" value="true"/>
<setting id="cleanup.remove_unused_private_members" value="false"/>
<setting id="cleanup.remove_unnecessary_casts" value="true"/>
<setting id="cleanup.make_parameters_final" value="true"/>
<setting id="cleanup.use_this_for_non_static_field_access" value="true"/>
<setting id="cleanup.remove_private_constructors" value="true"/>
<setting id="cleanup.use_blocks" value="true"/>
<setting id="cleanup.always_use_this_for_non_static_method_access" value="false"/>
<setting id="cleanup.remove_trailing_whitespaces_all" value="true"/>
<setting id="cleanup.always_use_this_for_non_static_field_access" value="false"/>
<setting id="cleanup.use_this_for_non_static_field_access_only_if_necessary" value="true"/>
<setting id="cleanup.add_default_serial_version_id" value="true"/>
<setting id="cleanup.make_type_abstract_if_missing_method" value="false"/>
<setting id="cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class" value="true"/>
<setting id="cleanup.make_variable_declarations_final" value="true"/>
<setting id="cleanup.add_missing_nls_tags" value="false"/>
<setting id="cleanup.format_source_code" value="true"/>
<setting id="cleanup.qualify_static_method_accesses_with_declaring_class" value="false"/>
<setting id="cleanup.add_missing_override_annotations" value="true"/>
<setting id="cleanup.remove_unused_private_types" value="true"/>
<setting id="cleanup.add_missing_methods" value="false"/>
<setting id="cleanup.make_local_variable_final" value="true"/>
<setting id="cleanup.correct_indentation" value="true"/>
<setting id="cleanup.add_missing_override_annotations_interface_methods" value="true"/>
<setting id="cleanup.remove_unused_imports" value="true"/>
<setting id="cleanup.remove_trailing_whitespaces_ignore_empty" value="false"/>
<setting id="cleanup.make_private_fields_final" value="true"/>
<setting id="cleanup.add_generated_serial_version_id" value="false"/>
<setting id="cleanup.organize_imports" value="true"/>
<setting id="cleanup.remove_trailing_whitespaces" value="true"/>
<setting id="cleanup.sort_members_all" value="false"/>
<setting id="cleanup.use_blocks_only_for_return_and_throw" value="false"/>
<setting id="cleanup.add_missing_annotations" value="true"/>
<setting id="cleanup.use_parentheses_in_expressions" value="true"/>
<setting id="cleanup.qualify_static_field_accesses_with_declaring_class" value="false"/>
<setting id="cleanup.use_this_for_non_static_method_access_only_if_necessary" value="true"/>
<setting id="cleanup.use_this_for_non_static_method_access" value="true"/>
<setting id="cleanup.qualify_static_member_accesses_through_instances_with_declaring_class" value="true"/>
<setting id="cleanup.add_serial_version_id" value="false"/>
<setting id="cleanup.format_source_code_changes_only" value="false"/>
<setting id="cleanup.qualify_static_member_accesses_with_declaring_class" value="true"/>
<setting id="cleanup.always_use_blocks" value="true"/>
</profile>
</profiles>

View file

@ -1,291 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="ROME" version="12">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
<setting id="org.eclipse.jdt.core.compiler.source" value="1.7"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="160"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.7"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.7"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
</profile>
</profiles>

154
pom.xml
View file

@ -4,202 +4,94 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.rometools</groupId> <groupId>com.rometools</groupId>
<artifactId>rome-parent</artifactId>
<version>1.5.0-SNAPSHOT</version>
</parent>
<artifactId>rome-fetcher</artifactId> <artifactId>rome-fetcher</artifactId>
<version>2.0.0-SNAPSHOT</version> <packaging>jar</packaging>
<name>rome-fetcher</name> <name>rome-fetcher</name>
<description>A well behaved feed fetcher API for ROME</description> <description>A well behaved feed fetcher API for ROME</description>
<inceptionYear>2004</inceptionYear>
<url>http://rometools.github.io/rome-fetcher/</url> <url>http://rometools.github.io/rome-fetcher/</url>
<organization>
<name>ROME Project</name>
<url>https://github.com/rometools/</url>
</organization>
<issueManagement>
<url>https://github.com/rometools/rome-fetcher/issues</url>
</issueManagement>
<scm> <scm>
<connection>scm:git:git@github.com:rometools/rome-fetcher.git</connection> <connection>scm:git:git@github.com:rometools/rome-fetcher.git</connection>
<developerConnection>scm:git:git@github.com:rometools/rome-fetcher.git</developerConnection> <developerConnection>scm:git:git@github.com:rometools/rome-fetcher.git</developerConnection>
<url>https://github.com/rometools/rome-fetcher/</url> <url>https://github.com/rometools/rome-fetcher/</url>
</scm> </scm>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers> <developers>
<developer>
<id>kebernet</id>
<name>Robert Cooper</name>
<email>kebernet@gmail.comM</email>
</developer>
<developer> <developer>
<name>Nick Lothian</name> <name>Nick Lothian</name>
<url>http://nicklothian.com</url> <url>http://nicklothian.com</url>
</developer> </developer>
<developer>
<name>Robert Cooper</name>
<email>kebernet@gmail.comM</email>
</developer>
</developers> </developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<distributionManagement>
<repository>
<id>central.staging</id>
<url>http://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
<snapshotRepository>
<id>sonatype.snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<repositories> <repositories>
<repository> <repository>
<id>sonatype.snapshots</id> <id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url> <url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository> </repository>
</repositories> </repositories>
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.3</version>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId> <artifactId>maven-scm-publish-plugin</artifactId>
<version>1.0-beta-2</version>
<configuration> <configuration>
<scmBranch>gh-pages</scmBranch> <scmBranch>gh-pages</scmBranch>
<pubScmUrl>scm:git:git@github.com:rometools/rome-fetcher.git</pubScmUrl> <pubScmUrl>${project.scm.developerConnection}</pubScmUrl>
<content>${project.build.directory}/site</content> <content>${project.build.directory}/site</content>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<reportSets>
<reportSet>
<reports>
<report>javadoc</report>
</reports>
</reportSet>
<reportSet>
<id>aggregate</id>
<inherited>false</inherited>
<reports>
<report>aggregate</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.rometools</groupId> <groupId>com.rometools</groupId>
<artifactId>rome</artifactId> <artifactId>rome</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-httpclient</groupId> <groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId> <artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<optional />
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
<optional />
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging-api</artifactId>
<version>1.1</version>
<optional /> <optional />
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId> <artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>jetty</groupId> <groupId>jetty</groupId>
<artifactId>jetty</artifactId> <artifactId>jetty</artifactId>
<version>4.2.12</version> <scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package org.rometools.fetcher; package com.rometools.fetcher;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
@ -25,11 +25,13 @@ import com.sun.syndication.io.FeedException;
public interface FeedFetcher { public interface FeedFetcher {
/** /**
* <p> * <p>
* The default user agent. It is not marked final so buggy java compiler will not write this string into all classes that reference it. * The default user agent. It is not marked final so buggy java compiler will not write this
* string into all classes that reference it.
* </p> * </p>
* *
* <p> * <p>
* http://tinyurl.com/64t5n points to https://rome.dev.java.net Some servers ban user agents with "Java" in the name. * http://tinyurl.com/64t5n points to https://rome.dev.java.net Some servers ban user agents
* with "Java" in the name.
* </p> * </p>
* *
*/ */
@ -51,7 +53,8 @@ public interface FeedFetcher {
* </p> * </p>
* *
* <p> * <p>
* See http://www.ietf.org/rfc/rfc3229.txt and http://bobwyman.pubsub.com/main/2004/09/using_rfc3229_w.html * See http://www.ietf.org/rfc/rfc3229.txt and
* http://bobwyman.pubsub.com/main/2004/09/using_rfc3229_w.html
* </p> * </p>
* *
* <p> * <p>
@ -77,7 +80,8 @@ public interface FeedFetcher {
* </p> * </p>
* *
* <p> * <p>
* The FetcherListener will receive an FetcherEvent when a Fetcher event (feed polled, retrieved, etc) occurs * The FetcherListener will receive an FetcherEvent when a Fetcher event (feed polled,
* retrieved, etc) occurs
* </p> * </p>
* *
* @param listener The FetcherListener to recieve the event * @param listener The FetcherListener to recieve the event
@ -108,8 +112,9 @@ public interface FeedFetcher {
public SyndFeed retrieveFeed(String userAgent, URL url) throws IllegalArgumentException, IOException, FeedException, FetcherException; public SyndFeed retrieveFeed(String userAgent, URL url) throws IllegalArgumentException, IOException, FeedException, FetcherException;
/** /**
* If set to true, the WireFeed will be made accessible from the SyndFeed object returned from the Fetcher via the originalWireFeed() method. Each Entry in * If set to true, the WireFeed will be made accessible from the SyndFeed object returned from
* the feed will have the corresponding wireEntry property set. * the Fetcher via the originalWireFeed() method. Each Entry in the feed will have the
* corresponding wireEntry property set.
*/ */
void setPreserveWireFeed(boolean preserveWireFeed); void setPreserveWireFeed(boolean preserveWireFeed);
} }

View file

@ -1,18 +1,19 @@
package org.rometools.fetcher; package com.rometools.fetcher;
import java.util.EventObject; import java.util.EventObject;
import com.sun.syndication.feed.synd.SyndFeed; import com.sun.syndication.feed.synd.SyndFeed;
/** /**
* Implementation note: FetcherEvent is not thread safe. Make sure that they are only ever accessed by one thread. If necessary, make all getters and setters * Implementation note: FetcherEvent is not thread safe. Make sure that they are only ever accessed
* synchronized, or alternatively make all fields final. * by one thread. If necessary, make all getters and setters synchronized, or alternatively make all
* fields final.
* *
* @author nl * @author nl
*/ */
public class FetcherEvent extends EventObject { public class FetcherEvent extends EventObject {
private static final long serialVersionUID = 3985600601904140103L; private static final long serialVersionUID = 1L;
public static final String EVENT_TYPE_FEED_POLLED = "FEED_POLLED"; public static final String EVENT_TYPE_FEED_POLLED = "FEED_POLLED";
public static final String EVENT_TYPE_FEED_RETRIEVED = "FEED_RETRIEVED"; public static final String EVENT_TYPE_FEED_RETRIEVED = "FEED_RETRIEVED";

View file

@ -14,14 +14,14 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package org.rometools.fetcher; package com.rometools.fetcher;
/** /**
* @author Nick Lothian * @author Nick Lothian
* *
*/ */
public class FetcherException extends Exception { public class FetcherException extends Exception {
private static final long serialVersionUID = -7479645796948092380L; private static final long serialVersionUID = 1L;
int responseCode; int responseCode;

View file

@ -1,4 +1,4 @@
package org.rometools.fetcher; package com.rometools.fetcher;
import java.util.EventListener; import java.util.EventListener;

View file

@ -15,25 +15,29 @@
* *
*/ */
package org.rometools.fetcher.impl; package com.rometools.fetcher.impl;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URLConnection; import java.net.URLConnection;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator;
import java.util.Properties; import java.util.Properties;
import java.util.Set; import java.util.Set;
import org.rometools.fetcher.FeedFetcher; import org.slf4j.Logger;
import org.rometools.fetcher.FetcherEvent; import org.slf4j.LoggerFactory;
import org.rometools.fetcher.FetcherException;
import org.rometools.fetcher.FetcherListener;
import com.rometools.fetcher.FeedFetcher;
import com.rometools.fetcher.FetcherEvent;
import com.rometools.fetcher.FetcherException;
import com.rometools.fetcher.FetcherListener;
import com.sun.syndication.feed.synd.SyndFeed; import com.sun.syndication.feed.synd.SyndFeed;
public abstract class AbstractFeedFetcher implements FeedFetcher { public abstract class AbstractFeedFetcher implements FeedFetcher {
private static final Logger LOG = LoggerFactory.getLogger(AbstractFeedFetcher.class);
private final Set<FetcherListener> fetcherEventListeners; private final Set<FetcherListener> fetcherEventListeners;
private String userAgent; private String userAgent;
private boolean usingDeltaEncoding; private boolean usingDeltaEncoding;
@ -55,11 +59,11 @@ public abstract class AbstractFeedFetcher implements FeedFetcher {
System.getProperties().putAll(props); System.getProperties().putAll(props);
inputStream.close(); inputStream.close();
} else { } else {
System.err.println("Could not find " + resourceName + " on classpath"); LOG.warn("Could not find {} on classpath", resourceName);
} }
} catch (final IOException e) { } catch (final IOException e) {
// do nothing - we don't want to fail just because we could not find the version // do nothing - we don't want to fail just because we could not find the version
System.err.println("Error reading " + resourceName + " from classpath: " + e.getMessage()); LOG.error("Error reading {} from classpath: {}", resourceName, e.getMessage());
} }
setUserAgent(DEFAULT_USER_AGENT + " Ver: " + System.getProperty("rome.fetcher.version", "UNKNOWN")); setUserAgent(DEFAULT_USER_AGENT + " Ver: " + System.getProperty("rome.fetcher.version", "UNKNOWN"));
@ -114,28 +118,19 @@ public abstract class AbstractFeedFetcher implements FeedFetcher {
protected void fireEvent(final String eventType, final String urlStr, final SyndFeed feed) { protected void fireEvent(final String eventType, final String urlStr, final SyndFeed feed) {
final FetcherEvent fetcherEvent = new FetcherEvent(this, urlStr, eventType, feed); final FetcherEvent fetcherEvent = new FetcherEvent(this, urlStr, eventType, feed);
synchronized (fetcherEventListeners) { synchronized (fetcherEventListeners) {
final Iterator<FetcherListener> iter = fetcherEventListeners.iterator(); for (final FetcherListener fetcherEventListener : fetcherEventListeners) {
while (iter.hasNext()) {
final FetcherListener fetcherEventListener = iter.next();
fetcherEventListener.fetcherEvent(fetcherEvent); fetcherEventListener.fetcherEvent(fetcherEvent);
} }
} }
} }
/**
* @see com.sun.syndication.fetcher.FeedFetcher#addFetcherEventListener(com.sun.syndication.fetcher.FetcherListener)
*/
@Override @Override
public void addFetcherEventListener(final FetcherListener listener) { public void addFetcherEventListener(final FetcherListener listener) {
if (listener != null) { if (listener != null) {
fetcherEventListeners.add(listener); fetcherEventListeners.add(listener);
} }
} }
/**
* @see com.sun.syndication.fetcher.FeedFetcher#removeFetcherEventListener(com.sun.syndication.fetcher.FetcherListener)
*/
@Override @Override
public void removeFetcherEventListener(final FetcherListener listener) { public void removeFetcherEventListener(final FetcherListener listener) {
if (listener != null) { if (listener != null) {
@ -194,7 +189,8 @@ public abstract class AbstractFeedFetcher implements FeedFetcher {
* </p> * </p>
* *
* <p> * <p>
* The returned feed will have the same data as the newFeed parameter, with the entries from originalFeed appended to the end of its entries. * The returned feed will have the same data as the newFeed parameter, with the entries from
* originalFeed appended to the end of its entries.
* </p> * </p>
* *
* @param originalFeed * @param originalFeed
@ -205,9 +201,7 @@ public abstract class AbstractFeedFetcher implements FeedFetcher {
SyndFeed result; SyndFeed result;
try { try {
result = (SyndFeed) newFeed.clone(); result = (SyndFeed) newFeed.clone();
result.getEntries().addAll(result.getEntries().size(), originalFeed.getEntries()); result.getEntries().addAll(result.getEntries().size(), originalFeed.getEntries());
return result; return result;
} catch (final CloneNotSupportedException e) { } catch (final CloneNotSupportedException e) {
final IllegalArgumentException iae = new IllegalArgumentException("Cannot clone feed"); final IllegalArgumentException iae = new IllegalArgumentException("Cannot clone feed");

View file

@ -1,18 +1,20 @@
package org.rometools.fetcher.impl; package com.rometools.fetcher.impl;
import java.beans.EventSetDescriptor; import java.beans.EventSetDescriptor;
import java.beans.SimpleBeanInfo; import java.beans.SimpleBeanInfo;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import org.rometools.fetcher.FetcherEvent; import com.rometools.fetcher.FetcherEvent;
import org.rometools.fetcher.FetcherListener; import com.rometools.fetcher.FetcherListener;
public class AbstractFeedFetcherBeanInfo extends SimpleBeanInfo { public class AbstractFeedFetcherBeanInfo extends SimpleBeanInfo {
@Override @Override
public EventSetDescriptor[] getEventSetDescriptors() { public EventSetDescriptor[] getEventSetDescriptors() {
try { try {
final Class<AbstractFeedFetcher> clz = AbstractFeedFetcher.class; // get the class object which we'll describe final Class<AbstractFeedFetcher> clz = AbstractFeedFetcher.class; // get the class
// object which we'll
// describe
final Method addMethod = clz.getMethod("addFetcherEventListener", new Class[] { FetcherListener.class }); final Method addMethod = clz.getMethod("addFetcherEventListener", new Class[] { FetcherListener.class });
final Method removeMethod = clz.getMethod("removeFetcherEventListener", new Class[] { FetcherListener.class }); final Method removeMethod = clz.getMethod("removeFetcherEventListener", new Class[] { FetcherListener.class });
final Method listenerMethod = FetcherListener.class.getMethod("fetcherEvent", new Class[] { FetcherEvent.class }); final Method listenerMethod = FetcherListener.class.getMethod("fetcherEvent", new Class[] { FetcherEvent.class });
@ -20,7 +22,8 @@ public class AbstractFeedFetcherBeanInfo extends SimpleBeanInfo {
final EventSetDescriptor[] results = new EventSetDescriptor[] { est }; final EventSetDescriptor[] results = new EventSetDescriptor[] { est };
return results; return results;
} catch (final Exception e) { } catch (final Exception e) {
// IntrospectionException, SecurityException and/or NoSuchMethodException can be thrown here // IntrospectionException, SecurityException and/or NoSuchMethodException can be thrown
// here
// the best we can do is to convert them to runtime exceptions // the best we can do is to convert them to runtime exceptions
throw new RuntimeException(e); throw new RuntimeException(e);
} }

View file

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.rometools.fetcher.impl; package com.rometools.fetcher.impl;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
@ -121,27 +121,28 @@ public class DiskFeedInfoCache implements FeedFetcherCache {
@Override @Override
public SyndFeedInfo remove(final URL url) { public SyndFeedInfo remove(final URL url) {
SyndFeedInfo info = null; SyndFeedInfo info = null;
final String fileName = cachePath + File.separator + "feed_" + replaceNonAlphanumeric(url.toString(), '_').trim(); final String fileName = cachePath + File.separator + "feed_" + replaceNonAlphanumeric(url.toString(), '_').trim();
FileInputStream fis = null; FileInputStream fis = null;
ObjectInputStream ois = null; ObjectInputStream ois = null;
boolean consumed = false;
try { try {
fis = new FileInputStream(fileName); fis = new FileInputStream(fileName);
ois = new ObjectInputStream(fis); ois = new ObjectInputStream(fis);
info = (SyndFeedInfo) ois.readObject(); info = (SyndFeedInfo) ois.readObject();
consumed = true;
final File file = new File(fileName); } catch (final FileNotFoundException e) {
if (file.exists()) {
file.delete();
}
} catch (final FileNotFoundException fnfe) {
// That's OK, we'l return null // That's OK, we'l return null
} catch (final ClassNotFoundException cnfe) { } catch (final ClassNotFoundException e) {
// Error writing to cahce is fatal // Error writing to cache is fatal
throw new RuntimeException("Attempting to read from cache", cnfe); throw new RuntimeException("Attempting to read from cache", e);
} catch (final IOException fnfe) { } catch (final IOException e) {
// Error writing to cahce is fatal // Error writing to cache is fatal
throw new RuntimeException("Attempting to read from cache", fnfe); throw new RuntimeException("Attempting to read from cache", e);
} finally { } finally {
if (fis != null) { if (fis != null) {
try { try {
@ -155,7 +156,15 @@ public class DiskFeedInfoCache implements FeedFetcherCache {
} catch (final IOException e) { } catch (final IOException e) {
} }
} }
if (consumed) {
final File file = new File(fileName);
if (file.exists()) {
file.delete();
} }
}
}
return info; return info;
} }
} }

View file

@ -14,14 +14,14 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package org.rometools.fetcher.impl; package com.rometools.fetcher.impl;
import java.net.URL; import java.net.URL;
/** /**
* <p> * <p>
* An interface to allow caching of feed details. Implementing this allows the {@link org.rometools.fetcher.io.HttpURLFeedFetcher} class to enable conditional * An interface to allow caching of feed details. Implementing this allows the
* gets * {@link com.rometools.fetcher.io.HttpURLFeedFetcher} class to enable conditional gets
* </p> * </p>
* *
* @author Nick Lothian * @author Nick Lothian

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package org.rometools.fetcher.impl; package com.rometools.fetcher.impl;
import java.io.Serializable; import java.io.Serializable;
import java.net.URL; import java.net.URL;
@ -24,19 +24,21 @@ import java.util.Map;
/** /**
* <p> * <p>
* A very simple implementation of the {@link org.rometools.fetcher.impl.FeedFetcherCache} interface. * A very simple implementation of the {@link com.rometools.fetcher.impl.FeedFetcherCache}
* interface.
* </p> * </p>
* *
* <p> * <p>
* This implementation uses a HashMap to cache retrieved feeds. This implementation is most suitible for sort term (client aggregator?) use, as the memory usage * This implementation uses a HashMap to cache retrieved feeds. This implementation is most suitible
* will increase over time as the number of feeds in the cache increases. * for sort term (client aggregator?) use, as the memory usage will increase over time as the number
* of feeds in the cache increases.
* </p> * </p>
* *
* @author Nick Lothian * @author Nick Lothian
* *
*/ */
public class HashMapFeedInfoCache implements FeedFetcherCache, Serializable { public class HashMapFeedInfoCache implements FeedFetcherCache, Serializable {
private static final long serialVersionUID = -1594665619950916222L; private static final long serialVersionUID = 1L;
static HashMapFeedInfoCache _instance; static HashMapFeedInfoCache _instance;
@ -48,7 +50,8 @@ public class HashMapFeedInfoCache implements FeedFetcherCache, Serializable {
* </p> * </p>
* *
* <p> * <p>
* Only use this if you want multiple instances of the cache. Usually getInstance() is more appropriate. * Only use this if you want multiple instances of the cache. Usually getInstance() is more
* appropriate.
* </p> * </p>
* *
*/ */
@ -101,7 +104,8 @@ public class HashMapFeedInfoCache implements FeedFetcherCache, Serializable {
} }
/** /**
* The API of this class indicates that map must thread safe. In other words, be sure to wrap it in a synchronized map unless you know what you are doing. * The API of this class indicates that map must thread safe. In other words, be sure to wrap it
* in a synchronized map unless you know what you are doing.
* *
* @param map the map to use as the info cache. * @param map the map to use as the info cache.
*/ */

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package org.rometools.fetcher.impl; package com.rometools.fetcher.impl;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
@ -29,12 +29,13 @@ import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpMethod; import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.HttpMethodRetryHandler; import org.apache.commons.httpclient.HttpMethodRetryHandler;
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.params.HttpClientParams; import org.apache.commons.httpclient.params.HttpClientParams;
import org.apache.commons.httpclient.params.HttpMethodParams; import org.apache.commons.httpclient.params.HttpMethodParams;
import org.rometools.fetcher.FetcherEvent;
import org.rometools.fetcher.FetcherException;
import com.rometools.fetcher.FetcherEvent;
import com.rometools.fetcher.FetcherException;
import com.sun.syndication.feed.synd.SyndFeed; import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.io.FeedException; import com.sun.syndication.io.FeedException;
import com.sun.syndication.io.SyndFeedInput; import com.sun.syndication.io.SyndFeedInput;
@ -75,8 +76,9 @@ public class HttpClientFeedFetcher extends AbstractFeedFetcher {
} }
/** /**
* @param timeout Sets the connect timeout for the HttpClient but using the URLConnection method name. Uses the HttpClientParams method * @param timeout Sets the connect timeout for the HttpClient but using the URLConnection method
* setConnectionManagerTimeout instead of setConnectTimeout * name. Uses the HttpClientParams method setConnectionManagerTimeout instead of
* setConnectTimeout
* *
*/ */
public synchronized void setConnectTimeout(final int timeout) { public synchronized void setConnectTimeout(final int timeout) {
@ -84,8 +86,9 @@ public class HttpClientFeedFetcher extends AbstractFeedFetcher {
} }
/** /**
* @return The currently used connect timeout for the HttpClient but using the URLConnection method name. Uses the HttpClientParams method * @return The currently used connect timeout for the HttpClient but using the URLConnection
* getConnectionManagerTimeout instead of getConnectTimeout * method name. Uses the HttpClientParams method getConnectionManagerTimeout instead of
* getConnectTimeout
* *
*/ */
public int getConnectTimeout() { public int getConnectTimeout() {
@ -143,14 +146,16 @@ public class HttpClientFeedFetcher extends AbstractFeedFetcher {
} }
/** /**
* @return The currently used read timeout for the URLConnection, 0 is unlimited, i.e. no timeout * @return The currently used read timeout for the URLConnection, 0 is unlimited, i.e. no
* timeout
*/ */
public synchronized void setReadTimeout(final int timeout) { public synchronized void setReadTimeout(final int timeout) {
httpClientParams.setSoTimeout(timeout); httpClientParams.setSoTimeout(timeout);
} }
/** /**
* @return timeout the read timeout for the URLConnection to a specified timeout, in milliseconds. * @return timeout the read timeout for the URLConnection to a specified timeout, in
* milliseconds.
*/ */
public int getReadTimeout() { public int getReadTimeout() {
return getHttpClientParams().getSoTimeout(); return getHttpClientParams().getSoTimeout();
@ -162,27 +167,28 @@ public class HttpClientFeedFetcher extends AbstractFeedFetcher {
} }
/** /**
* @see org.rometools.fetcher.FeedFetcher#retrieveFeed(java.net.URL) * @see com.rometools.fetcher.FeedFetcher#retrieveFeed(java.net.URL)
*/ */
@Override @Override
public SyndFeed retrieveFeed(final String userAgent, final URL feedUrl) throws IllegalArgumentException, IOException, FeedException, FetcherException { public SyndFeed retrieveFeed(final String userAgent, final URL feedUrl) throws IllegalArgumentException, IOException, FeedException, FetcherException {
if (feedUrl == null) { if (feedUrl == null) {
throw new IllegalArgumentException("null is not a valid URL"); throw new IllegalArgumentException("null is not a valid URL");
} }
// TODO Fix this
// System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
final HttpClient client = new HttpClient(httpClientParams); final HttpClient client = new HttpClient(httpClientParams);
if (getCredentialSupplier() != null) { if (getCredentialSupplier() != null) {
client.getState().setAuthenticationPreemptive(true);
// TODO what should realm be here? client.getParams().setAuthenticationPreemptive(true);
final Credentials credentials = getCredentialSupplier().getCredentials(null, feedUrl.getHost());
final String host = feedUrl.getHost();
final Credentials credentials = getCredentialSupplier().getCredentials(null, host);
if (credentials != null) { if (credentials != null) {
client.getState().setCredentials(null, feedUrl.getHost(), credentials); final AuthScope authScope = new AuthScope(host, -1);
client.getState().setCredentials(authScope, credentials);
} }
} }
System.setProperty("httpclient.useragent", userAgent); System.setProperty("httpclient.useragent", userAgent);
@ -238,7 +244,6 @@ public class HttpClientFeedFetcher extends AbstractFeedFetcher {
return feed; return feed;
} finally { } finally {
method.releaseConnection(); method.releaseConnection();
method.recycle();
} }
} else { } else {
// cache is not in use // cache is not in use
@ -250,16 +255,15 @@ public class HttpClientFeedFetcher extends AbstractFeedFetcher {
return getFeed(null, urlStr, method, statusCode); return getFeed(null, urlStr, method, statusCode);
} finally { } finally {
method.releaseConnection(); method.releaseConnection();
method.recycle();
} }
} }
} }
private SyndFeed getFeed(final SyndFeedInfo syndFeedInfo, final String urlStr, final HttpMethod method, final int statusCode) throws IOException, private SyndFeed getFeed(final SyndFeedInfo syndFeedInfo, final String urlStr, final HttpMethod method, final int statusCode) throws IOException,
HttpException, FetcherException, FeedException { HttpException, FetcherException, FeedException {
if (statusCode == HttpURLConnection.HTTP_NOT_MODIFIED && syndFeedInfo != null) { if (statusCode == HttpURLConnection.HTTP_NOT_MODIFIED && syndFeedInfo != null) {
fireEvent(FetcherEvent.EVENT_TYPE_FEED_UNCHANGED, urlStr); fireEvent(FetcherEvent.EVENT_TYPE_FEED_UNCHANGED, urlStr);
return syndFeedInfo.getSyndFeed(); return syndFeedInfo.getSyndFeed();
} }
@ -279,6 +283,7 @@ public class HttpClientFeedFetcher extends AbstractFeedFetcher {
*/ */
private SyndFeedInfo buildSyndFeedInfo(final URL feedUrl, final String urlStr, final HttpMethod method, SyndFeed feed, final int statusCode) private SyndFeedInfo buildSyndFeedInfo(final URL feedUrl, final String urlStr, final HttpMethod method, SyndFeed feed, final int statusCode)
throws MalformedURLException { throws MalformedURLException {
SyndFeedInfo syndFeedInfo; SyndFeedInfo syndFeedInfo;
syndFeedInfo = new SyndFeedInfo(); syndFeedInfo = new SyndFeedInfo();
@ -292,7 +297,8 @@ public class HttpClientFeedFetcher extends AbstractFeedFetcher {
final FeedFetcherCache cache = getFeedInfoCache(); final FeedFetcherCache cache = getFeedInfoCache();
if (cache != null && statusCode == 226) { if (cache != null && statusCode == 226) {
// client is setup to use http delta encoding and the server supports it and has returned a delta encoded response // client is setup to use http delta encoding and the server supports it and has
// returned a delta encoded response
// This response only includes new items // This response only includes new items
final SyndFeedInfo cachedInfo = cache.getFeedInfo(feedUrl); final SyndFeedInfo cachedInfo = cache.getFeedInfo(feedUrl);
@ -333,6 +339,7 @@ public class HttpClientFeedFetcher extends AbstractFeedFetcher {
* @throws FeedException * @throws FeedException
*/ */
private SyndFeed retrieveFeed(final String urlStr, final HttpMethod method) throws IOException, HttpException, FetcherException, FeedException { private SyndFeed retrieveFeed(final String urlStr, final HttpMethod method) throws IOException, HttpException, FetcherException, FeedException {
InputStream stream = null; InputStream stream = null;
if (method.getResponseHeader("Content-Encoding") != null && "gzip".equalsIgnoreCase(method.getResponseHeader("Content-Encoding").getValue())) { if (method.getResponseHeader("Content-Encoding") != null && "gzip".equalsIgnoreCase(method.getResponseHeader("Content-Encoding").getValue())) {
@ -367,11 +374,13 @@ public class HttpClientFeedFetcher extends AbstractFeedFetcher {
public interface HttpClientMethodCallbackIntf { public interface HttpClientMethodCallbackIntf {
/** /**
* Allows access to the underlying HttpClient HttpMethod object. Note that in most cases, method.setRequestHeader(String, String) is what you want to do * Allows access to the underlying HttpClient HttpMethod object. Note that in most cases,
* (rather than method.addRequestHeader(String, String)) * method.setRequestHeader(String, String) is what you want to do (rather than
* method.addRequestHeader(String, String))
* *
* @param method * @param method
*/ */
public void afterHttpClientMethodCreate(HttpMethod method); public void afterHttpClientMethodCreate(HttpMethod method);
} }
} }

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package org.rometools.fetcher.impl; package com.rometools.fetcher.impl;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
import java.io.IOException; import java.io.IOException;
@ -24,9 +24,8 @@ import java.net.URL;
import java.net.URLConnection; import java.net.URLConnection;
import java.util.zip.GZIPInputStream; import java.util.zip.GZIPInputStream;
import org.rometools.fetcher.FetcherEvent; import com.rometools.fetcher.FetcherEvent;
import org.rometools.fetcher.FetcherException; import com.rometools.fetcher.FetcherException;
import com.sun.syndication.feed.synd.SyndFeed; import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.io.FeedException; import com.sun.syndication.io.FeedException;
import com.sun.syndication.io.SyndFeedInput; import com.sun.syndication.io.SyndFeedInput;
@ -38,11 +37,13 @@ import com.sun.syndication.io.XmlReader;
* </p> * </p>
* *
* <p> * <p>
* If passed a {@link org.rometools.fetcher.impl.FeedFetcherCache} in the constructor it will use conditional gets to only retrieve modified content. * If passed a {@link com.rometools.fetcher.impl.FeedFetcherCache} in the constructor it will use
* conditional gets to only retrieve modified content.
* </p> * </p>
* *
* <p> * <p>
* The class uses the Accept-Encoding: gzip header to retrieve gzipped feeds where supported by the server. * The class uses the Accept-Encoding: gzip header to retrieve gzipped feeds where supported by the
* server.
* </p> * </p>
* *
* <p> * <p>
@ -63,7 +64,8 @@ import com.sun.syndication.io.XmlReader;
* href="http://fishbowl.pastiche.org/2002/10/21/http_conditional_get_for_rss_hackers">http://fishbowl.pastiche.org/2002/10/21/http_conditional_get_for_rss_hackers</a> * href="http://fishbowl.pastiche.org/2002/10/21/http_conditional_get_for_rss_hackers">http://fishbowl.pastiche.org/2002/10/21/http_conditional_get_for_rss_hackers</a>
* @see <a * @see <a
* href="http://diveintomark.org/archives/2003/07/21/atom_aggregator_behavior_http_level">http://diveintomark.org/archives/2003/07/21/atom_aggregator_behavior_http_level</a> * href="http://diveintomark.org/archives/2003/07/21/atom_aggregator_behavior_http_level">http://diveintomark.org/archives/2003/07/21/atom_aggregator_behavior_http_level</a>
* @see <a href="http://bobwyman.pubsub.com/main/2004/09/using_rfc3229_w.html">http://bobwyman.pubsub.com/main/2004/09/using_rfc3229_w.html</a> * @see <a
* href="http://bobwyman.pubsub.com/main/2004/09/using_rfc3229_w.html">http://bobwyman.pubsub.com/main/2004/09/using_rfc3229_w.html</a>
* @author Nick Lothian * @author Nick Lothian
*/ */
public class HttpURLFeedFetcher extends AbstractFeedFetcher { public class HttpURLFeedFetcher extends AbstractFeedFetcher {
@ -121,7 +123,8 @@ public class HttpURLFeedFetcher extends AbstractFeedFetcher {
if (connectTimeout >= 0) { if (connectTimeout >= 0) {
httpConnection.setConnectTimeout(connectTimeout); httpConnection.setConnectTimeout(connectTimeout);
} }
// httpConnection.setInstanceFollowRedirects(true); // this is true by default, but can be changed on a claswide basis // httpConnection.setInstanceFollowRedirects(true); // this is true by default, but can be
// changed on a claswide basis
final FeedFetcherCache cache = getFeedInfoCache(); final FeedFetcherCache cache = getFeedInfoCache();
if (cache != null) { if (cache != null) {
@ -217,7 +220,8 @@ public class HttpURLFeedFetcher extends AbstractFeedFetcher {
if (isUsingDeltaEncoding() && imHeader != null && imHeader.indexOf("feed") >= 0) { if (isUsingDeltaEncoding() && imHeader != null && imHeader.indexOf("feed") >= 0) {
final FeedFetcherCache cache = getFeedInfoCache(); final FeedFetcherCache cache = getFeedInfoCache();
if (cache != null && connection.getResponseCode() == 226) { if (cache != null && connection.getResponseCode() == 226) {
// client is setup to use http delta encoding and the server supports it and has returned a delta encoded response // client is setup to use http delta encoding and the server supports it and has
// returned a delta encoded response
// This response only includes new items // This response only includes new items
final SyndFeedInfo cachedInfo = cache.getFeedInfo(orignalUrl); final SyndFeedInfo cachedInfo = cache.getFeedInfo(orignalUrl);
if (cachedInfo != null) { if (cachedInfo != null) {
@ -278,7 +282,8 @@ public class HttpURLFeedFetcher extends AbstractFeedFetcher {
is = new BufferedInputStream(inputStream); is = new BufferedInputStream(inputStream);
} }
// InputStreamReader reader = new InputStreamReader(is, ResponseHandler.getCharacterEncoding(connection)); // InputStreamReader reader = new InputStreamReader(is,
// ResponseHandler.getCharacterEncoding(connection));
// SyndFeedInput input = new SyndFeedInput(); // SyndFeedInput input = new SyndFeedInput();

View file

@ -1,4 +1,4 @@
package org.rometools.fetcher.impl; package com.rometools.fetcher.impl;
import java.util.Collections; import java.util.Collections;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
@ -6,7 +6,7 @@ import java.util.Map;
/** /**
* <p> * <p>
* An implementation of the {@link org.rometools.fetcher.impl.FeedFetcherCache} interface. * An implementation of the {@link com.rometools.fetcher.impl.FeedFetcherCache} interface.
* </p> * </p>
* *
* <p> * <p>
@ -21,7 +21,7 @@ public class LinkedHashMapFeedInfoCache extends HashMapFeedInfoCache {
private final class CacheImpl extends LinkedHashMap<String, SyndFeedInfo> { private final class CacheImpl extends LinkedHashMap<String, SyndFeedInfo> {
private static final long serialVersionUID = -6977191330127794920L; private static final long serialVersionUID = 1L;
public CacheImpl() { public CacheImpl() {
super(16, 0.75F, true); super(16, 0.75F, true);
@ -35,7 +35,7 @@ public class LinkedHashMapFeedInfoCache extends HashMapFeedInfoCache {
} }
private static final int DEFAULT_MAX_ENTRIES = 20; private static final int DEFAULT_MAX_ENTRIES = 20;
private static final long serialVersionUID = 1694228973357997417L; private static final long serialVersionUID = 1L;
private static final LinkedHashMapFeedInfoCache _instance = new LinkedHashMapFeedInfoCache(); private static final LinkedHashMapFeedInfoCache _instance = new LinkedHashMapFeedInfoCache();
private int maxEntries = DEFAULT_MAX_ENTRIES; private int maxEntries = DEFAULT_MAX_ENTRIES;
@ -55,7 +55,8 @@ public class LinkedHashMapFeedInfoCache extends HashMapFeedInfoCache {
* </p> * </p>
* *
* <p> * <p>
* Only use this if you want multiple instances of the cache. Usually {@link #getInstance()} is more appropriate. * Only use this if you want multiple instances of the cache. Usually {@link #getInstance()} is
* more appropriate.
* </p> * </p>
* *
* @see #getInstance() * @see #getInstance()

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package org.rometools.fetcher.impl; package com.rometools.fetcher.impl;
import java.net.URLConnection; import java.net.URLConnection;
import java.util.regex.Matcher; import java.util.regex.Matcher;
@ -36,10 +36,12 @@ public class ResponseHandler {
/** /**
* *
* <p> * <p>
* Gets the character encoding of a response. (Note that this is different to the content-encoding) * Gets the character encoding of a response. (Note that this is different to the
* content-encoding)
* </p> * </p>
* *
* @param contentTypeHeader the value of the content-type HTTP header eg: text/html; charset=ISO-8859-4 * @param contentTypeHeader the value of the content-type HTTP header eg: text/html;
* charset=ISO-8859-4
* @return the character encoding, eg: ISO-8859-4 * @return the character encoding, eg: ISO-8859-4
*/ */
public static String getCharacterEncoding(final String contentTypeHeader) { public static String getCharacterEncoding(final String contentTypeHeader) {

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package org.rometools.fetcher.impl; package com.rometools.fetcher.impl;
import java.io.Serializable; import java.io.Serializable;
import java.net.URL; import java.net.URL;
@ -24,7 +24,8 @@ import com.sun.syndication.feed.synd.SyndFeed;
/** /**
* <p> * <p>
* A class to represent a {@link com.sun.syndication.feed.synd.SyndFeed} and some useful information about it. * A class to represent a {@link com.sun.syndication.feed.synd.SyndFeed} and some useful information
* about it.
* </p> * </p>
* *
* <p> * <p>
@ -34,7 +35,7 @@ import com.sun.syndication.feed.synd.SyndFeed;
* @author Nick Lothian * @author Nick Lothian
*/ */
public class SyndFeedInfo implements Cloneable, Serializable { public class SyndFeedInfo implements Cloneable, Serializable {
private static final long serialVersionUID = -1874786860901426015L; private static final long serialVersionUID = 1L;
private final ObjectBean _objBean; private final ObjectBean _objBean;
private String id; private String id;
@ -61,7 +62,8 @@ public class SyndFeedInfo implements Cloneable, Serializable {
} }
/** /**
* Indicates whether some other object is "equal to" this one as defined by the Object equals() method. * Indicates whether some other object is "equal to" this one as defined by the Object equals()
* method.
* <p> * <p>
* *
* @param other he reference object with which to compare. * @param other he reference object with which to compare.
@ -148,7 +150,8 @@ public class SyndFeedInfo implements Cloneable, Serializable {
} }
/** /**
* @param string A unique ID to identify the feed. Note that if the URL of the feed changes this will remain the same * @param string A unique ID to identify the feed. Note that if the URL of the feed changes this
* will remain the same
*/ */
public synchronized void setId(final String string) { public synchronized void setId(final String string) {
id = string; id = string;

View file

@ -14,18 +14,17 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package org.rometools.fetcher.samples; package com.rometools.fetcher.samples;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.net.URL; import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.rometools.fetcher.FeedFetcher; import com.rometools.fetcher.FeedFetcher;
import org.rometools.fetcher.impl.FeedFetcherCache; import com.rometools.fetcher.impl.FeedFetcherCache;
import org.rometools.fetcher.impl.HashMapFeedInfoCache; import com.rometools.fetcher.impl.HashMapFeedInfoCache;
import org.rometools.fetcher.impl.HttpURLFeedFetcher; import com.rometools.fetcher.impl.HttpURLFeedFetcher;
import com.sun.syndication.feed.synd.SyndEntry; import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndFeed; import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.feed.synd.SyndFeedImpl; import com.sun.syndication.feed.synd.SyndFeedImpl;
@ -33,7 +32,8 @@ import com.sun.syndication.io.SyndFeedOutput;
/** /**
* <p> * <p>
* It aggregates a list of RSS/Atom feeds (they can be of different types) into a single feed of the specified type. * It aggregates a list of RSS/Atom feeds (they can be of different types) into a single feed of the
* specified type.
* </p> * </p>
* *
* <p> * <p>

View file

@ -15,17 +15,16 @@
* *
*/ */
package org.rometools.fetcher.samples; package com.rometools.fetcher.samples;
import java.net.URL; import java.net.URL;
import org.rometools.fetcher.FeedFetcher; import com.rometools.fetcher.FeedFetcher;
import org.rometools.fetcher.FetcherEvent; import com.rometools.fetcher.FetcherEvent;
import org.rometools.fetcher.FetcherListener; import com.rometools.fetcher.FetcherListener;
import org.rometools.fetcher.impl.FeedFetcherCache; import com.rometools.fetcher.impl.FeedFetcherCache;
import org.rometools.fetcher.impl.HashMapFeedInfoCache; import com.rometools.fetcher.impl.HashMapFeedInfoCache;
import org.rometools.fetcher.impl.HttpURLFeedFetcher; import com.rometools.fetcher.impl.HttpURLFeedFetcher;
import com.sun.syndication.feed.synd.SyndFeed; import com.sun.syndication.feed.synd.SyndFeed;
/** /**

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package org.rometools.test; package com.rometools.test;
import java.net.URL; import java.net.URL;
@ -29,13 +29,15 @@ import org.mortbay.http.SocketListener;
import org.mortbay.http.UserRealm; import org.mortbay.http.UserRealm;
import org.mortbay.http.handler.SecurityHandler; import org.mortbay.http.handler.SecurityHandler;
import org.mortbay.jetty.servlet.ServletHandler; import org.mortbay.jetty.servlet.ServletHandler;
import org.rometools.fetcher.FeedFetcher; import org.slf4j.Logger;
import org.rometools.fetcher.FetcherEvent; import org.slf4j.LoggerFactory;
import org.rometools.fetcher.FetcherException;
import org.rometools.fetcher.FetcherListener;
import org.rometools.fetcher.impl.FeedFetcherCache;
import org.rometools.fetcher.impl.HashMapFeedInfoCache;
import com.rometools.fetcher.FeedFetcher;
import com.rometools.fetcher.FetcherEvent;
import com.rometools.fetcher.FetcherException;
import com.rometools.fetcher.FetcherListener;
import com.rometools.fetcher.impl.FeedFetcherCache;
import com.rometools.fetcher.impl.HashMapFeedInfoCache;
import com.sun.syndication.feed.atom.Entry; import com.sun.syndication.feed.atom.Entry;
import com.sun.syndication.feed.synd.SyndEntry; import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndFeed; import com.sun.syndication.feed.synd.SyndFeed;
@ -45,6 +47,8 @@ import com.sun.syndication.feed.synd.SyndFeed;
*/ */
public abstract class AbstractJettyTest extends TestCase { public abstract class AbstractJettyTest extends TestCase {
private static final Logger LOG = LoggerFactory.getLogger(AbstractJettyTest.class);
private HttpServer server; private HttpServer server;
private final int testPort = 8283; private final int testPort = 8283;
@ -84,6 +88,7 @@ public abstract class AbstractJettyTest extends TestCase {
* @throws InterruptedException * @throws InterruptedException
*/ */
private void setupServer() throws InterruptedException { private void setupServer() throws InterruptedException {
// Create the server // Create the server
if (server != null) { if (server != null) {
server.stop(); server.stop();
@ -102,8 +107,8 @@ public abstract class AbstractJettyTest extends TestCase {
*/ */
private ServletHandler createServletHandler() { private ServletHandler createServletHandler() {
final ServletHandler servlets = new ServletHandler(); final ServletHandler servlets = new ServletHandler();
servlets.addServlet("FetcherTestServlet", FetcherTestServlet.SERVLET_MAPPING, "org.rometools.test.FetcherTestServlet"); servlets.addServlet("FetcherTestServlet", FetcherTestServlet.SERVLET_MAPPING, "com.rometools.test.FetcherTestServlet");
servlets.addServlet("FetcherTestServlet", FetcherTestServlet.SERVLET_MAPPING2, "org.rometools.test.FetcherTestServlet"); servlets.addServlet("FetcherTestServlet", FetcherTestServlet.SERVLET_MAPPING2, "com.rometools.test.FetcherTestServlet");
return servlets; return servlets;
} }
@ -146,13 +151,13 @@ public abstract class AbstractJettyTest extends TestCase {
public void fetcherEvent(final FetcherEvent event) { public void fetcherEvent(final FetcherEvent event) {
final String eventType = event.getEventType(); final String eventType = event.getEventType();
if (FetcherEvent.EVENT_TYPE_FEED_POLLED.equals(eventType)) { if (FetcherEvent.EVENT_TYPE_FEED_POLLED.equals(eventType)) {
System.err.println("\tEVENT: Feed Polled. URL = " + event.getUrlString()); LOG.debug("\tEVENT: Feed Polled. URL = " + event.getUrlString());
polled = true; polled = true;
} else if (FetcherEvent.EVENT_TYPE_FEED_RETRIEVED.equals(eventType)) { } else if (FetcherEvent.EVENT_TYPE_FEED_RETRIEVED.equals(eventType)) {
System.err.println("\tEVENT: Feed Retrieved. URL = " + event.getUrlString()); LOG.debug("\tEVENT: Feed Retrieved. URL = " + event.getUrlString());
retrieved = true; retrieved = true;
} else if (FetcherEvent.EVENT_TYPE_FEED_UNCHANGED.equals(eventType)) { } else if (FetcherEvent.EVENT_TYPE_FEED_UNCHANGED.equals(eventType)) {
System.err.println("\tEVENT: Feed Unchanged. URL = " + event.getUrlString()); LOG.debug("\tEVENT: Feed Unchanged. URL = " + event.getUrlString());
unchanged = true; unchanged = true;
} }
} }
@ -260,8 +265,8 @@ public abstract class AbstractJettyTest extends TestCase {
public void testUserAgent() { public void testUserAgent() {
final FeedFetcher feedFetcher = getFeedFetcher(); final FeedFetcher feedFetcher = getFeedFetcher();
// System.out.println(feedFetcher.getUserAgent()); // LOG.debug(feedFetcher.getUserAgent());
// System.out.println(System.getProperty("rome.fetcher.version", "UNKNOWN")); // LOG.debug(System.getProperty("rome.fetcher.version", "UNKNOWN"));
assertEquals("Rome Client (http://tinyurl.com/64t5n) Ver: " + System.getProperty("rome.fetcher.version", "UNKNOWN"), feedFetcher.getUserAgent()); assertEquals("Rome Client (http://tinyurl.com/64t5n) Ver: " + System.getProperty("rome.fetcher.version", "UNKNOWN"), feedFetcher.getUserAgent());
} }

View file

@ -1,12 +1,12 @@
package org.rometools.test; package com.rometools.test;
import java.io.File; import java.io.File;
import java.net.URL; import java.net.URL;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.rometools.fetcher.impl.DiskFeedInfoCache; import com.rometools.fetcher.impl.DiskFeedInfoCache;
import org.rometools.fetcher.impl.SyndFeedInfo; import com.rometools.fetcher.impl.SyndFeedInfo;
public class DiskFeedInfoCacheTest extends TestCase { public class DiskFeedInfoCacheTest extends TestCase {

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package org.rometools.test; package com.rometools.test;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
@ -45,6 +45,8 @@ import com.sun.syndication.io.SyndFeedOutput;
public class FetcherTestServlet extends HttpServlet { public class FetcherTestServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public static final String ETAG_1 = "ETAG-1"; public static final String ETAG_1 = "ETAG-1";
public static final String ETAG_2 = "ETAG-2"; public static final String ETAG_2 = "ETAG-2";
@ -57,7 +59,8 @@ public class FetcherTestServlet extends HttpServlet {
/** /**
* @throws IOException * @throws IOException
* @throws * @throws
* @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse)
*/ */
@Override @Override
protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {

View file

@ -1,11 +1,11 @@
package org.rometools.test; package com.rometools.test;
import java.net.URL; import java.net.URL;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.rometools.fetcher.impl.HashMapFeedInfoCache; import com.rometools.fetcher.impl.HashMapFeedInfoCache;
import org.rometools.fetcher.impl.SyndFeedInfo; import com.rometools.fetcher.impl.SyndFeedInfo;
public class HashMapFeedInfoCacheTest extends TestCase { public class HashMapFeedInfoCacheTest extends TestCase {

View file

@ -14,13 +14,14 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package org.rometools.test; package com.rometools.test;
import org.apache.commons.httpclient.Credentials; import org.apache.commons.httpclient.Credentials;
import org.apache.commons.httpclient.UsernamePasswordCredentials; import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.rometools.fetcher.FeedFetcher;
import org.rometools.fetcher.impl.FeedFetcherCache; import com.rometools.fetcher.FeedFetcher;
import org.rometools.fetcher.impl.HttpClientFeedFetcher; import com.rometools.fetcher.impl.FeedFetcherCache;
import com.rometools.fetcher.impl.HttpClientFeedFetcher;
/** /**
* @author Nick Lothian * @author Nick Lothian

View file

@ -14,11 +14,11 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package org.rometools.test; package com.rometools.test;
import org.rometools.fetcher.FeedFetcher; import com.rometools.fetcher.FeedFetcher;
import org.rometools.fetcher.impl.FeedFetcherCache; import com.rometools.fetcher.impl.FeedFetcherCache;
import org.rometools.fetcher.impl.HttpURLFeedFetcher; import com.rometools.fetcher.impl.HttpURLFeedFetcher;
public class HttpURLFeedFetcherTest extends AbstractJettyTest { public class HttpURLFeedFetcherTest extends AbstractJettyTest {

View file

@ -14,11 +14,11 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package org.rometools.test; package com.rometools.test;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.rometools.fetcher.impl.ResponseHandler; import com.rometools.fetcher.impl.ResponseHandler;
public class ResponseHandlerTest extends TestCase { public class ResponseHandlerTest extends TestCase {

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package org.rometools.test; package com.rometools.test;
import java.net.Authenticator; import java.net.Authenticator;
import java.net.PasswordAuthentication; import java.net.PasswordAuthentication;

View file

@ -0,0 +1,13 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
</encoder>
</appender>
<root level="warn">
<appender-ref ref="STDOUT" />
</root>
</configuration>