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

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

Introduction

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

Prototype

public static Repository getFolderRepository(long folderId) throws PortalException 

Source Link

Usage

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

License:Open Source License

protected DLFolder fetchDLFolder(long classPK) throws PortalException {
    Repository repository = RepositoryProviderUtil.getFolderRepository(classPK);

    if (!repository.isCapabilityProvided(TrashCapability.class)) {
        return null;
    }//from w  w w  . j av  a2  s  .  co m

    Folder folder = repository.getFolder(classPK);

    return (DLFolder) folder.getModel();
}

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

License:Open Source License

protected DLFolder getDLFolder(long classPK) throws PortalException {
    Repository repository = RepositoryProviderUtil.getFolderRepository(classPK);

    if (!repository.isCapabilityProvided(TrashCapability.class)) {
        throw new UnsupportedCapabilityException(TrashCapability.class,
                "Repository " + repository.getRepositoryId());
    }/*w  w w  . ja v a 2 s  .co m*/

    Folder folder = repository.getFolder(classPK);

    return (DLFolder) folder.getModel();
}