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

How to use
fixRelativeUrl
method
in
jodd.htmlstapler.HtmlStaplerBundlesManager

Best Java code snippets using jodd.htmlstapler.HtmlStaplerBundlesManager.fixRelativeUrl (Showing top 2 results out of 315)

origin: oblac/jodd

/**
 * Returns the content with all relative URLs fixed.
 */
protected String fixCssRelativeUrls(final String content, final String src) {
  String path = FileNameUtil.getPath(src);
  Matcher matcher = CSS_URL_PATTERN.matcher(content);
  StringBuilder sb = new StringBuilder(content.length());
  int start = 0;
  while (matcher.find()) {
    sb.append(content.substring(start, matcher.start()));
    String url = fixRelativeUrl(matcher.group(1), path);
    sb.append(url);
    start = matcher.end();
  }
  sb.append(content.substring(start));
  return sb.toString();
}
origin: org.jodd/jodd-htmlstapler

/**
 * Returns the content with all relative URLs fixed.
 */
protected String fixCssRelativeUrls(final String content, final String src) {
  String path = FileNameUtil.getPath(src);
  Matcher matcher = CSS_URL_PATTERN.matcher(content);
  StringBuilder sb = new StringBuilder(content.length());
  int start = 0;
  while (matcher.find()) {
    sb.append(content.substring(start, matcher.start()));
    String url = fixRelativeUrl(matcher.group(1), path);
    sb.append(url);
    start = matcher.end();
  }
  sb.append(content.substring(start));
  return sb.toString();
}
jodd.htmlstaplerHtmlStaplerBundlesManagerfixRelativeUrl

Javadoc

For a given URL (optionally quoted), produces CSS URL where relative paths are fixed and prefixed with offsetPath.

Popular methods of HtmlStaplerBundlesManager

  • <init>
    Creates new instance and initialize it.
  • 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.
  • 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

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • onCreateOptionsMenu (Activity)
  • runOnUiThread (Activity)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Socket (java.net)
    Provides a client-side TCP socket.
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Top PhpStorm plugins
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