01: /*******************************************************************************
02: * Copyright (c) 2000, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.core;
11:
12: import org.eclipse.core.resources.IStorage;
13: import org.eclipse.core.runtime.IPath;
14:
15: /**
16: * A jar entry corresponding to a non-Java resource in an archive {@link IPackageFragment} or {@link IPackageFragmentRoot}.
17: * <p>
18: * One can navigate the non-Java resource tree using the {@link #getChildren()} and {@link #getParent()} methods.
19: * Jar entry resources are either files ({@link #isFile()} returns true) or directories ({@link #isFile()} returns false).
20: * Files don't have any children and the returned array is always empty.
21: * </p><p>
22: * Jar entry resources that refer to the same element are guaranteed to be equal, but not necessarily identical.
23: * <p>
24: *
25: * @since 3.3
26: */
27: public interface IJarEntryResource extends IStorage {
28:
29: /**
30: * Returns the list of children of this jar entry resource.
31: * Returns an empty array if this jar entry is a file, or if this jar entry is a directory and it has no children.
32: *
33: * @return the children of this jar entry resource
34: */
35: IJarEntryResource[] getChildren();
36:
37: /**
38: * Returns the full, absolute path of this jar entry resource relative to the archive this jar
39: * entry belongs to.
40: * <p>
41: * A jar entry resource's full path indicates the route from the root of the archive
42: * to the jar entry resource. Within an archive, there is exactly one such path
43: * for any given jar entry resource. </p>
44: * <p>
45: * The returned path is absolute (i.e. it starts with a separator) and it never has a trailing separator.
46: * </p>
47: *
48: * @return the absolute path of this jar entry resource
49: */
50: IPath getFullPath();
51:
52: /**
53: * Returns the parent of this jar entry resource. This is either an {@link IJarEntryResource}, an {@link IPackageFragment}
54: * or an {@link IPackageFragmentRoot}.
55: *
56: * @return the parent of this jar entry resource
57: */
58: Object getParent();
59:
60: /**
61: * Returns the package fragment root this jar entry resource belongs to.
62: *
63: * @return the package fragment root this jar entry resource belongs to.
64: */
65: IPackageFragmentRoot getPackageFragmentRoot();
66:
67: /**
68: * Returns <code>true</code> if this jar entry represents a file.
69: * Returns <code>false</code> if it is a directory.
70: *
71: * @return whether this jar entry is a file
72: */
73: boolean isFile();
74:
75: }
|