Example usage for com.liferay.portal.util PropsValues STAGING_DELETE_TEMP_LAR_ON_SUCCESS

List of usage examples for com.liferay.portal.util PropsValues STAGING_DELETE_TEMP_LAR_ON_SUCCESS

Introduction

In this page you can find the example usage for com.liferay.portal.util PropsValues STAGING_DELETE_TEMP_LAR_ON_SUCCESS.

Prototype

boolean STAGING_DELETE_TEMP_LAR_ON_SUCCESS

To view the source code for com.liferay.portal.util PropsValues STAGING_DELETE_TEMP_LAR_ON_SUCCESS.

Click Source Link

Usage

From source file:com.liferay.exportimport.internal.background.task.BaseStagingBackgroundTaskExecutor.java

License:Open Source License

protected void deleteTempLarOnSuccess(File file) {
    if (PropsValues.STAGING_DELETE_TEMP_LAR_ON_SUCCESS) {
        FileUtil.delete(file);//  w w w .ja va2s  .co  m
    } else if ((file != null) && _log.isDebugEnabled()) {
        _log.debug("Kept temporary LAR file " + file.getAbsolutePath());
    }
}

From source file:com.liferay.exportimport.lar.ExportImportHelperImpl.java

License:Open Source License

protected ZipWriter getZipWriter(String fileName) {
    if (!ExportImportThreadLocal.isStagingInProcess() || (PropsValues.STAGING_DELETE_TEMP_LAR_ON_FAILURE
            && PropsValues.STAGING_DELETE_TEMP_LAR_ON_SUCCESS)) {

        return ZipWriterFactoryUtil.getZipWriter();
    }/*w w  w .  ja  v  a2 s.  c  o  m*/

    return ZipWriterFactoryUtil.getZipWriter(
            new File(SystemProperties.get(SystemProperties.TMP_DIR) + StringPool.SLASH + fileName));
}

From source file:com.liferay.staging.test.StagingImplTest.java

License:Open Source License

@Test
public void testInitialPublication() throws Exception {
    boolean stagingDeleteTempLarOnSuccess = PropsValues.STAGING_DELETE_TEMP_LAR_ON_SUCCESS;

    PropsValues.STAGING_DELETE_TEMP_LAR_ON_SUCCESS = false;

    try {/* w w  w.j a  v  a2 s . c o m*/
        doTestInitialPublication();
    } finally {
        PropsValues.STAGING_DELETE_TEMP_LAR_ON_SUCCESS = stagingDeleteTempLarOnSuccess;
    }
}