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;
}
Aggregations