• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IRODSAccount类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.irods.jargon.core.connection.IRODSAccount的典型用法代码示例。如果您正苦于以下问题:Java IRODSAccount类的具体用法?Java IRODSAccount怎么用?Java IRODSAccount使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IRODSAccount类属于org.irods.jargon.core.connection包,在下文中一共展示了IRODSAccount类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: login

import org.irods.jargon.core.connection.IRODSAccount; //导入依赖的package包/类
@Override
public void login(final HostPasswordStore keychain, final LoginCallback prompt, final CancelCallback cancel) throws BackgroundException {
    try {
        final IRODSAccount account = client.getIRODSAccount();
        final Credentials credentials = host.getCredentials();
        account.setUserName(credentials.getUsername());
        account.setPassword(credentials.getPassword());
        final AuthResponse response = client.getIRODSAccessObjectFactory().authenticateIRODSAccount(account);
        if(log.isDebugEnabled()) {
            log.debug(String.format("Connected to %s", response.getStartupResponse()));
        }
        if(!response.isSuccessful()) {
            throw new LoginFailureException(MessageFormat.format(LocaleFactory.localizedString(
                    "Login {0} with username and password", "Credentials"), BookmarkNameProvider.toString(host)));
        }
    }
    catch(JargonException e) {
        throw new IRODSExceptionMappingService().map(e);
    }
}
 
开发者ID:iterate-ch,项目名称:cyberduck,代码行数:21,代码来源:IRODSSession.java


示例2: DocumentMapper

import org.irods.jargon.core.connection.IRODSAccount; //导入依赖的package包/类
/**
 * Default constuctor
 * 
 * @param connectorContext
 *            {@link ConnectorContext} with access and environmental
 *            information
 */
DocumentMapper(ConnectorContext connectorContext) {
	if (connectorContext == null) {
		throw new IllegalArgumentException("null connectorContext");
	}
	this.connectorContext = null;
	// FIXME: auth shim here until I understand the pluggable auth for
	// modeshape
	try {
		irodsAccount = IRODSAccount.instance("localhost", 1247, "test1",
				"test", "", "test1", "test1-resc");
	} catch (JargonException je) {
		throw new JargonRuntimeException("exception getting irods account",
				je);
	}
}
 
开发者ID:michael-conway,项目名称:jargon-modeshape,代码行数:23,代码来源:DocumentMapper.java


示例3: connect_to_content_storage

import org.irods.jargon.core.connection.IRODSAccount; //导入依赖的package包/类
public IRODSAccount connect_to_content_storage(String host, int port, String username, String password, String path, String zone, String demoResc)
        throws JargonException {
    logger.debug("Connecting to IRODS-Server[\n\tHost: " + host
            + "\tPort: " + port
            + "\tUsername: " + username
            + "\tPassword: " + password
            + "\tPath: " + path
            + "\tZone: " + zone
            + "\tResource: " + demoResc);
    IRODSAccount account = new IRODSAccount(host, 1247, username, password, path, zone, demoResc);
    return account;
}
 
开发者ID:isl,项目名称:LifeWatch_Greece,代码行数:13,代码来源:ContentStorageService.java


示例4: create_user_folder

import org.irods.jargon.core.connection.IRODSAccount; //导入依赖的package包/类
public void create_user_folder(IRODSAccount account, String sourceFilePath, String irodsPath,
        String targetFileName, String userName, String datasetURI, String creationDate, String datasetName,
        String datasetType)
        throws JargonException {
    logger.debug("Importing to IRODS-Server[\n\tiRODS account: " + account.toString()
            + "\tSourceFilePath: " + sourceFilePath
            + "\tiRODSPath: " + irodsPath
            + "\tTargetFileName: " + targetFileName
            + "\tUsername: " + userName
            + "\tDatasetURI: " + datasetURI
            + "\tDatasetName: " + datasetName
            + "\tCreationDate: " + creationDate);

    IRODSFileSystem irodsFileSystem = IRODSFileSystem.instance();

    DataTransferOperations dataTransferOperations = irodsFileSystem.getIRODSAccessObjectFactory().getDataTransferOperations(account);

    File sourceFile = new File(sourceFilePath);

    IRODSFileFactory irodsFileFactory = irodsFileSystem.getIRODSFileFactory(account);

    //newFileName = "/tempZone/home/rods/"+newFileName;
    String userFolderPath = irodsPath + "/" + userName + "/";

    IRODSFile targetFileFolder = irodsFileFactory.instanceIRODSFile(userFolderPath);

    targetFileFolder.mkdir();

    String targetFilePath = userFolderPath + "/" + datasetName + "/";

    IRODSFile targetFile = irodsFileFactory.instanceIRODSFile(targetFilePath);

    targetFile.mkdir();

}
 
