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

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

Introduction

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

Prototype

public static Repository getFileEntryRepository(long fileEntryId) throws PortalException 

Source Link

Usage

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

License:Open Source License

protected DLFileEntry fetchDLFileEntry(long classPK) throws PortalException {

    Repository repository = RepositoryProviderUtil.getFileEntryRepository(classPK);

    if (!repository.isCapabilityProvided(TrashCapability.class)) {
        return null;
    }//from www. j  a  va2 s .c  om

    FileEntry fileEntry = repository.getFileEntry(classPK);

    return (DLFileEntry) fileEntry.getModel();
}

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

License:Open Source License

protected DLFileEntry getDLFileEntry(long classPK) throws PortalException {
    Repository repository = RepositoryProviderUtil.getFileEntryRepository(classPK);

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

    FileEntry fileEntry = repository.getFileEntry(classPK);

    return (DLFileEntry) fileEntry.getModel();
}