Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

ArtifactCountConsumer.java 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. package org.apache.maven.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 java.util.ArrayList;
  21. import java.util.List;
  22. import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
  23. /**
  24. * ArtifactCountConsumer
  25. *
  26. * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
  27. * @version $Id$
  28. *
  29. * @plexus.component role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer"
  30. * role-hint="count-artifacts"
  31. * instantiation-strategy="per-lookup"
  32. */
  33. public class ArtifactCountConsumer
  34. extends AbstractProgressConsumer
  35. implements KnownRepositoryContentConsumer
  36. {
  37. /**
  38. * @plexus.configuration default-value="count-artifacts"
  39. */
  40. private String id;
  41. /**
  42. * @plexus.configuration default-value="Count Artifacts"
  43. */
  44. private String description;
  45. private List includes;
  46. public ArtifactCountConsumer()
  47. {
  48. // TODO: shouldn't this use filetypes?
  49. includes = new ArrayList();
  50. includes.add( "**/*.pom" );
  51. includes.add( "**/*.jar" );
  52. includes.add( "**/*.war" );
  53. includes.add( "**/*.ear" );
  54. includes.add( "**/*.sar" );
  55. includes.add( "**/*.car" );
  56. includes.add( "**/*.mar" );
  57. includes.add( "**/*.dtd" );
  58. includes.add( "**/*.tld" );
  59. includes.add( "**/*.gz" );
  60. includes.add( "**/*.bz2" );
  61. includes.add( "**/*.zip" );
  62. }
  63. public String getDescription()
  64. {
  65. return description;
  66. }
  67. public String getId()
  68. {
  69. return id;
  70. }
  71. public boolean isPermanent()
  72. {
  73. return false;
  74. }
  75. public List getExcludes()
  76. {
  77. return null;
  78. }
  79. public List getIncludes()
  80. {
  81. return includes;
  82. }
  83. }