Example usage for com.liferay.portal.kernel.repository LocalRepository addFolder

List of usage examples for com.liferay.portal.kernel.repository LocalRepository addFolder

Introduction

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

Prototype

public Folder addFolder(long userId, long parentFolderId, String name, String description,
            ServiceContext serviceContext) throws PortalException;

Source Link

Usage

From source file:com.liferay.portlet.documentlibrary.service.impl.DLAppLocalServiceImpl.java

License:Open Source License

/**
 * Adds a folder./*from   ww  w. jav  a 2 s .  co m*/
 *
 * @param  userId the primary key of the folder's creator/owner
 * @param  repositoryId the primary key of the repository
 * @param  parentFolderId the primary key of the folder's parent folder
 * @param  name the folder's name
 * @param  description the folder's description
 * @param  serviceContext the service context to be applied. In a Liferay
 *         repository, it may include mountPoint which is a boolean
 *         specifying whether the folder is a facade for mounting a
 *         third-party repository
 * @return the folder
 * @throws PortalException if the parent folder could not be found or if the
 *         new folder's information was invalid
 * @throws SystemException if a system exception occurred
 */
public Folder addFolder(long userId, long repositoryId, long parentFolderId, String name, String description,
        ServiceContext serviceContext) throws PortalException, SystemException {

    LocalRepository localRepository = getLocalRepository(repositoryId);

    return localRepository.addFolder(userId, parentFolderId, name, description, serviceContext);
}