View Javadoc

1   /**
2    * Copyright 2005-2006 the original author or authors.
3    *
4    * Licensed under the Gnu General Pubic License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with
6    * the License. You may obtain a copy of the License at
7    *
8    *      http://www.opensource.org/licenses/gpl-license.php
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13   * See the Gnu General Public License for more details.
14   */
15  package org.figure8.join.services.scripting.ant.tasks;
16  
17  import java.io.File;
18  import java.text.ParseException;
19  import java.util.MissingResourceException;
20  /**
21   * Interface that defines the operation of extracting a version information from
22   * a set of files. That way, a component version can be specified using different
23   * means such as a directory name, a zip file name, a deployment Xml file, a text
24   * file, etc ... Each implementation will define it's own  means to retrieve this
25   * component version and its own version syntax.
26   * @author <a href="mailto:laurent.broudoux@free.fr">Laurent Broudoux</a>
27   * @version $Revision: 1.1 $
28   */
29  public interface VersionInfoExtractor{
30  
31     // Public -------------------------------------------------------------------
32  
33     /**
34      * Extract a version identifier of a component or whatever else from the set
35      * of files defining this component / package.
36      * @param files A set of files used to extract the version information.
37      * @throws MissingResourceException if the resource used for the version extraction is missing.
38      * @throws ParseException if the version information cannod be parsed from files
39      * @return A version information
40      */
41     public abstract String extractVersionInfo(File[] files) throws MissingResourceException, ParseException;
42  }
43