Search in sources :

Example 1 with RepositoryException

use of com.liferay.portal.kernel.repository.RepositoryException in project liferay-ide by liferay.

the class WebServerServlet method _checkFileEntry.

private static void _checkFileEntry(String[] pathArray) throws Exception {
    if (pathArray.length == 1) {
        long dlFileShortcutId = GetterUtil.getLong(pathArray[0]);
        DLFileShortcut dlFileShortcut = DLAppLocalServiceUtil.getFileShortcut(dlFileShortcutId);
        DLAppLocalServiceUtil.getFileEntry(dlFileShortcut.getToFileEntryId());
    } else if (pathArray.length == 2) {
    // Unable to check with UUID because of multiple repositories
    } else {
        long groupId = GetterUtil.getLong(pathArray[0]);
        long folderId = GetterUtil.getLong(pathArray[1]);
        String fileName = pathArray[2];
        try {
            DLAppLocalServiceUtil.getFileEntry(groupId, folderId, fileName);
        } catch (RepositoryException re) {
        }
    }
}
Also used : DLFileShortcut(com.liferay.portlet.documentlibrary.model.DLFileShortcut) RepositoryException(com.liferay.portal.kernel.repository.RepositoryException)

Aggregations

RepositoryException (com.liferay.portal.kernel.repository.RepositoryException)1 DLFileShortcut (com.liferay.portlet.documentlibrary.model.DLFileShortcut)1