congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
HtmlStaplerBundlesManager.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
jodd.htmlstapler.HtmlStaplerBundlesManager
constructor

Best Java code snippets using jodd.htmlstapler.HtmlStaplerBundlesManager.<init> (Showing top 4 results out of 315)

origin: oblac/jodd

/**
 * Creates {@link HtmlStaplerBundlesManager} instance.
 */
protected HtmlStaplerBundlesManager createBundleManager(final ServletContext servletContext, final Strategy strategy) {
  String webRoot = servletContext.getRealPath(StringPool.EMPTY);
  String contextPath = ServletUtil.getContextPath(servletContext);
  return new HtmlStaplerBundlesManager(contextPath, webRoot, strategy);
}
origin: oblac/jodd

  @Test
  void testRelativeCssUrls() {


    HtmlStaplerBundlesManager htmlStapler = new HtmlStaplerBundlesManager("/", "", HtmlStaplerBundlesManager.Strategy.RESOURCES_ONLY);

    assertEquals(
        "background: url('/absolute/path')",
        htmlStapler.fixCssRelativeUrls("background: url(/absolute/path)", "css/"));

    assertEquals(
        "background: url('../css/relative/path')",
        htmlStapler.fixCssRelativeUrls("background: url(relative/path)", "css/"));
  }
}
origin: oblac/jodd

  @Test
  void testRandomDigest() {
    HtmlStaplerBundlesManager hsbm = new HtmlStaplerBundlesManager("/ctx", "/", RESOURCES_ONLY);

    String digest = hsbm.createDigest("source");

    hsbm.setRandomDigestChars(5);

    String digest2 = hsbm.createDigest("source");
    String digest3 = hsbm.createDigest("source");

    assertEquals(digest2, digest3);
    assertTrue(digest2.startsWith(digest));


    hsbm.setRandomDigestChars(0);

    digest2 = hsbm.createDigest("source");

    assertEquals(digest, digest2);
  }
}
origin: org.jodd/jodd-htmlstapler

/**
 * Creates {@link HtmlStaplerBundlesManager} instance.
 */
protected HtmlStaplerBundlesManager createBundleManager(final ServletContext servletContext, final Strategy strategy) {
  String webRoot = servletContext.getRealPath(StringPool.EMPTY);
  String contextPath = ServletUtil.getContextPath(servletContext);
  return new HtmlStaplerBundlesManager(contextPath, webRoot, strategy);
}
jodd.htmlstaplerHtmlStaplerBundlesManager<init>

Javadoc

Creates new instance and initialize it.

Popular methods of HtmlStaplerBundlesManager

  • createDigest
    Creates digest i.e. bundle id from given string. Returned digest must be filename safe, for all plat
  • fixCssRelativeUrls
    Returns the content with all relative URLs fixed.
  • createBundle
    Creates bundle file by loading resource files content. If bundle file already exist it will not be r
  • createBundleFile
    Creates bundle file in bundleFolder/staplerPath. Only file object is created, not the file content.
  • fixRelativeUrl
    For a given URL (optionally quoted), produces CSS URL where relative paths are fixed and prefixed wi
  • getStaplerPath
    Returns stapler path. It is both the file system folder name and the web folder name.
  • getStrategy
    Returns current Strategy.
  • isCssResource
    Returns true if resource is CSS, so the CSS urls can be fixed.
  • isExternalResource
    Returns true if resource link has to be downloaded. By default, if resource link starts with "http:/
  • lookupBundleFile
    Lookups for bundle file.
  • lookupBundleId
    Lookups for a bundle id for a given action. Returns null if action still has no bundle. Returns an e
  • lookupGzipBundleFile
    Locates gzipped version of bundle file. If gzip file does not exist, it will be created.
  • lookupBundleId,
  • lookupGzipBundleFile,
  • onResourceContent,
  • registerBundle,
  • registerNewBundleId,
  • reset,
  • resolveRealActionPath,
  • start,
  • setRandomDigestChars

Popular in Java

  • Running tasks concurrently on multiple threads
  • runOnUiThread (Activity)
  • findViewById (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • ImageIO (javax.imageio)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now