Example usage for java.util ResourceBundle getBundle

List of usage examples for java.util ResourceBundle getBundle

Introduction

In this page you can find the example usage for java.util ResourceBundle getBundle.

Prototype

@CallerSensitive
public static final ResourceBundle getBundle(String baseName) 

Source Link

Document

Gets a resource bundle using the specified base name, the default locale, and the caller module.

Usage

From source file:de.mendelson.comm.as2.message.AS2MessageParser.java

public AS2MessageParser() {
    //Load resourcebundle
    try {//from   w  w  w .j  a v  a  2 s .c o  m
        this.rb = (MecResourceBundle) ResourceBundle.getBundle(ResourceBundleAS2MessageParser.class.getName());
        this.rbMessage = (MecResourceBundle) ResourceBundle.getBundle(ResourceBundleAS2Message.class.getName());
    } //load up  resourcebundle
    catch (MissingResourceException e) {
        throw new RuntimeException("Oops..resource bundle " + e.getClassName() + " not found.");
    }
}

From source file:com.cws.esolutions.security.filters.SessionAuthenticationFilter.java

public void init(final FilterConfig filterConfig) throws ServletException {
    final String methodName = SessionAuthenticationFilter.CNAME
            + "#init(final FilterConfig filterConfig) throws ServletException";

    if (DEBUG) {/*  ww w. ja va  2 s . c  om*/
        DEBUGGER.debug(methodName);
        DEBUGGER.debug("FilterConfig: {}", filterConfig);
    }

    ResourceBundle rBundle = null;

    try {
        if (filterConfig.getInitParameter(SessionAuthenticationFilter.FILTER_CONFIG_PARAM_NAME) == null) {
            ERROR_RECORDER.error("Filter configuration not found. Using default !");

            rBundle = ResourceBundle.getBundle(SessionAuthenticationFilter.FILTER_CONFIG_FILE_NAME);
        } else {
            rBundle = ResourceBundle.getBundle(
                    filterConfig.getInitParameter(SessionAuthenticationFilter.FILTER_CONFIG_PARAM_NAME));
        }

        this.loginURI = rBundle.getString(SessionAuthenticationFilter.LOGIN_URI);
        this.passwordURI = rBundle.getString(SessionAuthenticationFilter.PASSWORD_URI);
        this.ignoreURIs = (StringUtils
                .isNotEmpty(rBundle.getString(SessionAuthenticationFilter.IGNORE_URI_LIST)))
                        ? rBundle.getString(SessionAuthenticationFilter.IGNORE_URI_LIST).trim().split(",")
                        : null;

        if (DEBUG) {
            if (this.ignoreURIs != null) {
                for (String str : this.ignoreURIs) {
                    DEBUGGER.debug(str);
                }
            }
        }
    } catch (MissingResourceException mre) {
        ERROR_RECORDER.error(mre.getMessage(), mre);

        throw new UnavailableException(mre.getMessage());
    }
}

From source file:com.getblimp.api.client.Blimp.java

public Blimp(String userName, String apiKey, String applicationId, String applicationSecret) {
    super();//from  www. j a va 2s . c o  m
    this.userName = userName;
    this.apiKey = apiKey;
    this.applicationId = applicationId;
    this.applicationSecret = applicationSecret;
    this.resourceBundle = ResourceBundle.getBundle("blimp-constants");
    this.baseUrl = resourceBundle.getString("base_url");
    Blimp.logger.setLevel(Level.FINER);

}

From source file:com.cws.esolutions.security.filters.SSLEnforcementFilter.java

public void init(final FilterConfig filterConfig) throws ServletException {
    final String methodName = SSLEnforcementFilter.CNAME
            + "#init(FilterConfig filterConfig) throws ServletException";

    if (DEBUG) {//from  w  ww . j av a  2  s . c om
        DEBUGGER.debug(methodName);
        DEBUGGER.debug("FilterConfig: {}", filterConfig);
    }

    ResourceBundle rBundle = null;

    try {
        if (filterConfig.getInitParameter(SSLEnforcementFilter.FILTER_CONFIG_PARAM_NAME) == null) {
            ERROR_RECORDER.error("Filter configuration not found. Using default !");

            rBundle = ResourceBundle.getBundle(SSLEnforcementFilter.FILTER_CONFIG_FILE_NAME);
        } else {
            rBundle = ResourceBundle
                    .getBundle(filterConfig.getInitParameter(SSLEnforcementFilter.FILTER_CONFIG_PARAM_NAME));
        }

        this.ignoreHosts = (StringUtils.isNotEmpty(rBundle.getString(SSLEnforcementFilter.IGNORE_HOST_LIST)))
                ? rBundle.getString(SSLEnforcementFilter.IGNORE_HOST_LIST).trim().split(",")
                : null;
        this.ignoreURIs = (StringUtils.isNotEmpty(rBundle.getString(SSLEnforcementFilter.IGNORE_URI_LIST)))
                ? rBundle.getString(SSLEnforcementFilter.IGNORE_HOST_LIST).trim().split(",")
                : null;

        if (DEBUG) {
            if (this.ignoreHosts != null) {
                for (String str : this.ignoreHosts) {
                    DEBUGGER.debug(str);
                }
            }

            if (this.ignoreURIs != null) {
                for (String str : this.ignoreURIs) {
                    DEBUGGER.debug(str);
                }
            }
        }
    } catch (MissingResourceException mre) {
        ERROR_RECORDER.error(mre.getMessage(), mre);

        throw new UnavailableException(mre.getMessage());
    }
}

