本文整理汇总了Java中org.irods.jargon.core.query.JargonQueryException类的典型用法代码示例。如果您正苦于以下问题:Java JargonQueryException类的具体用法?Java JargonQueryException怎么用?Java JargonQueryException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JargonQueryException类属于org.irods.jargon.core.query包,在下文中一共展示了JargonQueryException类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: search_datasets_by_username
import org.irods.jargon.core.query.JargonQueryException; //导入依赖的package包/类
public ArrayList<String> search_datasets_by_username(IRODSAccount account, String username) throws JargonException, JargonQueryException {
logger.debug("Searching datasets by username from IRODS-Server[\n\tiRODS account: " + account.toString()
+ "\tUsername: " + username);
IRODSFileSystem irodsFileSystem = IRODSFileSystem.instance();
DataTransferOperations dataTransferOperations = irodsFileSystem.getIRODSAccessObjectFactory().getDataTransferOperations(account);
//File targetFile = new File(targetFilePath);
IRODSFileFactory irodsFileFactory = irodsFileSystem.getIRODSFileFactory(account);
DataObjectAO dataObjectAO = irodsFileSystem.getIRODSAccessObjectFactory().getDataObjectAO(account);
List<AVUQueryElement> avuQueryElements = new ArrayList<>();
avuQueryElements.add(AVUQueryElement.instanceForValueQuery(AVUQueryElement.AVUQueryPart.VALUE, AVUQueryOperatorEnum.EQUAL, username));
List<DataObject> dobject = dataObjectAO.findDomainByMetadataQuery(avuQueryElements);
ArrayList<String> results = new ArrayList();
for (DataObject actual : dobject) {
results.add(actual.getAbsolutePath());
}
for (String m : results) {
logger.info("Datasets Found:" + m);
}
return results;
}
示例2: search_directory_datasets_by_type
import org.irods.jargon.core.query.JargonQueryException; //导入依赖的package包/类
public ArrayList<String> search_directory_datasets_by_type(IRODSAccount account, String type) throws JargonException, JargonQueryException {
logger.debug("Searching dataset URIs by username from IRODS-Server[\n\tiRODS account: " + account.toString()
+ "\tUsername: " + type);
IRODSFileSystem irodsFileSystem = IRODSFileSystem.instance();
DataTransferOperations dataTransferOperations = irodsFileSystem.getIRODSAccessObjectFactory().getDataTransferOperations(account);
//File targetFile = new File(targetFilePath);
IRODSFileFactory irodsFileFactory = irodsFileSystem.getIRODSFileFactory(account);
DataObjectAO dataObjectAO = irodsFileSystem
.getIRODSAccessObjectFactory().getDataObjectAO(account);
List<AVUQueryElement> avuQueryElements = new ArrayList<>();
avuQueryElements.add(AVUQueryElement.instanceForValueQuery(AVUQueryElement.AVUQueryPart.VALUE, AVUQueryOperatorEnum.EQUAL, type));
// List<MetaDataAndDomainData> metadata = dataObjectAO
// .findMetadataValuesByMetadataQuery(avuQueryElements);
List<DataObject> dobject = dataObjectAO.findDomainByMetadataQuery(avuQueryElements);
ArrayList<String> results = new ArrayList();
for (DataObject actual : dobject) {
for (int i = 0; i < 5; i++) {
if (dataObjectAO.findMetadataValuesForDataObject(actual.getAbsolutePath()).get(i).getAvuAttribute().toString().equals("datasetURI")) {
results.add(dataObjectAO.findMetadataValuesForDataObject(actual.getAbsolutePath()).get(i).getAvuValue());
}
}
}
for (String m : results) {
logger.info("Datasets Found:" + m);
}
return results;
}
示例3: delete_dataset
import org.irods.jargon.core.query.JargonQueryException; //导入依赖的package包/类
public void delete_dataset(IRODSAccount account, String datasetURI) throws JargonException, JargonQueryException {
logger.debug("Deleting dataset from IRODS-Server[\n\tiRODS account: " + account.toString()
+ "\tDatasetURI: " + datasetURI);
IRODSFileSystem irodsFileSystem = IRODSFileSystem.instance();
DataTransferOperations dataTransferOperations = irodsFileSystem.getIRODSAccessObjectFactory().getDataTransferOperations(account);
// File targetFile = new File(targetFilePath);
IRODSFileFactory irodsFileFactory = irodsFileSystem.getIRODSFileFactory(account);
// newFileName = "/tempZone/home/rods/"+newFileName;
// String sourceFilePath = irodsPath + sourceFileName;
// IRODSFile sourceFile = null;
// sourceFile = irodsFileFactory.instanceIRODSFile(sourceFilePath);
// DataTransferOperations dataTransferOperationsAO = irodsFileSystem
// .getIRODSAccessObjectFactory().getDataTransferOperations(account);
DataObjectAO dataObjectAO = irodsFileSystem.getIRODSAccessObjectFactory().getDataObjectAO(account);
List<AVUQueryElement> avuQueryElements = new ArrayList<>();
avuQueryElements.add(AVUQueryElement.instanceForValueQuery(AVUQueryElement.AVUQueryPart.VALUE, AVUQueryOperatorEnum.EQUAL, datasetURI));
List<MetaDataAndDomainData> metadata = dataObjectAO.findMetadataValuesByMetadataQuery(avuQueryElements);
List<DataObject> dobject = dataObjectAO.findDomainByMetadataQuery(avuQueryElements);
String fileToDeletePath = dobject.get(0).getAbsolutePath();
irodsFileFactory.instanceIRODSFile(fileToDeletePath).delete();
// for (MetaDataAndDomainData actual : metadata) {
// }
// dobject.
// dataTransferOperations.getOperation(fileToGetPath,targetFilePath,dobject.get(0).getResourceName(), null, null);
}
示例4: search_datasets_uris_by_username
import org.irods.jargon.core.query.JargonQueryException; //导入依赖的package包/类
public ArrayList<String> search_datasets_uris_by_username(IRODSAccount account, String username) throws JargonException, JargonQueryException {
logger.debug("Searching dataset URIs by username from IRODS-Server[\n\tiRODS account: " + account.toString()
+ "\tUsername: " + username);
IRODSFileSystem irodsFileSystem = IRODSFileSystem.instance();
DataTransferOperations dataTransferOperations = irodsFileSystem.getIRODSAccessObjectFactory().getDataTransferOperations(account);
//File targetFile = new File(targetFilePath);
IRODSFileFactory irodsFileFactory = irodsFileSystem.getIRODSFileFactory(account);
DataObjectAO dataObjectAO = irodsFileSystem
.getIRODSAccessObjectFactory().getDataObjectAO(account);
List<AVUQueryElement> avuQueryElements = new ArrayList<>();
avuQueryElements.add(AVUQueryElement.instanceForValueQuery(AVUQueryElement.AVUQueryPart.VALUE, AVUQueryOperatorEnum.EQUAL, username));
// List<MetaDataAndDomainData> metadata = dataObjectAO
// .findMetadataValuesByMetadataQuery(avuQueryElements);
List<DataObject> dobject = dataObjectAO.findDomainByMetadataQuery(avuQueryElements);
ArrayList<String> results = new ArrayList();
for (DataObject actual : dobject) {
for (int i = 0; i < 5; i++) {
if (dataObjectAO.findMetadataValuesForDataObject(actual.getAbsolutePath()).get(i).getAvuAttribute().toString().equals("datasetURI")) {
results.add(dataObjectAO.findMetadataValuesForDataObject(actual.getAbsolutePath()).get(i).getAvuValue());
}
}
}
for (String m : results) {
logger.info("Datasets Found:" + m);
}
// dobject.
// dataTransferOperations.getOperation(fileToGetPath,targetFilePath,dobject.get(0).getResourceName(), null, null);
return results;
}
示例5: get_dataset
import org.irods.jargon.core.query.JargonQueryException; //导入依赖的package包/类
public String get_dataset(IRODSAccount account, String targetFilePath, String datasetURI, String datasetType) throws JargonException, JargonQueryException, ParseException {
logger.debug("Retrieving dataset from IRODS-Server[\n\tiRODS account: " + account.toString()
+ "\tTargetFilePath: " + targetFilePath
+ "\tDatasetURI: " + datasetURI);
IRODSFileSystem irodsFileSystem = IRODSFileSystem.instance();
DataTransferOperations dataTransferOperations = irodsFileSystem.getIRODSAccessObjectFactory().getDataTransferOperations(account);
IRODSFileFactory irodsFileFactory = irodsFileSystem.getIRODSFileFactory(account);
// newFileName = "/tempZone/home/rods/"+newFileName;
// String sourceFilePath = irodsPath + sourceFileName;
// IRODSFile sourceFile = null;
// sourceFile = irodsFileFactory.instanceIRODSFile(sourceFilePath);
// DataTransferOperations dataTransferOperationsAO = irodsFileSystem
// .getIRODSAccessObjectFactory().getDataTransferOperations(account);
DataObjectAO dataObjectAO = irodsFileSystem
.getIRODSAccessObjectFactory().getDataObjectAO(account);
List<AVUQueryElement> avuQueryElements = new ArrayList<>();
avuQueryElements.add(AVUQueryElement.instanceForValueQuery(
AVUQueryElement.AVUQueryPart.ATTRIBUTE, AVUQueryOperatorEnum.EQUAL, "datasetURI"));
avuQueryElements.add(AVUQueryElement.instanceForValueQuery(
AVUQueryElement.AVUQueryPart.VALUE, AVUQueryOperatorEnum.EQUAL, datasetURI));
avuQueryElements.add(AVUQueryElement.instanceForValueQuery(
AVUQueryElement.AVUQueryPart.ATTRIBUTE, AVUQueryOperatorEnum.EQUAL, "datasetType"));
avuQueryElements.add(AVUQueryElement.instanceForValueQuery(
AVUQueryElement.AVUQueryPart.VALUE, AVUQueryOperatorEnum.EQUAL, datasetType));
List<DataObject> dobject = dataObjectAO.findDomainByMetadataQuery(avuQueryElements);
String fileToGetPath = dobject.get(0).getAbsolutePath();
//for (MetaDataAndDomainData actual : metadata) {
logger.info("File to download" + fileToGetPath);
//}
File targetFile = new File(targetFilePath + dobject.get(0).getResourceName());
dataTransferOperations.getOperation(fileToGetPath, targetFilePath, dobject.get(0).getResourceName(), null, null);
return dobject.get(0).getDataName();
}