java.lang.Object
org.glassfish.rmic.tools.java.ClassFile
Abstract class to represent a class file.
WARNING: The contents of this source file are not part of any
supported API. Code that depends on them does so at its own risk:
they are subject to change or removal without notice.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanexists()Returns true if file exists.abstract StringGet absolute name of file entryabstract InputStreamReturns input stream to either regular file or zip file entryabstract StringgetName()Get name of file entry excluding directory nameabstract StringgetPath()Get file path.abstract booleanReturns true if this is a directory.abstract booleanisZipped()Returns true if this is zip file entryabstract longReturn last modification timeabstract longlength()Get length of filestatic ClassFilenewClassFile(File file) Factory method to create a ClassFile backed by a File.static ClassFilenewClassFile(Path path) Factory method to create a ClassFile backed by a nio Path.static ClassFilenewClassFile(ZipFile zf, ZipEntry ze) Factory method to create a ClassFile backed by a ZipEntry.
-
Constructor Details
-
ClassFile
public ClassFile()
-
-
Method Details
-
newClassFile
Factory method to create a ClassFile backed by a File.- Parameters:
file- a File object- Returns:
- a new ClassFile
-
newClassFile
Factory method to create a ClassFile backed by a ZipEntry.- Parameters:
zf- a ZipFileze- a ZipEntry within the zip file- Returns:
- a new ClassFile
-
newClassFile
Factory method to create a ClassFile backed by a nio Path.- Parameters:
path- nio Path object- Returns:
- a new ClassFile
-
isZipped
public abstract boolean isZipped()Returns true if this is zip file entry -
getInputStream
Returns input stream to either regular file or zip file entry- Throws:
IOException
-
exists
public abstract boolean exists()Returns true if file exists. -
isDirectory
public abstract boolean isDirectory()Returns true if this is a directory. -
lastModified
public abstract long lastModified()Return last modification time -
getPath
Get file path. The path for a zip file entry will also include the zip file name. -
getName
Get name of file entry excluding directory name -
getAbsoluteName
Get absolute name of file entry -
length
public abstract long length()Get length of file
-