当前位置: 首页>>代码示例>>Java>>正文


Java OwnCloudCredentialsFactory.newBasicCredentials方法代码示例

本文整理汇总了Java中com.owncloud.android.lib.common.OwnCloudCredentialsFactory.newBasicCredentials方法的典型用法代码示例。如果您正苦于以下问题:Java OwnCloudCredentialsFactory.newBasicCredentials方法的具体用法?Java OwnCloudCredentialsFactory.newBasicCredentials怎么用?Java OwnCloudCredentialsFactory.newBasicCredentials使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.owncloud.android.lib.common.OwnCloudCredentialsFactory的用法示例。


在下文中一共展示了OwnCloudCredentialsFactory.newBasicCredentials方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import com.owncloud.android.lib.common.OwnCloudCredentialsFactory; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
	super.setUp();
	mSSMgr = new SingleSessionManager();
	mServerUri = Uri.parse(getContext().getString(R.string.server_base_url));
	mUsername = getContext().getString(R.string.username);
	
	mValidAccount = new OwnCloudAccount(
			mServerUri, OwnCloudCredentialsFactory.newBasicCredentials(
					mUsername, 
					getContext().getString(R.string.password)
			)
	);
	
	mAnonymousAccount = new OwnCloudAccount(
			mServerUri, OwnCloudCredentialsFactory.getAnonymousCredentials());
			
}
 
开发者ID:PicFrame,项目名称:picframe,代码行数:19,代码来源:SingleSessionManagerTest.java

示例2: setUp

import com.owncloud.android.lib.common.OwnCloudCredentialsFactory; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
	super.setUp();
	mSFMgr = new SimpleFactoryManager();
	mServerUri = Uri.parse(getContext().getString(R.string.server_base_url));
	mUsername = getContext().getString(R.string.username);
	
	mValidAccount = new OwnCloudAccount(
			mServerUri, OwnCloudCredentialsFactory.newBasicCredentials(
					mUsername, 
					getContext().getString(R.string.password)
			)
	);
	
	mAnonymousAccount = new OwnCloudAccount(
			mServerUri, OwnCloudCredentialsFactory.getAnonymousCredentials());
			
}
 
开发者ID:PicFrame,项目名称:picframe,代码行数:19,代码来源:SimpleFactoryManagerTest.java

示例3: testGetSetCredentials

import com.owncloud.android.lib.common.OwnCloudCredentialsFactory; //导入方法依赖的package包/类
public void testGetSetCredentials() {
	OwnCloudClient client = 
			new OwnCloudClient(mServerUri, NetworkUtils.getMultiThreadedConnManager());
	
	assertNotNull("Returned NULL credentials", client.getCredentials());
	assertEquals("Not instanced without credentials", 
			client.getCredentials(), OwnCloudCredentialsFactory.getAnonymousCredentials());
	
	OwnCloudCredentials credentials = 
			OwnCloudCredentialsFactory.newBasicCredentials("user", "pass");
	client.setCredentials(credentials);
	assertEquals("Basic credentials not set", credentials, client.getCredentials());
	
	credentials = OwnCloudCredentialsFactory.newBearerCredentials("bearerToken");
	client.setCredentials(credentials);
	assertEquals("Bearer credentials not set", credentials, client.getCredentials());

	credentials = OwnCloudCredentialsFactory.newSamlSsoCredentials("samlSessionCookie=124");
	client.setCredentials(credentials);
	assertEquals("SAML2 session credentials not set", credentials, client.getCredentials());
	
}
 
开发者ID:PicFrame,项目名称:picframe,代码行数:23,代码来源:OwnCloudClientTest.java


注:本文中的com.owncloud.android.lib.common.OwnCloudCredentialsFactory.newBasicCredentials方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。