View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.plugin.eclipse.osgiplugin;
20  
21  import java.io.File;
22  import java.io.IOException;
23  import java.util.Properties;
24  import java.util.jar.JarFile;
25  import java.util.jar.Manifest;
26  
27  /**
28   * Abstraction of Eclipse plugins
29   * 
30   * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
31   * @version $Id: EclipseOsgiPlugin.java 728546 2008-12-21 22:56:51Z bentmann $
32   */
33  public interface EclipseOsgiPlugin
34  {
35      /**
36       * Get the plugin Manifest
37       * 
38       * @return the Manifest or <code>null</code> if it has no manifest
39       * @throws IOException
40       */
41      Manifest getManifest()
42          throws IOException;
43  
44      /**
45       * Whether the manifest is present or not
46       * 
47       * @return true if the manifest exists, false otherwise
48       * @throws IOException
49       */
50      boolean hasManifest()
51          throws IOException;
52  
53      /**
54       * Get a jar with the plugin contents
55       * 
56       * @return the jar
57       * @throws IOException
58       */
59      JarFile getJar()
60          throws IOException;
61  
62      /**
63       * Get a jar with the plugin contents
64       * 
65       * @return the jar file
66       * @throws IOException
67       */
68      File getJarFile()
69          throws IOException;
70  
71      /**
72       * Loads the plugin.properties file from a the plugin, usually needed in order to resolve the artifact name.
73       * 
74       * @return loaded Properties (or an empty properties if no plugin.properties is found)
75       * @throws IOException for exceptions while reading the file
76       */
77      Properties getPluginProperties()
78          throws IOException;
79  
80      /**
81       * Properties to add to the pom
82       * 
83       * @return pom properties
84       */
85      Properties getPomProperties();
86  
87      public String getManifestAttribute( String key )
88          throws IOException;
89  }