Class FileClassFile


  • final class FileClassFile
    extends ClassFile
    This class is used to represent a file loaded from the class path, and is a regular 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.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.File file  
    • Constructor Summary

      Constructors 
      Constructor Description
      FileClassFile​(java.io.File file)
      Constructor for instance representing a regular file
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean exists()
      Returns true if file exists.
      java.lang.String getAbsoluteName()
      Get absolute name of file entry
      java.io.InputStream getInputStream()
      Returns input stream to either regular file or zip file entry
      java.lang.String getName()
      Get name of file entry excluding directory name
      java.lang.String getPath()
      Get file path.
      boolean isDirectory()
      Returns true if this is a directory.
      boolean isZipped()
      Returns true if this is zip file entry
      long lastModified()
      Return last modification time
      long length()
      Get length of file
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • file

        private final java.io.File file
    • Constructor Detail

      • FileClassFile

        public FileClassFile​(java.io.File file)
        Constructor for instance representing a regular file
    • Method Detail

      • isZipped

        public boolean isZipped()
        Description copied from class: ClassFile
        Returns true if this is zip file entry
        Specified by:
        isZipped in class ClassFile
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Description copied from class: ClassFile
        Returns input stream to either regular file or zip file entry
        Specified by:
        getInputStream in class ClassFile
        Throws:
        java.io.IOException
      • exists

        public boolean exists()
        Description copied from class: ClassFile
        Returns true if file exists.
        Specified by:
        exists in class ClassFile
      • isDirectory

        public boolean isDirectory()
        Description copied from class: ClassFile
        Returns true if this is a directory.
        Specified by:
        isDirectory in class ClassFile
      • lastModified

        public long lastModified()
        Description copied from class: ClassFile
        Return last modification time
        Specified by:
        lastModified in class ClassFile
      • getPath

        public java.lang.String getPath()
        Description copied from class: ClassFile
        Get file path. The path for a zip file entry will also include the zip file name.
        Specified by:
        getPath in class ClassFile
      • getName

        public java.lang.String getName()
        Description copied from class: ClassFile
        Get name of file entry excluding directory name
        Specified by:
        getName in class ClassFile
      • getAbsoluteName

        public java.lang.String getAbsoluteName()
        Description copied from class: ClassFile
        Get absolute name of file entry
        Specified by:
        getAbsoluteName in class ClassFile
      • length

        public long length()
        Description copied from class: ClassFile
        Get length of file
        Specified by:
        length in class ClassFile
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object