public abstract class BaseUploadHandler extends Object implements UploadHandler
Modifier and Type | Field and Description |
---|---|
protected static String |
TEMP_FOLDER_NAME |
Constructor and Description |
---|
BaseUploadHandler() |
Modifier and Type | Method and Description |
---|---|
protected abstract FileEntry |
addFileEntry(long userId,
long groupId,
long folderId,
String fileName,
String contentType,
InputStream inputStream,
long size,
ServiceContext serviceContext) |
protected abstract void |
checkPermission(long groupId,
long folderId,
PermissionChecker permissionChecker) |
protected void |
doHandleUploadException(PortletRequest portletRequest,
PortletResponse portletResponse,
PortalException pe,
JSONObject jsonObject) |
protected abstract FileEntry |
fetchFileEntry(long userId,
long groupId,
long folderId,
String fileName) |
protected long |
getFolderId(UploadPortletRequest uploadPortletRequest) |
protected JSONObject |
getImageJSONObject(PortletRequest portletRequest) |
protected abstract String |
getParameterName() |
protected ServiceContext |
getServiceContext(UploadPortletRequest uploadPortletRequest) |
protected String |
getUniqueFileName(ThemeDisplay themeDisplay,
String fileName,
long folderId) |
protected String |
getURL(FileEntry fileEntry,
ThemeDisplay themeDisplay) |
protected void |
handleUploadException(PortletRequest portletRequest,
PortletResponse portletResponse,
PortalException pe,
JSONObject jsonObject) |
void |
upload(PortletRequest portletRequest,
PortletResponse portletResponse) |
protected abstract void |
validateFile(String fileName,
String contentType,
long size) |
public void upload(PortletRequest portletRequest, PortletResponse portletResponse) throws PortalException
upload
in interface UploadHandler
PortalException
protected abstract FileEntry addFileEntry(long userId, long groupId, long folderId, String fileName, String contentType, InputStream inputStream, long size, ServiceContext serviceContext) throws PortalException
PortalException
protected abstract void checkPermission(long groupId, long folderId, PermissionChecker permissionChecker) throws PortalException
PortalException
protected void doHandleUploadException(PortletRequest portletRequest, PortletResponse portletResponse, PortalException pe, JSONObject jsonObject) throws PortalException
PortalException
protected abstract FileEntry fetchFileEntry(long userId, long groupId, long folderId, String fileName) throws PortalException
PortalException
protected long getFolderId(UploadPortletRequest uploadPortletRequest)
protected JSONObject getImageJSONObject(PortletRequest portletRequest) throws PortalException
PortalException
protected abstract String getParameterName()
protected ServiceContext getServiceContext(UploadPortletRequest uploadPortletRequest) throws PortalException
PortalException
protected String getUniqueFileName(ThemeDisplay themeDisplay, String fileName, long folderId) throws PortalException
PortalException
protected String getURL(FileEntry fileEntry, ThemeDisplay themeDisplay)
protected void handleUploadException(PortletRequest portletRequest, PortletResponse portletResponse, PortalException pe, JSONObject jsonObject) throws PortalException
PortalException
protected abstract void validateFile(String fileName, String contentType, long size) throws PortalException
PortalException