Java 类org.springframework.core.io.support.LocalizedResourceHelper 实例源码

项目:Spring-MVC-Blueprints    文件:AbstractExcelView.java   
protected Workbook getTemplateSource(String url, HttpServletRequest request) throws Exception {
    LocalizedResourceHelper helper = new LocalizedResourceHelper(getApplicationContext());
    Locale userLocale = RequestContextUtils.getLocale(request);
    Resource inputFile = helper.findLocalizedResource(url, EXTENSION, userLocale);

    // Create the Excel document from the source.
    if (logger.isDebugEnabled()) {
        logger.debug("Loading Excel workbook from " + inputFile);
    }
    //POIFSFileSystem fs = new POIFSFileSystem(inputFile.getInputStream());
    return new XSSFWorkbook(inputFile.getInputStream());
}
项目:spring4-understanding    文件:AbstractJExcelView.java   
/**
 * Create the workbook from an existing XLS document.
 * @param url the URL of the Excel template without localization part nor extension
 * @param request current HTTP request
 * @return the template workbook
 * @throws Exception in case of failure
 */
protected Workbook getTemplateSource(String url, HttpServletRequest request) throws Exception {
    LocalizedResourceHelper helper = new LocalizedResourceHelper(getApplicationContext());
    Locale userLocale = RequestContextUtils.getLocale(request);
    Resource inputFile = helper.findLocalizedResource(url, EXTENSION, userLocale);

    // Create the Excel document from the source.
    if (logger.isDebugEnabled()) {
        logger.debug("Loading Excel workbook from " + inputFile);
    }
    return Workbook.getWorkbook(inputFile.getInputStream());
}
项目:spring4-understanding    文件:AbstractExcelView.java   
/**
 * Creates the workbook from an existing XLS document.
 * @param url the URL of the Excel template without localization part nor extension
 * @param request current HTTP request
 * @return the HSSFWorkbook
 * @throws Exception in case of failure
 */
protected HSSFWorkbook getTemplateSource(String url, HttpServletRequest request) throws Exception {
    LocalizedResourceHelper helper = new LocalizedResourceHelper(getApplicationContext());
    Locale userLocale = RequestContextUtils.getLocale(request);
    Resource inputFile = helper.findLocalizedResource(url, EXTENSION, userLocale);

    // Create the Excel document from the source.
    if (logger.isDebugEnabled()) {
        logger.debug("Loading Excel workbook from " + inputFile);
    }
    return new HSSFWorkbook(inputFile.getInputStream());
}
项目:JDeSurvey    文件:AbstractJExcelView2.java   
/**
 * Create the workbook from an existing XLS document.
 * @param url the URL of the Excel template without localization part nor extension
 * @param request current HTTP request
 * @return the template workbook
 * @throws Exception in case of failure
 */
protected Workbook getTemplateSource(String url, HttpServletRequest request) throws Exception {
    LocalizedResourceHelper helper = new LocalizedResourceHelper(getApplicationContext());
    Locale userLocale = RequestContextUtils.getLocale(request);
    Resource inputFile = helper.findLocalizedResource(url, EXTENSION, userLocale);

    // Create the Excel document from the source.
    if (logger.isDebugEnabled()) {
        logger.debug("Loading Excel workbook from " + inputFile);
    }
    return Workbook.getWorkbook(inputFile.getInputStream());
}
项目:class-guard    文件:AbstractJExcelView.java   
/**
 * Create the workbook from an existing XLS document.
 * @param url the URL of the Excel template without localization part nor extension
 * @param request current HTTP request
 * @return the template workbook
 * @throws Exception in case of failure
 */
protected Workbook getTemplateSource(String url, HttpServletRequest request) throws Exception {
    LocalizedResourceHelper helper = new LocalizedResourceHelper(getApplicationContext());
    Locale userLocale = RequestContextUtils.getLocale(request);
    Resource inputFile = helper.findLocalizedResource(url, EXTENSION, userLocale);

    // Create the Excel document from the source.
    if (logger.isDebugEnabled()) {
        logger.debug("Loading Excel workbook from " + inputFile);
    }
    return Workbook.getWorkbook(inputFile.getInputStream());
}
项目:class-guard    文件:AbstractExcelView.java   
/**
 * Creates the workbook from an existing XLS document.
 * @param url the URL of the Excel template without localization part nor extension
 * @param request current HTTP request
 * @return the HSSFWorkbook
 * @throws Exception in case of failure
 */
protected HSSFWorkbook getTemplateSource(String url, HttpServletRequest request) throws Exception {
    LocalizedResourceHelper helper = new LocalizedResourceHelper(getApplicationContext());
    Locale userLocale = RequestContextUtils.getLocale(request);
    Resource inputFile = helper.findLocalizedResource(url, EXTENSION, userLocale);

    // Create the Excel document from the source.
    if (logger.isDebugEnabled()) {
        logger.debug("Loading Excel workbook from " + inputFile);
    }
    POIFSFileSystem fs = new POIFSFileSystem(inputFile.getInputStream());
    return new HSSFWorkbook(fs);
}