org.apache.log4j.lf5.util.StreamUtils#org.glassfish.jersey.media.multipart.FormDataParam源码实例Demo

下面列出了org.apache.log4j.lf5.util.StreamUtils#org.glassfish.jersey.media.multipart.FormDataParam 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: o2oa   文件: AppStyleAction.java
@JaxrsMethodDescribe(value = "设置图片:启动页的logo,195x195.", action = ActionImageLaunchLogo.class)
@PUT
@Path("image/launch/logo")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
public void imageLaunchLogo(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
		@FormDataParam(FILE_FIELD) final byte[] bytes,
		@JaxrsParameterDescribe("图片文件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<ActionImageLaunchLogo.Wo> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionImageLaunchLogo().execute(effectivePerson, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码2 项目: o2oa   文件: FileInfoAction.java
@JaxrsMethodDescribe(value = "为文档信息上传附件(带回调).", action = ActionFileUploadCallback.class)
@POST
@Path("upload/document/{docId}/callback/{callback}")
@Produces(HttpMediaType.TEXT_HTML_UTF_8)
@Consumes(MediaType.MULTIPART_FORM_DATA)
public void attachmentUploadCallback(@Suspended final AsyncResponse asyncResponse, 
		@Context HttpServletRequest request, 
		@JaxrsParameterDescribe("文档ID") @PathParam("docId") String docId, 
		@JaxrsParameterDescribe("回调函数名") @PathParam("callback") String callback,
		@JaxrsParameterDescribe("位置") @FormDataParam("site") String site,
		@JaxrsParameterDescribe("附件名称") @FormDataParam(FILENAME_FIELD) String fileName,
		@FormDataParam(FILE_FIELD) final byte[] bytes,
		@JaxrsParameterDescribe("附件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<ActionFileUploadCallback.Wo<ActionFileUploadCallback.WoObject>> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = ((ActionFileUploadCallback)proxy.getProxy(ActionFileUploadCallback.class)).execute(request, effectivePerson, docId, callback, site, fileName, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码3 项目: judgels   文件: UserAvatarResource.java
@POST
@Consumes(MULTIPART_FORM_DATA)
@UnitOfWork
public void updateUserAvatar(
        @HeaderParam(AUTHORIZATION) AuthHeader authHeader,
        @HeaderParam(CONTENT_LENGTH) int contentLength,
        @PathParam("userJid") String userJid,
        @FormDataParam("file") InputStream fileStream,
        @FormDataParam("file") FormDataContentDisposition fileDetails) {

    String actorJid = actorChecker.check(authHeader);
    checkAllowed(roleChecker.canManage(actorJid, userJid));

    User user = checkFound(userStore.getUserByJid(userJid));

    String extension = Files.getFileExtension(fileDetails.getFileName());
    String destFilename = user.getJid() + "-" + RandomCodeGenerator.newCode() + "." + extension;

    avatarFs.uploadPublicFile(Paths.get(destFilename), fileStream);
    userStore.updateUserAvatar(user.getJid(), destFilename);
}
 
源代码4 项目: judgels   文件: ContestFileResource.java
@POST
@Path("/")
@Consumes(MULTIPART_FORM_DATA)
@UnitOfWork
public void uploadFile(
        @HeaderParam(AUTHORIZATION) AuthHeader authHeader,
        @HeaderParam(CONTENT_LENGTH) int contentLength,
        @PathParam("contestJid") String contestJid,
        @FormDataParam("file") InputStream fileStream,
        @FormDataParam("file") FormDataContentDisposition fileDetails) {

    String actorJid = actorChecker.check(authHeader);
    Contest contest = checkFound(contestStore.getContestByJid(contestJid));
    checkAllowed(fileRoleChecker.canManage(actorJid, contest));

    fileFs.uploadPrivateFile(Paths.get(contestJid, fileDetails.getFileName()), fileStream);
}
 
源代码5 项目: o2oa   文件: InvokeAction.java
@JaxrsMethodDescribe(value = "更新调用接口内容.", action = ActionUpdate.class)
@PUT
@Path("{flag}/file")
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
@Consumes(MediaType.MULTIPART_FORM_DATA)
public void update(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
		@JaxrsParameterDescribe("标识") @PathParam("flag") String flag, @FormDataParam(FILE_FIELD) final byte[] bytes,
		@JaxrsParameterDescribe("附件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<ActionUpdate.Wo> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionUpdate().execute(effectivePerson, flag, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码6 项目: o2oa   文件: AppStyleAction.java
@JaxrsMethodDescribe(value = "设置图片:首页底部菜单中间主页的按钮(选中),114x114", action = ActionImageMenuLogoFocus.class)
@PUT
@Path("image/menu/logo/focus")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
public void imageMenuLogoFocus(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
		@FormDataParam(FILE_FIELD) final byte[] bytes,
		@JaxrsParameterDescribe("图片文件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<ActionImageMenuLogoFocus.Wo> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionImageMenuLogoFocus().execute(effectivePerson, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码7 项目: openapi-generator   文件: PetApi.java
@POST
    @Path("/{petId}/uploadImage")
    @Consumes({ "multipart/form-data" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = {
        @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
            @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
            @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
        })
    }, tags={ "pet", })
    @io.swagger.annotations.ApiResponses(value = { 
        @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
    public Response uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathParam("petId") @NotNull  Long petId
,@ApiParam(value = "Additional data to pass to server")@FormDataParam("additionalMetadata")  String additionalMetadata
,
            @FormDataParam("file") InputStream fileInputStream,
            @FormDataParam("file") FormDataContentDisposition fileDetail
,@Context SecurityContext securityContext)
    throws NotFoundException {
        return delegate.uploadFile(petId, additionalMetadata, fileInputStream, fileDetail, securityContext);
    }
 
源代码8 项目: openapi-generator   文件: FakeApi.java
@POST
    @Path("/{petId}/uploadImageWithRequiredFile")
    @Consumes({ "multipart/form-data" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "uploads an image (required)", notes = "", response = ModelApiResponse.class, authorizations = {
        @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
            @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
            @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
        })
    }, tags={ "pet", })
    @io.swagger.annotations.ApiResponses(value = { 
        @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
    public Response uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathParam("petId") @NotNull  Long petId
,
            @FormDataParam("requiredFile") InputStream requiredFileInputStream,
            @FormDataParam("requiredFile") FormDataContentDisposition requiredFileDetail
,@ApiParam(value = "Additional data to pass to server")@FormDataParam("additionalMetadata")  String additionalMetadata
,@Context SecurityContext securityContext)
    throws NotFoundException {
        return delegate.uploadFileWithRequiredFile(petId, requiredFileInputStream, requiredFileDetail, additionalMetadata, securityContext);
    }
 
源代码9 项目: o2oa   文件: FileImportExportAction.java
@JaxrsMethodDescribe(value = "上传需要导入的数据文件XLS", action = StandardJaxrsAction.class)
@POST
@Path("upload")
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
@Consumes(MediaType.MULTIPART_FORM_DATA)
public void upload(@Suspended final AsyncResponse asyncResponse, 
		@Context HttpServletRequest request, 
		@FormDataParam(FILE_FIELD) final byte[] bytes,
		@FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition
) {
	ActionResult<WrapOutId> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionImportFileUpload().execute(request, effectivePerson, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码10 项目: o2oa   文件: SysResourceAction.java
@JaxrsMethodDescribe(value = "上传静态资源(仅上传到当前服务器)", action = ActionUploadResource.class)
@POST
@Path("upload/resource/as/new/{asNew}")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
public void uploadResource(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
						   @JaxrsParameterDescribe("覆盖类型:true删除原文件然后上传,false覆盖原文件") @PathParam("asNew") Boolean asNew,
						   @JaxrsParameterDescribe("附件名称") @FormDataParam(FILENAME_FIELD) String fileName,
						   @JaxrsParameterDescribe("附件存放目录(可以为空)") @FormDataParam("filePath") String filePath,
						   @JaxrsParameterDescribe("附件标识") @FormDataParam(FILE_FIELD) final byte[] bytes,
						   @JaxrsParameterDescribe("上传文件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<ActionUploadResource.Wo> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionUploadResource().execute(effectivePerson, asNew, fileName, filePath, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码11 项目: openapi-generator   文件: PetApi.java
@POST
    @Path("/pet/{petId}/uploadImage")
    @Consumes({ "multipart/form-data" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = {
        @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
            @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
            @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
        })
    }, tags={ "pet", })
    @io.swagger.annotations.ApiResponses(value = { 
        @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
    public Response uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathParam("petId") @NotNull  Long petId
,@ApiParam(value = "Additional data to pass to server")@FormDataParam("additionalMetadata")  String additionalMetadata
,
            @FormDataParam("file") InputStream fileInputStream,
            @FormDataParam("file") FormDataContentDisposition fileDetail
,@Context SecurityContext securityContext)
    throws NotFoundException {
        return delegate.uploadFile(petId, additionalMetadata, fileInputStream, fileDetail, securityContext);
    }
 
源代码12 项目: openapi-generator   文件: PetApi.java
@POST
    @Path("/fake/{petId}/uploadImageWithRequiredFile")
    @Consumes({ "multipart/form-data" })
    @Produces({ "application/json" })
    @io.swagger.annotations.ApiOperation(value = "uploads an image (required)", notes = "", response = ModelApiResponse.class, authorizations = {
        @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
            @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
            @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
        })
    }, tags={ "pet", })
    @io.swagger.annotations.ApiResponses(value = { 
        @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
    public Response uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathParam("petId") @NotNull  Long petId
,
            @FormDataParam("requiredFile") InputStream requiredFileInputStream,
            @FormDataParam("requiredFile") FormDataContentDisposition requiredFileDetail
,@ApiParam(value = "Additional data to pass to server")@FormDataParam("additionalMetadata")  String additionalMetadata
,@Context SecurityContext securityContext)
    throws NotFoundException {
        return delegate.uploadFileWithRequiredFile(petId, requiredFileInputStream, requiredFileDetail, additionalMetadata, securityContext);
    }
 
源代码13 项目: o2oa   文件: AttachmentAction.java
@JaxrsMethodDescribe(value = "上传附件.", action = StandardJaxrsAction.class)
@POST
@Path("upload/subject/{subjectId}")
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
@Consumes(MediaType.MULTIPART_FORM_DATA)
public void upload(@Suspended final AsyncResponse asyncResponse, 
		@Context HttpServletRequest request, 
		@JaxrsParameterDescribe("主贴ID") @PathParam("subjectId") String subjectId, 
		@JaxrsParameterDescribe("位置") @FormDataParam("site") String site, 
		@FormDataParam(FILE_FIELD) final byte[] bytes,
		@FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<ActionUpload.Wo> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionUpload().execute(request, effectivePerson, subjectId, site, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码14 项目: blog-tutorials   文件: FileUploadResource.java
@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
public void uploadFile(@FormDataParam("file") InputStream uploadedInputStream,
		@FormDataParam("file") FormDataContentDisposition fileDetail) throws IOException {

	ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
	byte[] buffer = new byte[1024];
	int len;

	while ((len = uploadedInputStream.read(buffer)) != -1) {
		byteArrayOutputStream.write(buffer, 0, len);
	}

	FileUpload upload = new FileUpload(fileDetail.getFileName(), fileDetail.getType(),
			byteArrayOutputStream.toByteArray());

	em.persist(upload);
}
 
源代码15 项目: o2oa   文件: FileInfoAction.java
@JaxrsMethodDescribe(value = "为文档信息上传附件(带回调).", action = ActionFileUpdateCallback.class)
@POST
@Path("update/document/{docId}/attachment/{id}/callback/{callback}")
@Produces(HttpMediaType.TEXT_HTML_UTF_8)
@Consumes(MediaType.MULTIPART_FORM_DATA)
public void attachmentUpdateCallback(@Suspended final AsyncResponse asyncResponse, 
		@Context HttpServletRequest request, 
		@JaxrsParameterDescribe("文档ID") @PathParam("docId") String docId, 
		@JaxrsParameterDescribe("附件ID") @PathParam("id") String id, 
		@JaxrsParameterDescribe("回调函数名") @PathParam("callback") String callback,
		@JaxrsParameterDescribe("位置") @FormDataParam("site") String site,
		@JaxrsParameterDescribe("附件名称") @FormDataParam(FILENAME_FIELD) String fileName,
		@FormDataParam(FILE_FIELD) final byte[] bytes,
		@JaxrsParameterDescribe("附件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<ActionFileUpdateCallback.Wo<ActionFileUpdateCallback.WoObject>> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = ((ActionFileUpdateCallback)proxy.getProxy(ActionFileUpdateCallback.class)).execute(request, effectivePerson, docId, id, callback, site, fileName, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码16 项目: o2oa   文件: PersonAction.java
@JaxrsMethodDescribe(value = "设置个人的头像.", action = ActionSetIcon.class)
@PUT
@Path("{flag}/icon")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
public void setIcon(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
		@JaxrsParameterDescribe("个人标识") @PathParam("flag") String flag,
		@FormDataParam(FILE_FIELD) final byte[] bytes,
		@JaxrsParameterDescribe("头像文件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<ActionSetIcon.Wo> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionSetIcon().execute(effectivePerson, flag, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码17 项目: o2oa   文件: ShareAction.java
@JaxrsMethodDescribe(value = "保存到网盘", action = ActionSaveToFolder.class)
@POST
@Path("share/{shareId}/file/{fileId}/folder/{folderId}")
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
@Consumes(MediaType.APPLICATION_JSON)
public void saveToFolder(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
				@JaxrsParameterDescribe("共享文件ID") @PathParam("shareId") String shareId,
				@JaxrsParameterDescribe("转存文件ID") @PathParam("fileId") String fileId,
				@JaxrsParameterDescribe("转存目录ID") @PathParam("folderId") String folderId,
				@JaxrsParameterDescribe("共享密码") @FormDataParam("password") String password) {
	ActionResult<ActionSaveToFolder.Wo> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionSaveToFolder().execute(effectivePerson, shareId, fileId, folderId, password);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码18 项目: o2oa   文件: TestAction.java
@JaxrsMethodDescribe(value = "文字转换.", action = ActionExtract.class)
@POST
@Path("extract")
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
@Consumes(MediaType.MULTIPART_FORM_DATA)
public void extract(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
		@FormDataParam(FILE_FIELD) final byte[] bytes,
		@FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<ActionExtract.Wo> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionExtract().execute(effectivePerson, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));

}
 
源代码19 项目: o2oa   文件: AttachmentAction.java
@JaxrsMethodDescribe(value = "更新Attachment的内容并返回回调.,使用callback方式,为了与前台兼容使用POST方法", action = ActionUpdateContentCallback.class)
@POST
@Path("{id}/update/callback/{callback}")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(HttpMediaType.TEXT_HTML_UTF_8)
public void updateContentCallback(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
		@JaxrsParameterDescribe("附件标识") @PathParam("id") String id,
		@JaxrsParameterDescribe("回调函数名") @PathParam("callback") String callback,
		@FormDataParam(FILE_FIELD) final byte[] bytes,
		@JaxrsParameterDescribe("上传文件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<Wo<ActionUpdateContentCallback.WoObject>> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionUpdateContentCallback().execute(effectivePerson, id, callback, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码20 项目: o2oa   文件: AttachmentAction.java
@JaxrsMethodDescribe(value = "创建Attachment的内容", action = ActionUpload.class)
@POST
@Path("upload/folder/{folderId}")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
public void upload(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
		@JaxrsParameterDescribe("目录") @PathParam("folderId") String folderId,
		@JaxrsParameterDescribe("附件名称") @FormDataParam(FILENAME_FIELD) String fileName,
		@JaxrsParameterDescribe("附件标识") @FormDataParam(FILE_FIELD) final byte[] bytes,
		@JaxrsParameterDescribe("上传文件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<ActionUpload.Wo> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionUpload().execute(effectivePerson, folderId, fileName, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码21 项目: o2oa   文件: AttachmentAction.java
@JaxrsMethodDescribe(value = "上传附件(带回调).", action = ActionUploadCallback.class)
@POST
@Path("upload/subject/{subjectId}/callback/{callback}")
@Produces(HttpMediaType.TEXT_HTML_UTF_8)
@Consumes(MediaType.MULTIPART_FORM_DATA)
public void uploadCallback(@Suspended final AsyncResponse asyncResponse, 
		@Context HttpServletRequest request, 
		@JaxrsParameterDescribe("主贴ID") @PathParam("subjectId") String subjectId, 
		@JaxrsParameterDescribe("回调函数名") @PathParam("callback") String callback,
		@JaxrsParameterDescribe("位置") @FormDataParam("site") String site, 
		@FormDataParam(FILE_FIELD) final byte[] bytes,
		@FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<ActionUploadCallback.Wo<ActionUploadCallback.WoObject>> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionUploadCallback().execute(request, effectivePerson, subjectId, callback, site, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码22 项目: o2oa   文件: PictureAction.java
@JaxrsMethodDescribe(value = "更新版块图标.", action = ActionSectionIconUpdate.class)
@POST
@Path("section/{id}/icon")
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
@Consumes(MediaType.MULTIPART_FORM_DATA)
public void sectionIconUpdate(@Suspended final AsyncResponse asyncResponse, 
		@Context HttpServletRequest request, 
		@JaxrsParameterDescribe("版块ID") @PathParam("id") String id,
		@FormDataParam(FILE_FIELD) final byte[] bytes,
		@FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<WrapOutId> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionSectionIconUpdate().execute(request, effectivePerson, id, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码23 项目: o2oa   文件: Attachment2Action.java
@JaxrsMethodDescribe(value = "创建Attachment的内容并返回回调.", action = ActionUploadCallback.class)
@POST
@Path("upload/folder/{folderId}/callback/{callback}")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(HttpMediaType.TEXT_HTML_UTF_8)
public void uploadCallback(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
		@JaxrsParameterDescribe("目录") @PathParam("folderId") String folderId,
		@JaxrsParameterDescribe("回调函数名") @PathParam("callback") String callback,
		@JaxrsParameterDescribe("附件名称") @FormDataParam(FILENAME_FIELD) String fileName,
		@JaxrsParameterDescribe("附件md5值") @FormDataParam("fileMd5") String fileMd5,
		@JaxrsParameterDescribe("附件标识") @FormDataParam(FILE_FIELD) final byte[] bytes,
		@JaxrsParameterDescribe("上传文件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<ActionUploadCallback.Wo<WoObject>> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionUploadCallback().execute(effectivePerson, folderId, callback, fileName, fileMd5, bytes,
				disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码24 项目: o2oa   文件: FileAction.java
@JaxrsMethodDescribe(value = "上传文件,并进行压缩,如果文件大小小于指定宽度或者宽度<0,则不进行压缩.", action = ActionUpload.class)
@PUT
@Path("upload/referencetype/{referenceType}/reference/{reference}/scale/{scale}")
@Consumes({ MediaType.MULTIPART_FORM_DATA, MediaType.APPLICATION_OCTET_STREAM })
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
public void upload(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
		@JaxrsParameterDescribe("文件类型") @PathParam("referenceType") String referenceType,
		@JaxrsParameterDescribe("关联id") @PathParam("reference") String reference,
		@JaxrsParameterDescribe("缩放") @PathParam("scale") Integer scale,
		@FormDataParam(FILE_FIELD) final byte[] bytes,
		@JaxrsParameterDescribe("上传文件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<ActionUpload.Wo> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionUpload().execute(effectivePerson, referenceType, reference, scale, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码25 项目: o2oa   文件: FileAction.java
@JaxrsMethodDescribe(value = "创建Attachment的内容并返回回调.", action = ActionUploadCallback.class)
@POST
@Path("upload/referencetype/{referenceType}/reference/{reference}/scale/{scale}/callback/{callback}")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(HttpMediaType.TEXT_HTML_UTF_8)
public void uploadCallback(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
		@JaxrsParameterDescribe("文件类型") @PathParam("referenceType") String referenceType,
		@JaxrsParameterDescribe("关联id") @PathParam("reference") String reference,
		@JaxrsParameterDescribe("缩放") @PathParam("scale") Integer scale,
		@JaxrsParameterDescribe("回调函数名") @PathParam("callback") String callback,
		@FormDataParam(FILE_FIELD) final byte[] bytes,
		@JaxrsParameterDescribe("上传文件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<ActionUploadCallback.Wo<ActionUploadCallback.WoObject>> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionUploadCallback().execute(effectivePerson, referenceType, reference, scale, callback,
				bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码26 项目: o2oa   文件: FileImportExportAction.java
@JaxrsMethodDescribe(value = "上传需要导入的数据文件XLS", action = StandardJaxrsAction.class)
@POST
@Path("upload")
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
@Consumes(MediaType.MULTIPART_FORM_DATA)
public void upload(@Suspended final AsyncResponse asyncResponse, 
		@Context HttpServletRequest request, 
		@FormDataParam(FILE_FIELD) final byte[] bytes,
		@FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition
) {
	ActionResult<WrapOutId> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionImportFileUpload().execute(request, effectivePerson, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码27 项目: o2oa   文件: ModuleAction.java
@JaxrsMethodDescribe(value = "分发上传的静态资源", action = ActionDispatchResource.class)
@POST
@Path("dispatch/resource/as/new/{asNew}")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
public void dispatchResource(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
							 @JaxrsParameterDescribe("覆盖类型:true删除原文件然后上传,false覆盖原文件") @PathParam("asNew") Boolean asNew,
							 @JaxrsParameterDescribe("附件名称") @FormDataParam(FILENAME_FIELD) String fileName,
							 @JaxrsParameterDescribe("附件存放目录(zip文件可以为空,其他不能为空)") @FormDataParam("filePath") String filePath,
							 @JaxrsParameterDescribe("附件标识") @FormDataParam(FILE_FIELD) final byte[] bytes,
							 @JaxrsParameterDescribe("上传zip文件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<ActionDispatchResource.Wo> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionDispatchResource().execute(effectivePerson, asNew, fileName, filePath, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码28 项目: o2oa   文件: AttachmentAction.java
@JaxrsMethodDescribe(value = "更新Attachment的内容并返回回调.,使用callback方式,为了与前台兼容使用POST方法", action = ActionUpdateContentCallback.class)
@POST
@Path("{id}/update/callback/{callback}")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(HttpMediaType.TEXT_HTML_UTF_8)
public void updateContentCallback(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
		@JaxrsParameterDescribe("附件标识") @PathParam("id") String id,
		@JaxrsParameterDescribe("回调函数名") @PathParam("callback") String callback,
		@FormDataParam(FILE_FIELD) final byte[] bytes,
		@JaxrsParameterDescribe("上传文件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<Wo<ActionUpdateContentCallback.WoObject>> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionUpdateContentCallback().execute(effectivePerson, id, callback, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码29 项目: o2oa   文件: AttachmentAction.java
@JaxrsMethodDescribe(value = "创建Attachment的内容", action = ActionUpload.class)
@POST
@Path("upload/folder/{folderId}")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
public void upload(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
		@JaxrsParameterDescribe("目录") @PathParam("folderId") String folderId,
		@JaxrsParameterDescribe("附件名称") @FormDataParam(FILENAME_FIELD) String fileName,
		@JaxrsParameterDescribe("附件标识") @FormDataParam(FILE_FIELD) final byte[] bytes,
		@JaxrsParameterDescribe("上传文件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<ActionUpload.Wo> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionUpload().execute(effectivePerson, folderId, fileName, bytes, disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}
 
源代码30 项目: o2oa   文件: AttachmentAction.java
@JaxrsMethodDescribe(value = "创建Attachment的内容并返回回调.", action = ActionUploadCallback.class)
@POST
@Path("upload/folder/{folderId}/callback/{callback}")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(HttpMediaType.TEXT_HTML_UTF_8)
public void uploadCallback(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
		@JaxrsParameterDescribe("目录") @PathParam("folderId") String folderId,
		@JaxrsParameterDescribe("回调函数名") @PathParam("callback") String callback,
		@JaxrsParameterDescribe("附件名称") @FormDataParam(FILENAME_FIELD) String fileName,
		@JaxrsParameterDescribe("附件标识") @FormDataParam(FILE_FIELD) final byte[] bytes,
		@JaxrsParameterDescribe("上传文件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) {
	ActionResult<ActionUploadCallback.Wo<WoObject>> result = new ActionResult<>();
	EffectivePerson effectivePerson = this.effectivePerson(request);
	try {
		result = new ActionUploadCallback().execute(effectivePerson, folderId, callback, fileName, bytes,
				disposition);
	} catch (Exception e) {
		logger.error(e, effectivePerson, request, null);
		result.error(e);
	}
	asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
}