Class Plugin.Engine.Source.Element.ForJarEntry

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.jar.JarEntry entry
      The entry that is represented by this element.
      private java.util.jar.JarFile file
      The source's underlying jar file.
    • Constructor Summary

      Constructors 
      Constructor Description
      ForJarEntry​(java.util.jar.JarFile file, java.util.jar.JarEntry entry)
      Creates a new element representation for a jar file entry.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.InputStream getInputStream()
      Returns an input stream to read this element's binary information.
      java.lang.String getName()
      Returns the element's relative path and name.
      <T> T resolveAs​(java.lang.Class<T> type)
      Resolves this element to a more specialized form if possible.
      • Methods inherited from class java.lang.Object

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

      • file

        private final java.util.jar.JarFile file
        The source's underlying jar file.
      • entry

        private final java.util.jar.JarEntry entry
        The entry that is represented by this element.
    • Constructor Detail

      • ForJarEntry

        public ForJarEntry​(java.util.jar.JarFile file,
                           java.util.jar.JarEntry entry)
        Creates a new element representation for a jar file entry.
        Parameters:
        file - The source's underlying jar file.
        entry - The entry that is represented by this element.
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the element's relative path and name.
        Specified by:
        getName in interface Plugin.Engine.Source.Element
        Returns:
        The element's path and name.
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Returns an input stream to read this element's binary information.
        Specified by:
        getInputStream in interface Plugin.Engine.Source.Element
        Returns:
        An input stream that represents this element's binary information.
        Throws:
        java.io.IOException - If an I/O error occurs.
      • resolveAs

        public <T> T resolveAs​(java.lang.Class<T> type)
        Resolves this element to a more specialized form if possible. Doing so allows for performance optimizations if more specialized formats are available.
        Specified by:
        resolveAs in interface Plugin.Engine.Source.Element
        Type Parameters:
        T - The requested spezialized type.
        Parameters:
        type - The requested spezialized type.
        Returns:
        The resolved element or null if a transformation is impossible.