本文整理汇总了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;
}