use of org.irods.jargon.core.pub.IRODSFileSystemAO in project metalnx-web by irods-contrib.
the class FileOperationServiceImpl method deleteCollection.
@Override
public boolean deleteCollection(String collectionPath, boolean forceFlag) throws DataGridException {
IRODSFileSystemAO irodsFileSystemAO = irodsServices.getIRODSFileSystemAO();
IRODSFileFactory irodsFileFactory = irodsServices.getIRODSFileFactory();
try {
IRODSFile collectionToBeRemoved = irodsFileFactory.instanceIRODSFile(collectionPath);
if (forceFlag) {
irodsFileSystemAO.directoryDeleteForce(collectionToBeRemoved);
} else {
irodsFileSystemAO.directoryDeleteNoForce(collectionToBeRemoved);
}
return true;
} catch (JargonException e) {
logger.error("Could not delete collection: ", e.getMessage());
}
return false;
}
use of org.irods.jargon.core.pub.IRODSFileSystemAO in project metalnx-web by irods-contrib.
the class FileOperationServiceImpl method deleteDataObject.
@Override
public boolean deleteDataObject(String dataObjectPath, boolean forceFlag) throws DataGridException {
boolean dataObjDeleted = false;
try {
IRODSFileSystemAO irodsFileSystemAO = irodsServices.getIRODSFileSystemAO();
IRODSFileFactory irodsFileFactory = irodsServices.getIRODSFileFactory();
IRODSFile fileToBeRemoved = irodsFileFactory.instanceIRODSFile(dataObjectPath);
if (forceFlag) {
irodsFileSystemAO.fileDeleteForce(fileToBeRemoved);
} else {
irodsFileSystemAO.fileDeleteNoForce(fileToBeRemoved);
}
dataObjDeleted = true;
} catch (JargonException e) {
logger.error("Could not delete data object: {}", e.getMessage());
}
return dataObjDeleted;
}
Aggregations