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


Java Authentication类代码示例

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


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

示例1: create

import org.apache.maven.artifact.ant.Authentication; //导入依赖的package包/类
public RemoteRepository create() {
    RemoteRepository remoteRepository = new RemoteRepository();
    remoteRepository.setUrl(artifactRepository.getUrl().toString());

    PasswordCredentials credentials = artifactRepository.getCredentials();
    String username = credentials.getUsername();
    String password = credentials.getPassword();

    if (username != null || password != null) {
        Authentication authentication = new Authentication();
        authentication.setUserName(username);
        authentication.setPassword(password);
        remoteRepository.addAuthentication(authentication);
    }

    return remoteRepository;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:18,代码来源:MavenRemoteRepositoryFactory.java

示例2: setChild

import org.apache.maven.artifact.ant.Authentication; //导入依赖的package包/类
public void setChild(FactoryBuilderSupport builder, Object parent, Object child) {
    if (child instanceof Authentication) {
        getRepository(parent).addAuthentication((Authentication) child);
    } else if (child instanceof Proxy) {
        getRepository(parent).addProxy((Proxy) child);
    } else if (child instanceof RepositoryPolicy) {
        if (builder.getCurrentName().equals("snapshots")) {
            getRepository(parent).addSnapshots((RepositoryPolicy) child);
        } else {
            getRepository(parent).addReleases((RepositoryPolicy) child);
        }
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:14,代码来源:RepositoryFactory.java

示例3: RepositoryBuilder

import org.apache.maven.artifact.ant.Authentication; //导入依赖的package包/类
public RepositoryBuilder() {
    registerFactory("repository", new RepositoryFactory(RemoteRepository.class));
    registerBeanFactory("authentication", Authentication.class);
    registerBeanFactory("proxy", Proxy.class);
    registerBeanFactory("snapshots", RepositoryPolicy.class);
    registerBeanFactory("releases", RepositoryPolicy.class);
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:8,代码来源:RepositoryBuilder.java

示例4: updateRepositoryWithSettings

import org.apache.maven.artifact.ant.Authentication; //导入依赖的package包/类
@Override
protected void updateRepositoryWithSettings( RemoteRepository repository )
{
    if ( repository.getAuthentication() == null )
    {
        Server server = getSettings().getServer( repository.getId() );
        if ( repository.getRefid() != null && server != null)
         {
             RemoteRepository instance = (RemoteRepository) getProject().getReference( repository.getRefid());
             instance.addAuthentication( new Authentication( server ) );
         }
    }
     
    super.updateRepositoryWithSettings(repository);
}
 
开发者ID:apache,项目名称:ant-easyant-tasks,代码行数:16,代码来源:Deploy.java


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