开发者ID:isl,项目名称:LifeWatch_Greece,代码行数:36,代码来源:ContentStorageService.java


示例5: search_datasets_by_username

import org.irods.jargon.core.connection.IRODSAccount; //导入依赖的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;
}
 
开发者ID:isl,项目名称:LifeWatch_Greece,代码行数:28,代码来源:ContentStorageService.java


示例6: search_directory_datasets_by_type

import org.irods.jargon.core.connection.IRODSAccount; //导入依赖的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;

}
 
开发者ID:isl,项目名称:LifeWatch_Greece,代码行数:40,代码来源:ContentStorageService.java


示例7: delete_dataset

import org.irods.jargon.core.connection.IRODSAccount; //导入依赖的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);
}
 
开发者ID:isl,项目名称:LifeWatch_Greece,代码行数:36,代码来源:ContentStorageService.java


示例8: JargonConnection

import org.irods.jargon.core.connection.IRODSAccount; //导入依赖的package包/类
public JargonConnection(IrodsAccessConfig config) throws IrodsException {
	try {
		this.config = config;
		String[] pathComponents = config.path.split("/");
		Sys.expect(pathComponents.length >= 1);
		String zone = pathComponents[pathComponents[0].isEmpty() ? 1 : 0];

		irodsConnectionManager = IRODSSimpleProtocolManager.instance();
		irodsConnectionManager.initialize();
		irodsAccount = IRODSAccount.instance(config.server, config.port,
				config.username, config.password, config.path, zone, config.resource);
		irodsSession = IRODSSession.instance(irodsConnectionManager);
		irodsAccessObjectFactory = new IRODSAccessObjectFactoryImpl(irodsSession);

		EnvironmentalInfoAO environmentalInfoAO =
				irodsAccessObjectFactory.getEnvironmentalInfoAO(irodsAccount);
		IRODSServerProperties props =
				environmentalInfoAO.getIRODSServerPropertiesFromIRODSServer();
		Sys.expect(props.isTheIrodsServerAtLeastAtTheGivenReleaseVersion("rods3.0"));

		irodsLister = irodsAccessObjectFactory.getCollectionAndDataObjectListAndSearchAO(irodsAccount);
		irodsTransfers = irodsAccessObjectFactory.getDataTransferOperations(irodsAccount);
		irodsFileSystem = irodsAccessObjectFactory.getIRODSFileSystemAO(irodsAccount);
		irodsData = irodsAccessObjectFactory.getDataObjectAO(irodsAccount);
		irodsFileFactory = irodsAccessObjectFactory.getIRODSFileFactory(irodsAccount);
	} catch (JargonException ex) {
		throw new IrodsException(ex);
	}
}
 
开发者ID:EUDAT-GEF,项目名称:IrodsLink,代码行数:30,代码来源:JargonConnection.java


示例9: AbstractVirtualCollectionExecutor

import org.irods.jargon.core.connection.IRODSAccount; //导入依赖的package包/类
/**
 * @param irodsAccessObjectFactory
 * @param irodsAccount
 */
protected AbstractVirtualCollectionExecutor(final T collection,
		final IRODSAccessObjectFactory irodsAccessObjectFactory, final IRODSAccount irodsAccount) {
	super(irodsAccessObjectFactory, irodsAccount);

	if (collection == null) {
		throw new IllegalArgumentException("null collection");
	}

	this.collection = collection;
}
 
开发者ID:DICE-UNC,项目名称:jargon-extensions-if,代码行数:15,代码来源:AbstractVirtualCollectionExecutor.java


示例10: validate

import org.irods.jargon.core.connection.IRODSAccount; //导入依赖的package包/类
/**
 * Perform validation on all metadata elements in a template
 * 
 * @param mt
 *            {@link FormBasedMetadataTemplate} to be validated
 * @return List<{@link ValidationReturnEnum}> reporting validation results
 */

public List<ValidationReturnEnum> validate(IRODSAccount irodsAccount,
		IRODSAccessObjectFactory irodsAccessObjectFactory,
		FormBasedMetadataTemplate mt) {
	List<ValidationReturnEnum> returnList = new ArrayList<ValidationReturnEnum>();
	for (MetadataElement me : mt.getElements()) {
		returnList
				.add(validate(irodsAccount, irodsAccessObjectFactory, me));
	}

	return returnList;
}
 
开发者ID:DICE-UNC,项目名称:jargon-extensions-if,代码行数:20,代码来源:ValidatorSingleton.java


示例11: import_to_directory_recovery

