View Javadoc
1   /*******************************************************************************
2    * Copyright (c) 2010, 2011 Sonatype, Inc.
3    * All rights reserved. This program and the accompanying materials
4    * are made available under the terms of the Eclipse Public License v1.0
5    * which accompanies this distribution, and is available at
6    * http://www.eclipse.org/legal/epl-v10.html
7    *
8    * Contributors:
9    *    Sonatype, Inc. - initial API and implementation
10   *******************************************************************************/
11  package org.eclipse.aether.metadata;
12  
13  import java.io.File;
14  
15  import org.eclipse.aether.RepositoryException;
16  
17  /**
18   * A piece of metadata that needs to be merged with any current metadata before installation/deployment.
19   */
20  public interface MergeableMetadata
21      extends Metadata
22  {
23  
24      /**
25       * Merges this metadata into the current metadata (if any). Note that this method will be invoked regardless whether
26       * metadata currently exists or not.
27       * 
28       * @param current The path to the current metadata file, may not exist but must not be {@code null}.
29       * @param result The path to the result file where the merged metadata should be stored, must not be {@code null}.
30       * @throws RepositoryException If the metadata could not be merged.
31       */
32      void merge( File current, File result )
33          throws RepositoryException;
34  
35      /**
36       * Indicates whether this metadata has been merged.
37       * 
38       * @return {@code true} if the metadata has been merged, {@code false} otherwise.
39       */
40      boolean isMerged();
41  
42  }