Example usage for com.liferay.portal.kernel.util PropsKeys LIFERAY_HOME

List of usage examples for com.liferay.portal.kernel.util PropsKeys LIFERAY_HOME

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util PropsKeys LIFERAY_HOME.

Prototype

String LIFERAY_HOME

To view the source code for com.liferay.portal.kernel.util PropsKeys LIFERAY_HOME.

Click Source Link

Usage

From source file:com.liferay.testlog.portlet.TestLogPortlet.java

License:Open Source License

@Override
public void doView(RenderRequest renderRequest, RenderResponse renderResponse) throws IOException {

    PrintWriter printWriter = renderResponse.getWriter();

    if (_log.isInfoEnabled()) {
        printWriter.write("Log#isEnabled=PASSED\n");
    } else {/*from   www  .  ja  va2s . c o m*/
        printWriter.write("Log#isEnabled=FAILED\n");
    }

    File file = new File(PropsUtil.get(PropsKeys.LIFERAY_HOME) + "/logs/test-log-portlet."
            + _format.format(new Date()) + ".log");

    if (file.exists()) {
        printWriter.write(file + "=PASSED\n");
    } else {
        printWriter.write(file + "=FAILED\n");
    }

    printWriter.close();
}

From source file:com.sohlman.liferay.bffss.service.impl.FileDataLocalServiceImpl.java

License:Open Source License

protected synchronized File getRootDirFromConfiguration(long companyId) {
    if (_rootDir != null) {
        return _rootDir;
    }/*ww  w  . j av a2  s.c o  m*/
    try {
        BackupFriendlyFileSystemStoreConfiguration backupFriendlyFileSystemStoreConfiguration = getBackupFriendlyFileSystemStoreConfiguration(
                companyId);

        String rootDir = backupFriendlyFileSystemStoreConfiguration.rootDir();

        if ("".equals(rootDir)) {
            rootDir = "data/document_library";
        }

        _rootDir = new File(rootDir);

        if (!_rootDir.isAbsolute()) {
            _rootDir = new File(PropsUtil.get(PropsKeys.LIFERAY_HOME), rootDir);
        }

        FileUtil.mkdirs(_rootDir);

        return _rootDir;
    } catch (ConfigurationException e) {
        throw new SystemException(e.getMessage());
    } catch (IOException ioe) {
        throw new SystemException(ioe);
    }
}