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

How to use
sendBundleFile
method
in
jodd.htmlstapler.HtmlStaplerFilter

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

origin: oblac/jodd

@Override
protected boolean processActionPath(final HttpServletRequest servletRequest, final HttpServletResponse servletResponse, final String actionPath) throws IOException {
  String bundlePath = '/' + bundlesManager.getStaplerPath() + '/';
  if (!actionPath.startsWith(bundlePath)) {
    return false;
  }
  String bundleId = actionPath.substring(bundlePath.length());
  File file = bundlesManager.lookupBundleFile(bundleId);
  if (log.isDebugEnabled()) {
    log.debug("bundle: " + bundleId);
  }
  int ndx = bundleId.lastIndexOf('.');
  String extension = bundleId.substring(ndx + 1);
  String contentType = MimeTypes.getMimeType(extension);
  servletResponse.setContentType(contentType);
  if (useGzip && ServletUtil.isGzipSupported(servletRequest)) {
    file = bundlesManager.lookupGzipBundleFile(file);
    servletResponse.setHeader("Content-Encoding", "gzip");
  }
  if (!file.exists()) {
    throw new IOException("bundle not found: " + bundleId);
  }
  servletResponse.setHeader("Content-Length", String.valueOf(file.length()));
  servletResponse.setHeader("Last-Modified", TimeUtil.formatHttpDate(file.lastModified()));
  if (cacheMaxAge > 0) {
    servletResponse.setHeader("Cache-Control", "max-age=" + cacheMaxAge);
  }
  sendBundleFile(servletResponse, file);
  return true;
}
origin: org.jodd/jodd-htmlstapler

@Override
protected boolean processActionPath(final HttpServletRequest servletRequest, final HttpServletResponse servletResponse, final String actionPath) throws IOException {
  String bundlePath = '/' + bundlesManager.getStaplerPath() + '/';
  if (!actionPath.startsWith(bundlePath)) {
    return false;
  }
  String bundleId = actionPath.substring(bundlePath.length());
  File file = bundlesManager.lookupBundleFile(bundleId);
  if (log.isDebugEnabled()) {
    log.debug("bundle: " + bundleId);
  }
  int ndx = bundleId.lastIndexOf('.');
  String extension = bundleId.substring(ndx + 1);
  String contentType = MimeTypes.getMimeType(extension);
  servletResponse.setContentType(contentType);
  if (useGzip && ServletUtil.isGzipSupported(servletRequest)) {
    file = bundlesManager.lookupGzipBundleFile(file);
    servletResponse.setHeader("Content-Encoding", "gzip");
  }
  if (!file.exists()) {
    throw new IOException("bundle not found: " + bundleId);
  }
  servletResponse.setHeader("Content-Length", String.valueOf(file.length()));
  servletResponse.setHeader("Last-Modified", TimeUtil.formatHttpDate(file.lastModified()));
  if (cacheMaxAge > 0) {
    servletResponse.setHeader("Cache-Control", "max-age=" + cacheMaxAge);
  }
  sendBundleFile(servletResponse, file);
  return true;
}
jodd.htmlstaplerHtmlStaplerFiltersendBundleFile

Javadoc

Outputs bundle file to the response.

Popular methods of HtmlStaplerFilter

  • createBundleManager
    Creates HtmlStaplerBundlesManager instance.
  • readFilterConfigParameters
    Reads filter config parameters and set into destination target.

Popular in Java

  • Making http post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Reference (javax.naming)
  • Top Sublime Text 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