Example usage for org.apache.wicket.util.string Strings beforeLastPathComponent

List of usage examples for org.apache.wicket.util.string Strings beforeLastPathComponent

Introduction

In this page you can find the example usage for org.apache.wicket.util.string Strings beforeLastPathComponent.

Prototype

public static String beforeLastPathComponent(final String path, final char separator) 

Source Link

Document

Gets everything before the last path component of a path using a given separator.

Usage

From source file:au.org.theark.lims.web.component.panel.applet.PrintAppletPanel.java

License:Open Source License

public PrintAppletPanel(String id, String printerName) {
    super(id);/*from   w ww  . j a v  a 2 s  .  co  m*/
    setOutputMarkupPlaceholderTag(true);

    applet = new WebMarkupContainer("applet");
    applet.setOutputMarkupPlaceholderTag(true);

    PackageResourceReference jarResourceReference = new PackageResourceReference(PrintAppletPanel.class,
            "jzebra.jar");
    ResourceReferenceRequestHandler reqHandler = new ResourceReferenceRequestHandler(jarResourceReference);

    final String jarResourceUrl = getRequestCycle().urlFor(reqHandler).toString();
    final String codebase = Strings.beforeLastPathComponent(jarResourceUrl, '/') + '/';
    applet.add(new AttributeModifier("codebase", codebase));
    add(applet);

    final AttributeModifier valueParam1 = new AttributeModifier("value", printerName);
    final WebMarkupContainer appletParam1 = new WebMarkupContainer("appletParam1");
    appletParam1.add(valueParam1);
    applet.add(appletParam1);
}