You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ArtifactCountConsumer.java 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. package org.apache.archiva.cli;
  2. /*
  3. * Licensed to the Apache Software Foundation (ASF) under one
  4. * or more contributor license agreements. See the NOTICE file
  5. * distributed with this work for additional information
  6. * regarding copyright ownership. The ASF licenses this file
  7. * to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance
  9. * with the License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing,
  14. * software distributed under the License is distributed on an
  15. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. * KIND, either express or implied. See the License for the
  17. * specific language governing permissions and limitations
  18. * under the License.
  19. */
  20. import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
  21. import org.springframework.context.annotation.Scope;
  22. import org.springframework.stereotype.Service;
  23. import java.util.ArrayList;
  24. import java.util.List;
  25. /**
  26. * ArtifactCountConsumer
  27. *
  28. *
  29. */
  30. @Service("knownRepositoryContentConsumer#count-artifacts")
  31. @Scope("prototype")
  32. public class ArtifactCountConsumer
  33. extends AbstractProgressConsumer
  34. implements KnownRepositoryContentConsumer
  35. {
  36. /**
  37. * default-value="count-artifacts"
  38. */
  39. private String id = "count-artifacts";
  40. /**
  41. * default-value="Count Artifacts"
  42. */
  43. private String description = "Count Artifacts";
  44. private List<String> includes;
  45. public ArtifactCountConsumer()
  46. {
  47. // TODO: shouldn't this use filetypes?
  48. includes = new ArrayList<>();
  49. includes.add( "**/*.pom" );
  50. includes.add( "**/*.jar" );
  51. includes.add( "**/*.war" );
  52. includes.add( "**/*.ear" );
  53. includes.add( "**/*.sar" );
  54. includes.add( "**/*.car" );
  55. includes.add( "**/*.mar" );
  56. includes.add( "**/*.dtd" );
  57. includes.add( "**/*.tld" );
  58. includes.add( "**/*.gz" );
  59. includes.add( "**/*.bz2" );
  60. includes.add( "**/*.zip" );
  61. }
  62. public String getDescription()
  63. {
  64. return description;
  65. }
  66. public String getId()
  67. {
  68. return id;
  69. }
  70. public boolean isPermanent()
  71. {
  72. return false;
  73. }
  74. public List<String> getExcludes()
  75. {
  76. return null;
  77. }
  78. public List<String> getIncludes()
  79. {
  80. return includes;
  81. }
  82. }