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


Java MultipartFile.toString方法代码示例

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


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

示例1: updatePlatformLocal

import org.springframework.web.multipart.MultipartFile; //导入方法依赖的package包/类
@Deprecated
@RequestMapping ( value = UPDATE_PLATFORM , produces = MediaType.APPLICATION_JSON_VALUE )
public ObjectNode updatePlatformLocal (
										@RequestParam ( value = "extractDir" , required = true ) String extractToken,
										@RequestParam ( value = "chownUserid" , required = false ) String chownUserid,
										@RequestParam ( value = "timeoutSeconds" , required = false , defaultValue = "120" ) int timeoutSeconds,
										@RequestParam ( value = "deleteExisting" , required = false ) String deleteExisting,
										@RequestParam ( value = "auditUser" , required = false ) String auditUser,
										@RequestParam ( value = "distFile" , required = true ) MultipartFile multiPartFile,
										HttpServletRequest request ) {

	String extractDir = extractToken;
	if ( extractDir.startsWith( Application.FileToken.STAGING.value ) ) {
		// STAGING_TOKEN is used as csap install folder might be different;
		// full paths are not passed when syncing elements between hosts.
		extractDir = extractDir.replaceAll( Application.FileToken.STAGING.value, csapApp.stagingFolderAsString() );
	}

	String desc = multiPartFile.toString();
	if ( multiPartFile != null ) {
		desc = multiPartFile.getOriginalFilename() + " size: " + multiPartFile.getSize();
	}

	logger.info(
		"File System being updated using: {}\t extractToken: {}\t extractDir: {}\n\t chownUserid: {} \t timeoutSeconds: {}\t deleteExisting: {}",
		desc, extractToken, extractDir, chownUserid, timeoutSeconds, deleteExisting );

	ObjectNode jsonObjectResponse = jacksonMapper.createObjectNode();
	jsonObjectResponse.put( "host", Application.getHOST_NAME() );

	ArrayNode coreArray = jsonObjectResponse.putArray( "coreResults" );

	// MUST be the first line otherwise remote parsing will fail in
	// Transfermanager
	StringBuilder plainTextResponse = new StringBuilder( CSAP.AGENT_CONTEXT + "@"
			+ Application.getHOST_NAME() + ":" );

	String servletRemoteHost = request.getRemoteHost();

	if ( !csapApp.isHostAuthenticatedMember( servletRemoteHost ) ) {

		logger.error( "Security WARNING: bypass auth from {}", servletRemoteHost );
		plainTextResponse.append( "**" + CSAP.CONFIG_PARSE_ERROR + " Host "
				+ Application.getHOST_NAME()
				+ " received request from a host not in its cluster lifecycle: "
				+ servletRemoteHost );
		coreArray.add( "**" + CSAP.CONFIG_PARSE_ERROR + " Host "
				+ Application.getHOST_NAME()
				+ " received request from a host not in its cluster lifecycle: "
				+ servletRemoteHost );

		if ( !Application.isRunningOnDesktop() ) {
			return jsonObjectResponse;
		}
	} else {
		jsonObjectResponse = agentApi.platformUpdate( auditUser, "Dummy", extractToken, chownUserid, timeoutSeconds, deleteExisting,
			auditUser, multiPartFile, request );
	}

	return jsonObjectResponse;
}
 
开发者ID:csap-platform,项目名称:csap-core,代码行数:62,代码来源:HostRequests.java


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