Search in sources :

Example 1 with BulkFileOperationsAO

use of org.irods.jargon.core.pub.BulkFileOperationsAO in project metalnx-web by irods-contrib.

the class CollectionServiceImpl method compressTempFolderIntoDataGrid.

/*
	 * *************************************************************************
	 * *************************** PRIVATE METHODS *****************************
	 * *************************************************************************
	 */
/**
 * Creates a tar file into iRODS based on the path given
 *
 * @param filePathToBeBundled
 * @param bundleFilePathTobeCreated
 * @param resource
 * @return
 * @throws DataGridConnectionRefusedException
 * @throws JargonException
 */
private boolean compressTempFolderIntoDataGrid(String filePathToBeBundled, String bundleFilePathTobeCreated, String resource) throws DataGridConnectionRefusedException {
    logger.info("compressTempFolderIntoDataGrid()");
    boolean isZipFileCreatedSuccessfully = false;
    BulkFileOperationsAO bulkFileOperationsAO = null;
    try {
        bulkFileOperationsAO = irodsServices.getBulkFileOperationsAO();
        bulkFileOperationsAO.createABundleFromIrodsFilesAndStoreInIrodsWithForceOption(bundleFilePathTobeCreated, filePathToBeBundled, resource);
        isZipFileCreatedSuccessfully = true;
    } catch (JargonException e) {
        logger.error("Could not compress temporary folder: {}", e.getMessage());
    }
    return isZipFileCreatedSuccessfully;
}
Also used : BulkFileOperationsAO(org.irods.jargon.core.pub.BulkFileOperationsAO) JargonException(org.irods.jargon.core.exception.JargonException)

Aggregations

JargonException (org.irods.jargon.core.exception.JargonException)1 BulkFileOperationsAO (org.irods.jargon.core.pub.BulkFileOperationsAO)1