From source file:mSearch.tool.Functions.java

public static String getCompileDate() {
    final ResourceBundle rb;
    String propToken = "DATE";
    String msg = "";
    try {// w  w  w .ja  v a2  s . co m
        ResourceBundle.clearCache();
        rb = ResourceBundle.getBundle("version");
        msg = rb.getString(propToken);
    } catch (Exception e) {
        Log.errorLog(807293847, e);
    }
    return msg;
}

From source file:de.knowwe.defi.time.TimeTableUtilities.java

/**
 * Get the timetable template's pagename.
 *//*  www . j  a  v  a  2  s . c  o  m*/
public static String getTimeTableTemplatePagename() {
    return ResourceBundle.getBundle("KnowWE_Defi_config").getString("defi.timetable.pagename");
}

From source file:com.sun.socialsite.util.TextUtil.java

private static ResourceBundle getDefaultBundle() {
    return ResourceBundle.getBundle(DEFAULT_BUNDLE_NAME);
}

From source file:msearch.tool.MSFunktionen.java

public static String getBuildNr() {
    final ResourceBundle rb;
    String propToken = "BUILD";
    String msg = "";
    try {//  w w w .j  a va  2s  .c o m
        ResourceBundle.clearCache();
        rb = ResourceBundle.getBundle("version");
        msg = rb.getString(propToken);
    } catch (Exception e) {
        MSLog.fehlerMeldung(134679898, MSLog.FEHLER_ART_PROG, MSFunktionen.class.getName(), e);
    }
    return msg;
}

From source file:net.rptools.tokentool.client.TokenTool.java

@Override
public void start(Stage primaryStage) throws IOException {
    stage = primaryStage;/*from w  w  w  .j  a  va 2 s. c  om*/
    setUserAgentStylesheet(STYLESHEET_MODENA); // Setting the style back to the new Modena
    FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(AppConstants.TOKEN_TOOL_FXML),
            ResourceBundle.getBundle(AppConstants.TOKEN_TOOL_BUNDLE));
    root = fxmlLoader.load();
    tokentool_Controller = (TokenTool_Controller) fxmlLoader.getController();

    Scene scene = new Scene(root);
    primaryStage.setTitle(I18N.getString("TokenTool.stage.title"));
    primaryStage.getIcons().add(new Image(getClass().getResourceAsStream(AppConstants.TOKEN_TOOL_ICON)));
    primaryStage.setScene(scene);

    primaryStage.widthProperty().addListener((obs, oldVal, newVal) -> {
        if (Double.isNaN(oldVal.doubleValue()))
            return;

        deltaX += newVal.doubleValue() - oldVal.doubleValue();

        // Only adjust on even width adjustments
        if (deltaX > 1 || deltaX < -1) {
            if (deltaX % 2 == 0) {
                tokentool_Controller.updatePortraitLocation(deltaX, 0);
                deltaX = 0;
            } else {
                tokentool_Controller.updatePortraitLocation(deltaX - 1, 0);
                deltaX = 1;
            }
        }
    });

    primaryStage.heightProperty().addListener((obs, oldVal, newVal) -> {
        if (Double.isNaN(oldVal.doubleValue()))
            return;

        deltaY += newVal.doubleValue() - oldVal.doubleValue();

        // Only adjust on even width adjustments
        if (deltaY > 1 || deltaY < -1) {
            if (deltaY % 2 == 0) {
                tokentool_Controller.updatePortraitLocation(0, deltaY);
                deltaY = 0;
            } else {
                tokentool_Controller.updatePortraitLocation(0, deltaY - 1);
                deltaY = 1;
            }
        }
    });

    primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
        @Override
        public void handle(WindowEvent event) {
            tokentool_Controller.exitApplication();
        }
    });

    // Load all the overlays into the treeview
    tokentool_Controller.updateOverlayTreeview(overlayTreeItems);

    // Restore saved settings
    AppPreferences.restorePreferences(tokentool_Controller);

    // Add recent list to treeview
    tokentool_Controller.updateOverlayTreeViewRecentFolder(true);

    // Set the Overlay Options accordion to be default open view
    tokentool_Controller.expandOverlayOptionsPane(true);

    primaryStage.show();

    // Finally, update token preview image after everything is done loading
    Platform.runLater(() -> tokentool_Controller.updateTokenPreviewImageView());
}

From source file:com.sun.socialsite.util.TextUtil.java

private static ResourceBundle getCustomBundle() {
    return ResourceBundle.getBundle(CUSTOM_BUNDLE_NAME);
}