Example usage for com.liferay.portal.kernel.repository Repository getFileShortcut

List of usage examples for com.liferay.portal.kernel.repository Repository getFileShortcut

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.repository Repository getFileShortcut.

Prototype

public FileShortcut getFileShortcut(long fileShortcutId) throws PortalException;

Source Link

Usage

From source file:com.liferay.document.library.internal.trash.DLFileShortcutTrashHandler.java

License:Open Source License

protected DLFileShortcut getDLFileShortcut(long classPK) throws PortalException {

    Repository repository = RepositoryProviderUtil.getFileShortcutRepository(classPK);

    if (!repository.isCapabilityProvided(TrashCapability.class)) {
        throw new UnsupportedCapabilityException(TrashCapability.class,
                "Repository " + repository.getRepositoryId());
    }//ww  w.j  a  va 2  s .  c  o  m

    FileShortcut fileShortcut = repository.getFileShortcut(classPK);

    return (DLFileShortcut) fileShortcut.getModel();
}