001
014
015 package com.liferay.portlet.documentlibrary.model.impl;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portal.kernel.exception.SystemException;
019 import com.liferay.portlet.documentlibrary.model.DLFileEntry;
020 import com.liferay.portlet.documentlibrary.model.DLFileVersion;
021 import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil;
022 import com.liferay.portlet.documentlibrary.util.DLUtil;
023 import com.liferay.portlet.expando.model.ExpandoBridge;
024 import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
025
026
029 public class DLFileVersionImpl
030 extends DLFileVersionModelImpl implements DLFileVersion {
031
032 public DLFileVersionImpl() {
033 }
034
035 public ExpandoBridge getExpandoBridge() {
036 if (_expandoBridge == null) {
037 _expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(
038 getCompanyId(), DLFileEntry.class.getName(), getPrimaryKey());
039 }
040
041 return _expandoBridge;
042 }
043
044 public DLFileEntry getFileEntry() throws PortalException, SystemException {
045 return DLFileEntryLocalServiceUtil.getFileEntry(
046 getGroupId(), getFolderId(), getName());
047 }
048
049 public String getIcon() {
050 return DLUtil.getFileIcon(getExtension());
051 }
052
053 private ExpandoBridge _expandoBridge;
054
055 }