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


Java FileUtil.getShortFileName方法代码示例

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


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

示例1: addDDMStructures

import com.liferay.portal.kernel.util.FileUtil; //导入方法依赖的package包/类
protected void addDDMStructures(
		String parentStructureId, String structuresDirName)
	throws Exception {

	Set<String> resourcePaths = servletContext.getResourcePaths(
		resourcesDir.concat(structuresDirName));

	if (resourcePaths == null) {
		return;
	}

	for (String resourcePath : resourcePaths) {
		if (resourcePath.endsWith(StringPool.SLASH)) {
			continue;
		}

		String name = FileUtil.getShortFileName(resourcePath);

		URL url = servletContext.getResource(resourcePath);

		URLConnection urlConnection = url.openConnection();

		addDDMStructures(
			parentStructureId, name, urlConnection.getInputStream());
	}
}
 
开发者ID:rivetlogic,项目名称:liferay-evernote,代码行数:27,代码来源:ResourceImporter.java

示例2: addDDMTemplates

import com.liferay.portal.kernel.util.FileUtil; //导入方法依赖的package包/类
protected void addDDMTemplates(
		String ddmStructureKey, String templatesDirName)
	throws Exception {

	Set<String> resourcePaths = servletContext.getResourcePaths(
		resourcesDir.concat(templatesDirName));

	if (resourcePaths == null) {
		return;
	}

	for (String resourcePath : resourcePaths) {
		if (resourcePath.endsWith(StringPool.SLASH)) {
			continue;
		}

		String name = FileUtil.getShortFileName(resourcePath);

		URL url = servletContext.getResource(resourcePath);

		URLConnection urlConnection = url.openConnection();

		addDDMTemplates(
			ddmStructureKey, name, urlConnection.getInputStream());
	}
}
 
开发者ID:rivetlogic,项目名称:liferay-evernote,代码行数:27,代码来源:ResourceImporter.java

示例3: addDDMTemplates

import com.liferay.portal.kernel.util.FileUtil; //导入方法依赖的package包/类
protected void addDDMTemplates(String ddmStructureKey, String dirName)
	throws Exception {

	Set<String> resourcePaths = servletContext.getResourcePaths(
		resourcesDir.concat(dirName));

	if (resourcePaths == null) {
		return;
	}

	for (String resourcePath : resourcePaths) {
		if (resourcePath.endsWith(StringPool.SLASH)) {
			continue;
		}

		String name = FileUtil.getShortFileName(resourcePath);

		URL url = servletContext.getResource(resourcePath);

		URLConnection urlConnection = url.openConnection();

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

示例4: addDDMTemplate

import com.liferay.portal.kernel.util.FileUtil; //导入方法依赖的package包/类
protected void addDDMTemplate(
		long templateGroupId, long ddmStructureId, String fileName,
		String language, String script, String type, String mode)
	throws Exception {

	fileName = FileUtil.getShortFileName(fileName);

	fileName = FileUtil.stripExtension(fileName);

	String name = getName(fileName);

	DDMTemplate ddmTemplate = DDMTemplateLocalServiceUtil.fetchTemplate(
		groupId, PortalUtil.getClassNameId(DDMStructure.class),
		getKey(fileName));

	if (ddmTemplate != null) {
		if (!developerModeEnabled) {
			if (_log.isInfoEnabled()) {
				_log.info(
					"DDM template with name " + name + " and version " +
						version + " already exists");
			}

			return;
		}

		DDMTemplateLocalServiceUtil.deleteTemplate(ddmTemplate);
	}

	DDMTemplateLocalServiceUtil.addTemplate(
		userId, templateGroupId,
		PortalUtil.getClassNameId(DDMStructure.class), ddmStructureId,
		getKey(fileName), getMap(name), null, type, mode, language, script,
		false, false, StringPool.BLANK, null, serviceContext);
}
 
开发者ID:rivetlogic,项目名称:liferay-voice-command,代码行数:36,代码来源:FileSystemImporter.java

示例5: addJournalArticles

import com.liferay.portal.kernel.util.FileUtil; //导入方法依赖的package包/类
protected void addJournalArticles(
		String ddmStructureKey, String ddmTemplateKey,
		String articlesDirName)
	throws Exception {

	Set<String> resourcePaths = servletContext.getResourcePaths(
		resourcesDir.concat(articlesDirName));

	if (resourcePaths == null) {
		return;
	}

	for (String resourcePath : resourcePaths) {
		if (resourcePath.endsWith(StringPool.SLASH)) {
			continue;
		}

		String name = FileUtil.getShortFileName(resourcePath);

		URL url = servletContext.getResource(resourcePath);

		URLConnection urlConnection = url.openConnection();

		addJournalArticles(
			ddmStructureKey, ddmTemplateKey, name,
			urlConnection.getInputStream());
	}
}
 
开发者ID:rivetlogic,项目名称:liferay-evernote,代码行数:29,代码来源:ResourceImporter.java

示例6: addDLFolder

import com.liferay.portal.kernel.util.FileUtil; //导入方法依赖的package包/类
protected long addDLFolder(long parentFolderId, String resourcePath)
	throws Exception {

	long folderId = super.addDLFolder(
		parentFolderId,
		FileUtil.getShortFileName(FileUtil.getPath(resourcePath)));

	_folderIds.put(resourcePath, folderId);

	Set<String> resourcePaths = servletContext.getResourcePaths(
		resourcePath);

	if ((resourcePaths == null) || resourcePaths.isEmpty()) {
		return folderId;
	}

	for (String curResourcePath : resourcePaths) {
		if (curResourcePath.endsWith(StringPool.SLASH)) {
			addDLFolder(folderId, curResourcePath);
		}
		else {
			addDLFileEntry(curResourcePath);
		}
	}

	return folderId;
}
 
开发者ID:rivetlogic,项目名称:liferay-voice-command,代码行数:28,代码来源:ResourceImporter.java

示例7: addJournalArticles

import com.liferay.portal.kernel.util.FileUtil; //导入方法依赖的package包/类
protected void addJournalArticles(
		String ddmStructureKey, String ddmTemplateKey, String dirName)
	throws Exception {

	Set<String> resourcePaths = servletContext.getResourcePaths(
		resourcesDir.concat(dirName));

	if (resourcePaths == null) {
		return;
	}

	for (String resourcePath : resourcePaths) {
		if (resourcePath.endsWith(StringPool.SLASH)) {
			continue;
		}

		String name = FileUtil.getShortFileName(resourcePath);

		URL url = servletContext.getResource(resourcePath);

		URLConnection urlConnection = url.openConnection();

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


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