KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > core > IJarEntryResource


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
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  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.core;
12
13 import org.eclipse.core.resources.IStorage;
14 import org.eclipse.core.runtime.IPath;
15
16 /**
17  * A jar entry corresponding to a non-Java resource in an archive {@link IPackageFragment} or {@link IPackageFragmentRoot}.
18  * <p>
19  * One can navigate the non-Java resource tree using the {@link #getChildren()} and {@link #getParent()} methods.
20  * Jar entry resources are either files ({@link #isFile()} returns true) or directories ({@link #isFile()} returns false).
21  * Files don't have any children and the returned array is always empty.
22  * </p><p>
23  * Jar entry resources that refer to the same element are guaranteed to be equal, but not necessarily identical.
24  * <p>
25  *
26  * @since 3.3
27  */

28 public interface IJarEntryResource extends IStorage {
29     
30     /**
31      * Returns the list of children of this jar entry resource.
32      * Returns an empty array if this jar entry is a file, or if this jar entry is a directory and it has no children.
33      *
34      * @return the children of this jar entry resource
35      */

36     IJarEntryResource[] getChildren();
37     
38     /**
39      * Returns the full, absolute path of this jar entry resource relative to the archive this jar
40      * entry belongs to.
41      * <p>
42      * A jar entry resource's full path indicates the route from the root of the archive
43      * to the jar entry resource. Within an archive, there is exactly one such path
44      * for any given jar entry resource. The returned path never has a trailing separator.
45      * </p>
46      *
47      * @return the absolute path of this jar entry resource
48      */

49     IPath getFullPath();
50     
51     /**
52      * Returns the parent of this jar entry resource. This is either an {@link IJarEntryResource}, an {@link IPackageFragment}
53      * or an {@link IPackageFragmentRoot}.
54      *
55      * @return the parent of this jar entry resource
56      */

57     Object JavaDoc getParent();
58     
59     /**
60      * Returns the package fragment root this jar entry file belongs to.
61      *
62      * @return the package fragment root this jar entry file belongs to.
63      */

64     IPackageFragmentRoot getPackageFragmentRoot();
65     
66     /**
67      * Returns <code>true</code> if this jar entry represents a file.
68      * Returns <code>false</code> if it is a directory.
69      *
70      * @return whether this jar entry is a file
71      */

72     boolean isFile();
73
74 }
75
Popular Tags