import org.irods.jargon.core.connection.IRODSAccount; //导入依赖的package包/类
public void import_to_directory_recovery(IRODSAccount account, String sourceFilePath, String irodsPath,
        String targetFileName, String userName, String datasetURI, String creationDate, String datasetName,
        String datasetType, String recoveryFolderName)
        throws JargonException {
    logger.debug("Importing to IRODS-Server[\n\tiRODS account: " + account.toString()
            + "\tSourceFilePath: " + sourceFilePath
            + "\tiRODSPath: " + irodsPath
            + "\tTargetFileName: " + targetFileName
            + "\tUsername: " + userName
            + "\tDatasetURI: " + datasetURI
            + "\tDatasetName: " + datasetName
            + "\tCreationDate: " + creationDate);

    IRODSFileSystem irodsFileSystem = IRODSFileSystem.instance();

    DataTransferOperations dataTransferOperations = irodsFileSystem.getIRODSAccessObjectFactory().getDataTransferOperations(account);

    File sourceFile = new File(sourceFilePath);

    IRODSFileFactory irodsFileFactory = irodsFileSystem.getIRODSFileFactory(account);

    //newFileName = "/tempZone/home/rods/"+newFileName;
    String recoveryFolderPath = irodsPath + "/" + recoveryFolderName + "/";

    IRODSFile targetFileFolder = irodsFileFactory.instanceIRODSFile(recoveryFolderPath);

    targetFileFolder.mkdir();

    String targetFilePath = recoveryFolderPath;// + "/" + datasetName + "/";

    IRODSFile targetFile = irodsFileFactory.instanceIRODSFile(targetFilePath);

    targetFile.mkdir();

    // targetFilePath = irodsPath + targetFileName; 
    targetFilePath = targetFilePath + targetFileName;

    targetFile = irodsFileFactory.instanceIRODSFile(targetFilePath);

    DataTransferOperations dataTransferOperationsAO = irodsFileSystem.getIRODSAccessObjectFactory().getDataTransferOperations(account);

    dataTransferOperationsAO.putOperation(sourceFile, targetFile, null, null);

    DataObjectAO dataObjectAO = irodsFileSystem.getIRODSAccessObjectFactory().getDataObjectAO(account);

    dataObjectAO.findByAbsolutePath(targetFile.getAbsolutePath());

    AvuData avuData = new AvuData();
    avuData.setAttribute(USERNAME_LABEL);
    avuData.setValue(userName);

    AvuData avuData2 = new AvuData();
    avuData2.setAttribute(DATASET_URI_LABEL);
    avuData2.setValue(datasetURI);

    AvuData avuData3 = new AvuData();
    avuData3.setAttribute(CREATION_DATE_LABEL);
    avuData3.setValue(creationDate);

    AvuData avuData4 = new AvuData();
    avuData4.setAttribute(DATASET_TITLE_LABEL);
    avuData4.setValue(datasetName);

    AvuData avuData5 = new AvuData();
    avuData5.setAttribute(DATASET_TYPE_LABEL);
    avuData5.setValue(datasetType);

    dataObjectAO.addAVUMetadata(targetFile.getAbsolutePath(), avuData);
    dataObjectAO.addAVUMetadata(targetFile.getAbsolutePath(), avuData2);
    dataObjectAO.addAVUMetadata(targetFile.getAbsolutePath(), avuData3);
    dataObjectAO.addAVUMetadata(targetFile.getAbsolutePath(), avuData4);
    dataObjectAO.addAVUMetadata(targetFile.getAbsolutePath(), avuData5);
}
 
开发者ID:isl,项目名称:LifeWatch_Greece,代码行数:74,代码来源:ContentStorageService.java


示例12: search_datasets_uris_by_username

import org.irods.jargon.core.connection.IRODSAccount; //导入依赖的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;

}
 
开发者ID:isl,项目名称:LifeWatch_Greece,代码行数:43,代码来源:ContentStorageService.java


示例13: FileTemplateService

import org.irods.jargon.core.connection.IRODSAccount; //导入依赖的package包/类
/**
 * @param irodsAccessObjectFactory
 * @param irodsAccount
 */
public FileTemplateService(
		IRODSAccessObjectFactory irodsAccessObjectFactory,
		IRODSAccount irodsAccount) {
	super(irodsAccessObjectFactory, irodsAccount);
}
 
开发者ID:DICE-UNC,项目名称:jargon-extensions-if,代码行数:10,代码来源:FileTemplateService.java


示例14: get_dataset

import org.irods.jargon.core.connection.IRODSAccount; //导入依赖的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();

    }
 
开发者ID:isl,项目名称:LifeWatch_Greece,代码行数:50,代码来源:ContentStorageService.java



注:本文中的org.irods.jargon.core.connection.IRODSAccount类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ZenDiscovery类代码示例发布时间:2022-05-23
下一篇:
Java ResponseErrorListener类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap