Example usage for com.liferay.portal.kernel.repository RepositoryProviderUtil getFileShortcutRepository

List of usage examples for com.liferay.portal.kernel.repository RepositoryProviderUtil getFileShortcutRepository

Introduction

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

Prototype

public static Repository getFileShortcutRepository(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());
    }/*from  w w w.  j  a  v a2s.  com*/

    FileShortcut fileShortcut = repository.getFileShortcut(classPK);

    return (DLFileShortcut) fileShortcut.getModel();
}