public abstract class ClassFile extends Object
| Constructor and Description |
|---|
ClassFile() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
exists()
Returns true if file exists.
|
abstract String |
getAbsoluteName()
Get absolute name of file entry
|
abstract InputStream |
getInputStream()
Returns input stream to either regular file or zip file entry
|
abstract String |
getName()
Get name of file entry excluding directory name
|
abstract String |
getPath()
Get file path.
|
abstract boolean |
isDirectory()
Returns true if this is a directory.
|
abstract boolean |
isZipped()
Returns true if this is zip file entry
|
abstract long |
lastModified()
Return last modification time
|
abstract long |
length()
Get length of file
|
static ClassFile |
newClassFile(File file)
Factory method to create a ClassFile backed by a File.
|
static ClassFile |
newClassFile(Path path)
Factory method to create a ClassFile backed by a nio Path.
|
static ClassFile |
newClassFile(ZipFile zf,
ZipEntry ze)
Factory method to create a ClassFile backed by a ZipEntry.
|
public static ClassFile newClassFile(File file)
file - a File objectpublic static ClassFile newClassFile(ZipFile zf, ZipEntry ze)
zf - a ZipFileze - a ZipEntry within the zip filepublic static ClassFile newClassFile(Path path)
path - nio Path objectpublic abstract boolean isZipped()
public abstract InputStream getInputStream() throws IOException
IOExceptionpublic abstract boolean exists()
public abstract boolean isDirectory()
public abstract long lastModified()
public abstract String getPath()
public abstract String getName()
public abstract String getAbsoluteName()
public abstract long length()
Copyright © 2017–2020 Eclipse Foundation. All rights reserved.