当前位置: 首页>>代码示例>>Java>>正文


Java FileUtil.getExtension方法代码示例

本文整理汇总了Java中com.liferay.portal.kernel.util.FileUtil.getExtension方法的典型用法代码示例。如果您正苦于以下问题:Java FileUtil.getExtension方法的具体用法?Java FileUtil.getExtension怎么用?Java FileUtil.getExtension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.liferay.portal.kernel.util.FileUtil的用法示例。


在下文中一共展示了FileUtil.getExtension方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addLayoutTemplate

import com.liferay.portal.kernel.util.FileUtil; //导入方法依赖的package包/类
protected void addLayoutTemplate(String dirName) throws Exception {
	Set<String> resourcePaths = servletContext.getResourcePaths(
		resourcesDir.concat(dirName));

	if (resourcePaths == null) {
		return;
	}

	for (String resourcePath : resourcePaths) {
		String extension = FileUtil.getExtension(resourcePath);

		if (!extension.equals("json")) {
			return;
		}

		URL url = servletContext.getResource(resourcePath);

		URLConnection urlConnection = url.openConnection();

		addLayoutTemplate(urlConnection.getInputStream());
	}
}
 
开发者ID:rivetlogic,项目名称:liferay-voice-command,代码行数:23,代码来源:ResourceImporter.java

示例2: getDDMTemplateLanguage

import com.liferay.portal.kernel.util.FileUtil; //导入方法依赖的package包/类
protected String getDDMTemplateLanguage(String fileName) {
	String extension = FileUtil.getExtension(fileName);

	if (extension.equals(TemplateConstants.LANG_TYPE_CSS) ||
		extension.equals(TemplateConstants.LANG_TYPE_FTL) ||
		extension.equals(TemplateConstants.LANG_TYPE_VM) ||
		extension.equals(TemplateConstants.LANG_TYPE_XSL)) {

		return extension;
	}

	return TemplateConstants.LANG_TYPE_VM;
}
 
开发者ID:rivetlogic,项目名称:liferay-evernote,代码行数:14,代码来源:FileSystemImporter.java

示例3: importData

import com.liferay.portal.kernel.util.FileUtil; //导入方法依赖的package包/类
protected void importData(ActionRequest actionRequest, String fileName, InputStream inputStream) throws Exception {

        _log.info("importData()");
                
        String extension = FileUtil.getExtension(fileName); 

        _log.info("extension = " + extension);
        
        ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);

        long groupId = ParamUtil.getLong(actionRequest, "groupId");
        boolean privateLayout = ParamUtil.getBoolean(actionRequest, "privateLayout");
        
        // TODO: remove dependency from ExportImportConfigurationSettingsMapFactory (see below)

        Map<String, Serializable> importLayoutSettingsMap = ExportImportConfigurationSettingsMapFactory
                .buildImportLayoutSettingsMap(themeDisplay.getUserId(), groupId, privateLayout, null,
                        actionRequest.getParameterMap(), themeDisplay.getLocale(), themeDisplay.getTimeZone());

        ExportImportConfiguration exportImportConfiguration = _exportImportConfigurationLocalService
                .addDraftExportImportConfiguration(themeDisplay.getUserId(),
                        ExportImportConfigurationConstants.TYPE_IMPORT_LAYOUT, importLayoutSettingsMap);

        _taskRecordService.importTaskRecordsInBackground(exportImportConfiguration, inputStream, extension);

    }
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:27,代码来源:ImportTaskRecordsMVCActionCommand.java

示例4: importData

import com.liferay.portal.kernel.util.FileUtil; //导入方法依赖的package包/类
protected void importData(ActionRequest actionRequest, String fileName, InputStream inputStream) throws Exception {

        _log.info("importData()");

        String extension = FileUtil.getExtension(fileName);

        _log.info("extension = " + extension);

        ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);

        long groupId = ParamUtil.getLong(actionRequest, "groupId");

        Map<String, Serializable> importMeasurementSettingsMap = ExportImportConfigurationSettingsMapFactory
                .buildImportMeasurementsSettingsMap(themeDisplay.getUserId(), groupId, actionRequest.getParameterMap(),
                        themeDisplay.getLocale(), themeDisplay.getTimeZone());

        // TODO: reconsider addDraft...
        // TODO: reconsider TYPE_IMPORT_LAYOUT
        ExportImportConfiguration exportImportConfiguration = _exportImportConfigurationLocalService
                .addDraftExportImportConfiguration(themeDisplay.getUserId(),
                        ExportImportConfigurationConstants.TYPE_IMPORT_LAYOUT, importMeasurementSettingsMap);

        _measurementService.importMeasurementsInBackground(exportImportConfiguration, inputStream, extension);

    }
 
开发者ID:inofix,项目名称:ch-inofix-data-manager,代码行数:26,代码来源:ImportMeasurementsMVCActionCommand.java

示例5: importData

import com.liferay.portal.kernel.util.FileUtil; //导入方法依赖的package包/类
protected void importData(ActionRequest actionRequest, String fileName, InputStream inputStream) throws Exception {

        _log.info("importData()");
                
        String extension = FileUtil.getExtension(fileName); 

        _log.info("extension = " + extension);
                
        ExportImportConfiguration exportImportConfiguration = getExportImportConfiguration(actionRequest);

        _contactService.importContactsInBackground(exportImportConfiguration, inputStream, extension);

    }
 
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:14,代码来源:ImportContactsMVCActionCommand.java

示例6: getFileName

import com.liferay.portal.kernel.util.FileUtil; //导入方法依赖的package包/类
/**
 * Auto generate filename for comunicate with multi system
 * 
 * @param sourceFileName
 * @return
 */
private static String getFileName(String sourceFileName) {
	String ext = FileUtil.getExtension(sourceFileName);
	
	return System.currentTimeMillis() + "." + ext;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:12,代码来源:FileUploadUtils.java


注:本文中的com.liferay.portal.kernel.util.FileUtil.getExtension方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。