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

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

Introduction

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

Prototype

public <T extends Capability> T getCapability(Class<T> capabilityClass);

Source Link

Usage

From source file:com.liferay.document.library.repository.cmis.internal.model.CMISFileEntry.java

License:Open Source License

@Override
public <T extends Capability> T getRepositoryCapability(Class<T> capabilityClass) {

    try {/*from  w w  w . java  2 s. co  m*/
        Repository repository = RepositoryProviderUtil.getRepository(getRepositoryId());

        return repository.getCapability(capabilityClass);
    } catch (PortalException pe) {
        throw new SystemException("Unable to access repository " + getRepositoryId(), pe);
    }
}

From source file:com.liferay.document.library.repository.external.model.ExtRepositoryFileEntryAdapter.java

License:Open Source License

@Override
public <T extends Capability> T getRepositoryCapability(Class<T> capabilityClass) {

    Repository repository = getRepository();

    return repository.getCapability(capabilityClass);
}