Package gw.fs.jar
Class JarEntryResourceImpl
- java.lang.Object
-
- gw.fs.jar.JarEntryResourceImpl
-
- All Implemented Interfaces:
IResource
- Direct Known Subclasses:
JarEntryDirectoryImpl,JarEntryFileImpl
public abstract class JarEntryResourceImpl extends java.lang.Object implements IResource
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.jar.JarEntry_entryprivate boolean_existsprotected JarFileDirectoryImpl_jarFileprotected java.lang.String_nameprotected IJarFileDirectory_parent
-
Constructor Summary
Constructors Modifier Constructor Description protectedJarEntryResourceImpl(java.lang.String name, IJarFileDirectory parent, JarFileDirectoryImpl jarFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancreate()booleandelete()booleanequals(java.lang.Object obj)booleanexists()Indicates whether this resource exists.private java.lang.StringgetEntryName()java.lang.StringgetName()Gets this file's or directory's name.IDirectorygetParent()Gets this file's our directory's parent directory.ResourcePathgetPath()booleanisChildOf(IDirectory dir)Indicates whether this resource is a direct child of the given directory.booleanisDescendantOf(IDirectory dir)Indicates whether this resource is a descendant of the given directory.booleanisInJar()booleanisJavaFile()voidsetEntry(java.util.jar.JarEntry entry)protected voidsetExists()java.io.FiletoJavaFile()java.lang.StringtoString()java.net.URItoURI()
-
-
-
Field Detail
-
_entry
protected java.util.jar.JarEntry _entry
-
_parent
protected IJarFileDirectory _parent
-
_jarFile
protected JarFileDirectoryImpl _jarFile
-
_name
protected java.lang.String _name
-
_exists
private boolean _exists
-
-
Constructor Detail
-
JarEntryResourceImpl
protected JarEntryResourceImpl(java.lang.String name, IJarFileDirectory parent, JarFileDirectoryImpl jarFile)
-
-
Method Detail
-
setEntry
public void setEntry(java.util.jar.JarEntry entry)
-
setExists
protected void setExists()
-
getParent
public IDirectory getParent()
Description copied from interface:IResourceGets this file's our directory's parent directory.
-
getName
public java.lang.String getName()
Description copied from interface:IResourceGets this file's or directory's name.
-
exists
public boolean exists()
Description copied from interface:IResourceIndicates whether this resource exists.
-
delete
public boolean delete() throws java.io.IOException
-
getEntryName
private java.lang.String getEntryName()
-
getPath
public ResourcePath getPath()
-
isChildOf
public boolean isChildOf(IDirectory dir)
Description copied from interface:IResourceIndicates whether this resource is a direct child of the given directory.
-
isDescendantOf
public boolean isDescendantOf(IDirectory dir)
Description copied from interface:IResourceIndicates whether this resource is a descendant of the given directory.- Specified by:
isDescendantOfin interfaceIResource- Parameters:
dir- the directory which would be the ancestor- Returns:
- true if this is a descendant of the given directory
-
toJavaFile
public java.io.File toJavaFile()
- Specified by:
toJavaFilein interfaceIResource
-
isJavaFile
public boolean isJavaFile()
- Specified by:
isJavaFilein interfaceIResource
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-