Skip to main content
summaryrefslogtreecommitdiffstats
blob: c2acce7f1c1997c0bbf75a6a352167f4c415122f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*******************************************************************************
 * Copyright (c) 2001, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 * IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jst.j2ee.commonarchivecore.internal;



/**
 * @author mdelder
 */
public interface GenericArchiveTypeDiscriminator {

	/**
	 * This is a unique identifier that contributors should use to specify the generic type that
	 * should be associated with archives. Example: com.yourcompany.j2ee.extension.customModule
	 * 
	 * @return
	 */
	public String getTypeKey();

	/**
	 * If common archive should recognize file extensions other than the standard ones, e.g., .jar,
	 * .zip, then these file extensions can be specified here.
	 * 
	 * @return
	 */
	public String[] getCustomFileExtensions();

	/**
	 * Method that individual discriminators can implement to determine if an Archive is of a
	 * particular type. Implementers should be sensitive to performance requirments. Usually simple
	 * tests should be performed, such as:
	 * <code>if (anArchive.containsFile("xxx.xml")<code>.  The result will
	 * be stored in the Archive's "types" attribute.
	 * @param anArchive
	 * @return
	 */
	public boolean discriminate(Archive anArchive);

}

Back to the top