com.liferay.portal.kernel.upload
Class BaseUploadHandler
java.lang.Object
com.liferay.portal.kernel.upload.BaseUploadHandler
- All Implemented Interfaces:
- UploadHandler
public abstract class BaseUploadHandler
- extends Object
- implements UploadHandler
|
Method Summary |
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)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TEMP_FOLDER_NAME
protected static final String TEMP_FOLDER_NAME
BaseUploadHandler
public BaseUploadHandler()
upload
public void upload(PortletRequest portletRequest,
PortletResponse portletResponse)
throws PortalException
- Specified by:
upload in interface UploadHandler
- Throws:
PortalException
addFileEntry
protected abstract FileEntry addFileEntry(long userId,
long groupId,
long folderId,
String fileName,
String contentType,
InputStream inputStream,
long size,
ServiceContext serviceContext)
throws PortalException
- Throws:
PortalException
checkPermission
protected abstract void checkPermission(long groupId,
long folderId,
PermissionChecker permissionChecker)
throws PortalException
- Throws:
PortalException
doHandleUploadException
protected void doHandleUploadException(PortletRequest portletRequest,
PortletResponse portletResponse,
PortalException pe,
JSONObject jsonObject)
throws PortalException
- Throws:
PortalException
fetchFileEntry
protected abstract FileEntry fetchFileEntry(long userId,
long groupId,
long folderId,
String fileName)
throws PortalException
- Throws:
PortalException
getFolderId
protected long getFolderId(UploadPortletRequest uploadPortletRequest)
getImageJSONObject
protected JSONObject getImageJSONObject(PortletRequest portletRequest)
throws PortalException
- Throws:
PortalException
getParameterName
protected abstract String getParameterName()
getServiceContext
protected ServiceContext getServiceContext(UploadPortletRequest uploadPortletRequest)
throws PortalException
- Throws:
PortalException
getUniqueFileName
protected String getUniqueFileName(ThemeDisplay themeDisplay,
String fileName,
long folderId)
throws PortalException
- Throws:
PortalException
getURL
protected String getURL(FileEntry fileEntry,
ThemeDisplay themeDisplay)
handleUploadException
protected void handleUploadException(PortletRequest portletRequest,
PortletResponse portletResponse,
PortalException pe,
JSONObject jsonObject)
throws PortalException
- Throws:
PortalException
validateFile
protected abstract void validateFile(String fileName,
String contentType,
long size)
throws PortalException
- Throws:
PortalException