Example usage for com.google.gwt.core.server StackTraceDeobfuscator fromFileSystem

List of usage examples for com.google.gwt.core.server StackTraceDeobfuscator fromFileSystem

Introduction

In this page you can find the example usage for com.google.gwt.core.server StackTraceDeobfuscator fromFileSystem.

Prototype

public static StackTraceDeobfuscator fromFileSystem(final String symbolMapsDirectory) 

Source Link

Document

Creates a deobfuscator that loads symbol and source map files from the given directory.

Usage

From source file:com.allen_sauer.gwt.log.server.RemoteLoggerServlet.java

License:Apache License

@Override
public final void init(ServletConfig config) throws ServletException {
    super.init(config);

    deobfuscatorList = new ArrayList<StackTraceDeobfuscator>();
    for (@SuppressWarnings("unchecked")
    Enumeration<String> e = config.getInitParameterNames(); e.hasMoreElements();) {
        String name = e.nextElement();
        String value = config.getInitParameter(name);

        if (name.startsWith(PARAMETER_SYMBOL_MAPS_FILE_SYSTEM)) {
            deobfuscatorList.add(StackTraceDeobfuscator.fromFileSystem(value));
        } else if (name.startsWith(PARAMETER_SYMBOL_MAPS_RESOURCE_PATH)) {
            deobfuscatorList.add(StackTraceDeobfuscator.fromResource(value));
        } else if (name.startsWith(PARAMETER_SYMBOL_MAPS_URL)) {
            try {
                URL url = new URL(value);
                deobfuscatorList.add(StackTraceDeobfuscator.fromUrl(url));
            } catch (MalformedURLException ex) {
                Log.error(/*from   ww  w  .j a v a 2s.com*/
                        "Servlet configuration parameter '" + name + "' specifies invalid URL '" + value + "'",
                        ex);
            }
        } else if (name.startsWith(PARAMETER_SYMBOL_MAPS)) {
            Log.warn("Servlet configuration parameter '" + name + "' is no longer supported");
        }
    }
    if (deobfuscatorList.isEmpty()) {
        Log.warn("In order to enable stack trace deobfuscation, please specify the '" + PARAMETER_SYMBOL_MAPS
                + "' <init-param> for the " + RemoteLoggerServlet.class.getName() + " servlet in your web.xml");
    }

    accessControlAllowOriginHeader = config.getInitParameter(ACCESS_CONTROL_ALLOW_ORIGIN);
}

From source file:com.googlecode.gwtphonegap.server.log.PhoneGapLogServiceStandardImpl.java

License:Apache License

/**
 * By default, this service does not do any deobfuscation. In order to do
 * server side deobfuscation, you must copy the symbolMaps files to a
 * directory visible to the server and set the directory using this method.
 *
 * @param symbolMapsDir/*from   w  ww. j a v a  2  s. c o m*/
 */
public void setSymbolMapsDirectory(String symbolMapsDir) {
    deobfuscator = StackTraceDeobfuscator.fromFileSystem(symbolMapsDir);
}

From source file:net.scran24.user.server.services.HelpServiceImpl.java

License:Apache License

@Override
public void init() throws ServletException {
    Injector injector = (Injector) this.getServletContext().getAttribute("intake24.injector");

    dataStore = injector.getInstance(DataStore.class);

    twilioClient = new TwilioRestClient(getServletContext().getInitParameter("twilioAccountSid"),
            getServletContext().getInitParameter("twilioAuthToken"));

    smtpHostName = getServletContext().getInitParameter("smtpHostName");
    smtpPort = Integer.parseInt(getServletContext().getInitParameter("smtpPort"));
    smtpUserName = getServletContext().getInitParameter("smtpUserName");
    smtpPassword = getServletContext().getInitParameter("smtpPassword");
    fromEmail = getServletContext().getInitParameter("emailNotificationFromAddress");
    fromName = getServletContext().getInitParameter("emailNotificationFromName");

    fromPhoneNumber = getServletContext().getInitParameter("smsNotificationFromNumber");

    String path = getServletContext().getRealPath("/WEB-INF/deploy/user/symbolMaps");

    log.debug("Symbol maps path: " + path);

    deobfuscator = StackTraceDeobfuscator.fromFileSystem(path);
}

From source file:org.unitime.timetable.gwt.server.UniTimeRemoteLoggingService.java

License:Apache License

@Override
public void init(ServletConfig config) throws ServletException {
    super.init(config);
    String path = config.getServletContext().getRealPath("/WEB-INF/deploy/unitime/symbolMaps/");
    if (path != null)
        iDeobfuscator = StackTraceDeobfuscator.fromFileSystem(path);
}