use of com.pratilipi.data.type.BlobEntry in project pratilipi by Pratilipi.
the class PratilipiDocUtil method getContentImage.
public static BlobEntry getContentImage(long pratilipiId, String name, Integer width) throws InsufficientAccessException, UnexpectedServerException {
Pratilipi pratilipi = DataAccessorFactory.getDataAccessor().getPratilipi(pratilipiId);
if (!PratilipiDataUtil.hasAccessToReadPratilipiContent(pratilipi))
throw new InsufficientAccessException();
BlobEntry blobEntry = DataAccessorFactory.getBlobAccessor().getBlob("pratilipi/" + pratilipiId + "/images/" + name);
if (width != null)
blobEntry = ImageUtil.resize(blobEntry, width);
return blobEntry;
}
use of com.pratilipi.data.type.BlobEntry in project pratilipi by Pratilipi.
the class AuthorImageApi method post.
@Post
public GenericResponse post(PostRequest request) throws InvalidArgumentException, InsufficientAccessException, UnexpectedServerException {
BlobEntry blobEntry = DataAccessorFactory.getBlobAccessor().newBlob(request.getName());
blobEntry.setData(request.getData());
blobEntry.setMimeType(request.getMimeType());
blobEntry.setMetaName(request.getName());
String profileImageUrl = AuthorDataUtil.saveAuthorImage(request.authorId, blobEntry);
return new Response(profileImageUrl);
}
use of com.pratilipi.data.type.BlobEntry in project pratilipi by Pratilipi.
the class PratilipiContentImageApi method post.
@Post
public PostResponse post(PostRequest request) throws InvalidArgumentException, InsufficientAccessException, UnexpectedServerException {
BlobEntry blobEntry = DataAccessorFactory.getBlobAccessor().newBlob(request.getName());
blobEntry.setData(request.getData());
blobEntry.setMimeType(request.getMimeType());
blobEntry.setMetaName(request.getName());
String imageName = PratilipiDocUtil.saveContentImage(request.pratilipiId, blobEntry);
return new PostResponse(imageName);
}
use of com.pratilipi.data.type.BlobEntry in project pratilipi by Pratilipi.
the class PratilipiCoverApi method post.
@Post
public PostResponse post(PostRequest request) throws InvalidArgumentException, InsufficientAccessException, UnexpectedServerException {
BlobEntry blobEntry = DataAccessorFactory.getBlobAccessor().newBlob(request.getName());
blobEntry.setData(request.getData());
blobEntry.setMimeType(request.getMimeType());
blobEntry.setMetaName(request.getName());
String coverImageUrl = PratilipiDataUtil.savePratilipiCover(request.pratilipiId, blobEntry);
return new PostResponse(coverImageUrl);
}
use of com.pratilipi.data.type.BlobEntry in project pratilipi by Pratilipi.
the class EventBannerApi method post.
@Post
public GenericResponse post(PostRequest request) throws InsufficientAccessException, UnexpectedServerException {
BlobEntry blobEntry = DataAccessorFactory.getBlobAccessor().newBlob(request.getName());
blobEntry.setData(request.getData());
blobEntry.setMimeType(request.getMimeType());
EventDataUtil.saveEventBanner(request.eventId, blobEntry);
return new GenericResponse();
}
Aggregations