Skip to content

Commit

Permalink
LPS-85247 SF
Browse files Browse the repository at this point in the history
  • Loading branch information
brianchandotcom committed Oct 8, 2018
1 parent 3dc337c commit 4740b8e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Expand Up @@ -43,8 +43,7 @@
immediate = true,
property = {
"osgi.http.whiteboard.servlet.name=com.liferay.document.library.analytics.internal.servlet.ResolveFileEntryUUIDServlet",
"osgi.http.whiteboard.servlet.pattern=" +
DocumentLibraryAnalyticsConstants.PATH_RESOLVE_FILE_ENTRY,
"osgi.http.whiteboard.servlet.pattern=" + DocumentLibraryAnalyticsConstants.PATH_RESOLVE_FILE_ENTRY,
"servlet.init.httpMethods=GET"
},
service = Servlet.class
Expand All @@ -53,10 +52,13 @@ public class ResolveFileEntryUUIDServlet extends HttpServlet {

@Override
protected void doGet(
HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) {

try {
_sendSuccess(httpServletResponse, _getFileEntryByUuidAndGroupId(httpServletRequest));
_sendSuccess(
httpServletResponse,
_getFileEntryByUuidAndGroupId(httpServletRequest));
}
catch (PrincipalException pe) {
_sendError(httpServletResponse, 403, pe);
Expand All @@ -66,7 +68,8 @@ protected void doGet(
}
}

private FileEntry _getFileEntryByUuidAndGroupId(HttpServletRequest httpServletRequest)
private FileEntry _getFileEntryByUuidAndGroupId(
HttpServletRequest httpServletRequest)
throws Exception {

long groupId = ParamUtil.getLong(httpServletRequest, "groupId");
Expand All @@ -76,7 +79,8 @@ private FileEntry _getFileEntryByUuidAndGroupId(HttpServletRequest httpServletRe
}

private void _sendError(
HttpServletResponse httpServletResponse, int status, Throwable throwable) {
HttpServletResponse httpServletResponse, int status,
Throwable throwable) {

try {
PrintWriter printWriter = httpServletResponse.getWriter();
Expand All @@ -96,7 +100,8 @@ private void _sendError(
}
}

private void _sendSuccess(HttpServletResponse httpServletResponse, FileEntry fileEntry)
private void _sendSuccess(
HttpServletResponse httpServletResponse, FileEntry fileEntry)
throws IOException {

PrintWriter printWriter = httpServletResponse.getWriter();
Expand Down
Expand Up @@ -17,7 +17,6 @@
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>

<%@ page import="com.liferay.document.library.analytics.internal.constants.DocumentLibraryAnalyticsConstants" %><%@
page import="com.liferay.petra.string.StringBundler" %><%@
page import="com.liferay.portal.kernel.repository.model.FileEntry" %><%@
page import="com.liferay.portal.kernel.util.Portal" %><%@
page import="com.liferay.portal.kernel.util.PortalUtil" %><%@
Expand Down

0 comments on commit 4740b8e

Please sign in to comment.