Package org.glassfish.rmic.tools.java
Class ClassFile
- java.lang.Object
-
- org.glassfish.rmic.tools.java.ClassFile
-
- Direct Known Subclasses:
FileClassFile,PathClassFile,ZipClassFile
public abstract class ClassFile extends java.lang.ObjectAbstract 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 Constructor Description ClassFile()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleanexists()Returns true if file exists.abstract java.lang.StringgetAbsoluteName()Get absolute name of file entryabstract java.io.InputStreamgetInputStream()Returns input stream to either regular file or zip file entryabstract java.lang.StringgetName()Get name of file entry excluding directory nameabstract java.lang.StringgetPath()Get file path.abstract booleanisDirectory()Returns true if this is a directory.abstract booleanisZipped()Returns true if this is zip file entryabstract longlastModified()Return last modification timeabstract longlength()Get length of filestatic ClassFilenewClassFile(java.io.File file)Factory method to create a ClassFile backed by a File.static ClassFilenewClassFile(java.nio.file.Path path)Factory method to create a ClassFile backed by a nio Path.static ClassFilenewClassFile(java.util.zip.ZipFile zf, java.util.zip.ZipEntry ze)Factory method to create a ClassFile backed by a ZipEntry.
-
-
-
Method Detail
-
newClassFile
public static ClassFile newClassFile(java.io.File file)
Factory method to create a ClassFile backed by a File.- Parameters:
file- a File object- Returns:
- a new ClassFile
-
newClassFile
public static ClassFile newClassFile(java.util.zip.ZipFile zf, java.util.zip.ZipEntry ze)
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
public static ClassFile newClassFile(java.nio.file.Path path)
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
public abstract java.io.InputStream getInputStream() throws java.io.IOExceptionReturns input stream to either regular file or zip file entry- Throws:
java.io.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
public abstract java.lang.String getPath()
Get file path. The path for a zip file entry will also include the zip file name.
-
getName
public abstract java.lang.String getName()
Get name of file entry excluding directory name
-
getAbsoluteName
public abstract java.lang.String getAbsoluteName()
Get absolute name of file entry
-
length
public abstract long length()
Get length of file
-
-