java.lang.Object
org.eclipse.lsp4j.debug.Source
io.quarkus.qute.debug.agent.source.RemoteSource
io.quarkus.qute.debug.agent.source.JarSource

public class JarSource extends RemoteSource
A specialized RemoteSource representing a Qute template located inside a JAR file.

This implementation is used when a template originates from a dependency JAR rather than from the local file system. It ensures the source is properly identified in the DAP client using a unique sourceReference.

Example URI:

 jar:file:///C:/Users/.../quarkus-renarde-3.1.2.jar!/templates/tags/ifError.html
 

The displayed name for this source will be:

 quarkus-renarde-3.1.2.jar!/templates/tags/ifError.html
 
If extraction fails for any reason, the name falls back to the file name (for example, ifError.html).
  • Constructor Summary

    Constructors
    Constructor
    Description
    JarSource(URI uri, String templateId, SourceReferenceRegistry sourceReferenceRegistry)
    Creates a new JarSource for a Qute template embedded in a JAR file.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    Computes a human-readable name for this source, suitable for display in the DAP client.

    Methods inherited from class io.quarkus.qute.debug.agent.source.RemoteSource

    getStartLine, getTemplateId, getUri

    Methods inherited from class org.eclipse.lsp4j.debug.Source

    equals, getAdapterData, getChecksums, getName, getOrigin, getPath, getPresentationHint, getSourceReference, getSources, hashCode, setAdapterData, setChecksums, setName, setOrigin, setPath, setPresentationHint, setSourceReference, setSources, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • JarSource

      public JarSource(URI uri, String templateId, SourceReferenceRegistry sourceReferenceRegistry)
      Creates a new JarSource for a Qute template embedded in a JAR file.
      Parameters:
      uri - the full JAR URI of the template (e.g. jar:file:///.../template.jar!/path/to/template.html)
      templateId - the Qute template identifier
      sourceReferenceRegistry - the registry responsible for assigning a unique DAP source reference
  • Method Details

    • computeName

      protected String computeName(URI uri)
      Computes a human-readable name for this source, suitable for display in the DAP client.

      For JAR-based templates, the name includes the JAR file name and the internal resource path (e.g. my-lib.jar!/templates/foo.html). If the URI is not a JAR path or the format cannot be parsed, this method falls back to RemoteSource.computeName(URI).

      Overrides:
      computeName in class RemoteSource
      Parameters:
      uri - the full JAR URI of the source
      Returns:
      a descriptive name for the source