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

Java AuthenticationException类代码示例

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

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



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

示例1: execute

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
protected synchronized void execute(GeneralCommandLine commandLine) throws AuthenticationException {
  try {
    commandLine.withParentEnvironmentType(ParentEnvironmentType.CONSOLE);
    myProcess = commandLine.createProcess();

    myErrThread = new ReadProcessThread(
      new BufferedReader(new InputStreamReader(myProcess.getErrorStream(), EncodingManager.getInstance().getDefaultCharset()))) {
      protected void textAvailable(String s) {
        myErrorText.append(s);
        myErrorRegistry.registerError(s);
        myContainsError = true;
      }
    };
    final Application application = ApplicationManager.getApplication();
    myStdErrFuture = application.executeOnPooledThread(myErrThread);

    myInputStream = myProcess.getInputStream();
    myOutputStream = myProcess.getOutputStream();

    waitForProcess(application);
  }
  catch (Exception e) {
    closeInternal();
    throw new AuthenticationException(e.getLocalizedMessage(), e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:ConnectionOnProcess.java


示例2: SshSharedConnection

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
public SshSharedConnection(final String repository, final ConnectionSettings connectionSettings, final SshAuthentication authentication) {
  myValid = new AtomicBoolean(true);
  myRepository = repository;
  myConnectionSettings = connectionSettings;
  myLock = new Object();

  myConnectionFactory = new ThrowableComputable<Connection, AuthenticationException>() {
    public Connection compute() throws AuthenticationException {
      try {
        SshLogger.debug("connection factory called");
        return SshConnectionUtils.openConnection(connectionSettings, authentication);
      }
      catch (AuthenticationException e) {
        // todo +-
        myValid.set(false);
        throw e;
      } catch (IOException e) {
        // todo +-
        myValid.set(false);
        throw new AuthenticationException(e.getMessage(), e);
      }
    }
  };
  myQueue = new LinkedList<Cell>();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:SshSharedConnection.java


示例3: execute

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
public boolean execute(IRequestProcessor requestProcessor, IEventSender eventManager, ICvsListenerRegistry listenerRegistry, IClientEnvironment clientEnvironment, IProgressViewer progressViewer) throws CommandException,
                                                                                                                                                                                                                 AuthenticationException {
	BugLog.getInstance().assertNotNull(keywordSubstitution);

	final ICvsFiles cvsFiles;
	try {
		cvsFiles = scanFileSystem(clientEnvironment);
	}
	catch (IOException ex) {
		throw new IOCommandException(ex);
	}

	final Requests requests = new Requests(CommandRequest.ADMIN, clientEnvironment);
	requests.addArgumentRequest(keywordSubstitution, "-k");
	addFileRequests(cvsFiles, requests, clientEnvironment);
	requests.addLocalPathDirectoryRequest();
	addArgumentRequests(requests);

	return requestProcessor.processRequests(requests, FileStateRequestsProgressHandler.create(progressViewer, cvsFiles));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ChangeKeywordSubstCommand.java


示例4: execute

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
public boolean execute(IRequestProcessor requestProcessor, IEventSender eventManager, ICvsListenerRegistry listenerRegistry, IClientEnvironment clientEnvironment, IProgressViewer progressViewer) throws CommandException,
                                                                                                                                                                                                                 AuthenticationException {
	BugLog.getInstance().assertTrue(isSetLock() || isResetLock(), "Nothing specified");

	final ICvsFiles cvsFiles;
	try {
		cvsFiles = scanFileSystem(clientEnvironment);
	}
	catch (IOException ex) {
		throw new IOCommandException(ex);
	}

	final Requests requests = new Requests(CommandRequest.ADMIN, clientEnvironment);
	requests.addArgumentRequest(isSetLock(), "-l");
	requests.addArgumentRequest(isResetLock(), "-u");
	addFileRequests(cvsFiles, requests, clientEnvironment);
	requests.addLocalPathDirectoryRequest();
	addArgumentRequests(requests);

	final IRequestsProgressHandler requestsProgressHandler = FileStateRequestsProgressHandler.create(progressViewer, cvsFiles);
	return requestProcessor.processRequests(requests, requestsProgressHandler);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:AdminCommand.java


示例5: loginAll

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
public boolean loginAll(final boolean goOffline) {
  for (CvsEnvironment root : myRoots) {
    final CvsLoginWorker worker = root.getLoginWorker(myProject);

    try {
      final ThreeState checkResult = checkLoginWorker(worker, myForceCheck);
      if (! ThreeState.YES.equals(checkResult)) {
        if (ThreeState.UNSURE.equals(checkResult)) {
          if (goOffline) {
            worker.goOffline();
          }
          myExceptionConsumer.consume(new CvsException("Authentication canceled", root.getCvsRootAsString()));
        }
        return false;
      }
    } catch (AuthenticationException e) {
      myExceptionConsumer.consume(new CvsException(e, root.getCvsRootAsString()));
      return false;
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:LoginPerformer.java


示例6: silentLogin

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
@Override
public ThreeState silentLogin(boolean forceCheck) throws AuthenticationException {
  if (mySettings.isOffline())  return ThreeState.NO;

  try {
    silentLoginImpl(forceCheck);
  }
  catch (AuthenticationException e) {
    if (e.isSolveable()) {
      clearOldCredentials();
      return ThreeState.UNSURE;
    }
    throw e;
  }
  return ThreeState.YES;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:CvsLoginWorkerImpl.java


示例7: silentLoginImpl

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
@Override
protected void silentLoginImpl(boolean forceCheck) throws AuthenticationException {
  IConnection connection = mySettings.createConnection(new ReadWriteStatistics());
  try {
    connection.open(new StreamLogger());
    mySettings.setOffline(false);
  }
  finally {
    try {
      connection.close();
    }
    catch (IOException e) {
      LOG.info(e);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ExtConnectionCvsSettings.java


示例8: execute

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
public boolean execute(IRequestProcessor requestProcessor, IEventSender eventSender, ICvsListenerRegistry listenerRegistry, IClientEnvironment clientEnvironment, IProgressViewer progressViewer) throws CommandException,
                                                                                                                                                                                                                AuthenticationException {
	final ICvsFiles cvsFiles;
	try {
		cvsFiles = scanFileSystem(clientEnvironment);
	}
	catch (IOException ex) {
		throw new IOCommandException(ex);
	}

	final Requests requests = new Requests(CommandRequest.EDITORS, clientEnvironment);
	addFileRequests(cvsFiles, requests, clientEnvironment);
	requests.addLocalPathDirectoryRequest();
	addArgumentRequests(requests);

	final ICvsListener builder = new EditorsMessageParser(eventSender, clientEnvironment.getCvsFileSystem(), cvsFiles);
	builder.registerListeners(listenerRegistry);
	try {
		return requestProcessor.processRequests(requests, FileStateRequestsProgressHandler.create(progressViewer, cvsFiles));
	}
	finally {
		builder.unregisterListeners(listenerRegistry);
	}
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:EditorsCommand.java


示例9: execute

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
public boolean execute(IRequestProcessor requestProcessor, IEventSender eventManager, ICvsListenerRegistry listenerRegistry, IClientEnvironment clientEnvironment, IProgressViewer progressViewer) throws CommandException,
                                                                                                                                                                                                                 AuthenticationException {
	final ICvsFiles cvsFiles;
	try {
		cvsFiles = scanFileSystem(clientEnvironment);
	}
	catch (IOException ex) {
		throw new IOCommandException(ex);
	}

	final Requests requests = new Requests(CommandRequest.NOOP, clientEnvironment);
	addFileRequests(cvsFiles, requests, clientEnvironment);
	requests.addLocalPathDirectoryRequest();

	return requestProcessor.processRequests(requests, FileStateRequestsProgressHandler.create(progressViewer, cvsFiles));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:UneditCommand.java


示例10: execute

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
/**
 * Executes this command.
 *
 * @param requestProcessor the client services object that provides any necessary
 *               services to this command, including the ability to actually
 *               process all the requests
 */
public boolean execute(IRequestProcessor requestProcessor, IEventSender eventManager, ICvsListenerRegistry listenerRegistry, IClientEnvironment clientEnvironment, IProgressViewer progressViewer) throws CommandException,
                                                                                                                                                                                                                 AuthenticationException {
	final ICvsFiles cvsFiles;
	try {
		cvsFiles = scanFileSystem(clientEnvironment);
	}
	catch (IOException ex) {
		throw new IOCommandException(ex);
	}

	final Requests requests = new Requests(CommandRequest.WATCHERS, clientEnvironment);
	addFileRequests(cvsFiles, requests, clientEnvironment);
	requests.addLocalPathDirectoryRequest();
	addArgumentRequests(requests);

	return requestProcessor.processRequests(requests, FileStateRequestsProgressHandler.create(progressViewer, cvsFiles));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:WatchersCommand.java


示例11: checkout

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
private boolean checkout(ExpandedModules expandedModules, IRequestProcessor requestProcessor, ICvsListenerRegistry listenerRegistry, IClientEnvironment clientEnvironment)
         throws CommandException, AuthenticationException {
	// we first see whether the modules specified actually exist
	// checked out already. If so, we must work something like an update
	// command and send modified files to the server.
	processExistingModules(expandedModules, clientEnvironment);

	final Requests requests;
	requests = new Requests(CommandRequest.EXPORT, clientEnvironment);
	if (getAlternativeCheckoutDirectory() != null) {
		requests.addArgumentRequest("-d");
		requests.addArgumentRequest(getAlternativeCheckoutDirectory());
	}
	requests.addArgumentRequest(!isRecursive(), "-l");
	requests.addArgumentRequest(getUpdateByDate(), "-D");
	requests.addArgumentRequest(getUpdateByRevisionOrTag(), "-r");
	requests.addArgumentRequest(getKeywordSubstitution(), "-k");
	addModuleArguments(requests);
	requests.addLocalPathDirectoryRequest();

	try {
		return requestProcessor.processRequests(requests, new DummyRequestsProgressHandler());
	}
	finally {
	}
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:ExportCommand.java


示例12: execute

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
@Override
public boolean execute(IRequestProcessor requestProcessor, IEventSender eventManager,
                       ICvsListenerRegistry listenerRegistry,
                       IClientEnvironment clientEnvironment,
                       IProgressViewer progressViewer) throws CommandException, AuthenticationException {
  modules.clear();

  final Requests requests = new Requests(CommandRequest.CHECKOUT, clientEnvironment);
  requests.addArgumentRequest("-N");
  requests.addArgumentRequest("-c");
  requests.addDirectoryRequest(DirectoryObject.createInstance("/"));

  final ICvsListener listener = new GetModulesParser();
  listener.registerListeners(listenerRegistry);
  try {
    return requestProcessor.processRequests(requests, new DummyRequestsProgressHandler());
  }
  finally {
    listener.unregisterListeners(listenerRegistry);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ListModulesCommand.java


示例13: expandModules

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
private boolean expandModules(ExpandedModules expandedModules,
                              ICvsListenerRegistry listenerRegistry,
                              IRequestProcessor requestProcessor,
                              IClientEnvironment clientEnvironment) throws CommandException, AuthenticationException {
  final Requests requests = new Requests(new ExpandModulesRequest(), clientEnvironment);

  addModuleArguments(requests);
  requests.addLocalPathDirectoryRequest();

  expandedModules.registerListeners(listenerRegistry);
  try {
    return requestProcessor.processRequests(requests, new DummyRequestsProgressHandler());
  }
  finally {
    expandedModules.unregisterListeners(listenerRegistry);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:CheckoutCommand.java


示例14: execute

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
protected synchronized void execute(GeneralCommandLine commandLine) throws AuthenticationException {
  try {
    commandLine.setPassParentEnvironment(true);
    myProcess = commandLine.createProcess();

    myErrThread = new ReadProcessThread(
      new BufferedReader(new InputStreamReader(myProcess.getErrorStream(), EncodingManager.getInstance().getDefaultCharset()))) {
      protected void textAvailable(String s) {
        myErrorText.append(s);
        myErrorRegistry.registerError(s);
        myContainsError = true;
      }
    };
    final Application application = ApplicationManager.getApplication();
    myStdErrFuture = application.executeOnPooledThread(myErrThread);

    myInputStream = myProcess.getInputStream();
    myOutputStream = myProcess.getOutputStream();

    waitForProcess(application);
  }
  catch (Exception e) {
    closeInternal();
    throw new AuthenticationException(e.getLocalizedMessage(), e);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:ConnectionOnProcess.java


示例15: processCommand

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
/**
 * Process the CVS command passed in args[] array with all necessary
 * options. The only difference from main() method is, that this method
 * does not exit the JVM and provides command output.
 *
 * @param args The command with options
 * @throws AuthenticationException 
 * @throws CommandException 
 */
public boolean processCommand(String command, GlobalOptions globalOptions, String[] args, File workingDir, CVSListener listener)
  throws AuthenticationException, CommandException {

  // if we don't have a CVS root by now, the user has messed up
  if (globalOptions.getCVSRoot() == null) {
    throw new IllegalStateException("No CVS root is set. Please set " + CvsConfiguration.CVS_ROOT_PROP_KEY + ".");
  }

  final String cvsRoot = globalOptions.getCVSRoot();
  CVSRoot root = parseCvsRoot(cvsRoot);

  org.netbeans.lib.cvsclient.command.Command c = CommandFactory.getDefault().createCommand(command, args, 0, globalOptions, workingDir.getAbsolutePath());

  String username = getUsername(root);
  String password = getPassword(cvsRoot, root);
  try {
    connect(workingDir, root, username, password);
    client.getEventManager().addCVSListener(listener);
    LOG.debug("Executing CVS command: " + c.getCVSCommand());
    return client.executeCommand(c, globalOptions);
  } finally {
    disconnect();
  }
}
 
开发者ID:SonarSource,项目名称:sonar-scm-cvs,代码行数:34,代码来源:CvsCommandExecutor.java


示例16: getModules

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
public List<String> getModules(CvsCredentials cvsCredentials, String localPath)
			throws CommandException, CommandAbortedException, AuthenticationException {
		
		try {
			Client client = CvsConnection.openClient(cvsCredentials.getCvsRoot(), cvsCredentials.getPassword(), localPath);
			globalOptions = new GlobalOptions();
			globalOptions.setCVSRoot(cvsCredentials.getCvsRoot());
			globalOptions.setDoNoChanges(true);

			UpdateCommand updateCommand = new UpdateCommand();
			updateCommand.setBuildDirectories(true);
			AdminHandler handler = new StandardAdminHandler();

			client.setAdminHandler(handler);
			EventManager eventManager = client.getEventManager();
			ModuleCollectingListener moduleCollectingListener = new ModuleCollectingListener();
			eventManager.addCVSListener(moduleCollectingListener);
			client.executeCommand(updateCommand, globalOptions);
			return moduleCollectingListener.getModules();
		} finally {
//			closeConnection(connection);
		}
	}
 
开发者ID:raymyers,项目名称:dev-search,代码行数:24,代码来源:CvsModuleList.java


示例17: open

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
public void open() throws AuthenticationException {
  if (!myLocalSettings.isCvsClientVerified()) {
    verifyServerCapability();
    myLocalSettings.setCvsClientVerified(true);
  }

  final GeneralCommandLine commandLine = new GeneralCommandLine();
  commandLine.setExePath(myLocalSettings.PATH_TO_CVS_CLIENT);
  commandLine.addParameter("server");
  
  execute(commandLine);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:LocalConnection.java


示例18: verifyServerCapability

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
private void verifyServerCapability() throws AuthenticationException {
  final GeneralCommandLine commandLine = new GeneralCommandLine();
  commandLine.setExePath(myLocalSettings.PATH_TO_CVS_CLIENT);
  commandLine.addParameter("-v");
  execute(commandLine);
  try {
    StringBuilder responseBuilder = new StringBuilder();
    while(true) {
      int c = myInputStream.read();
      if (c == -1) {
        break;
      }
      responseBuilder.append((char) c);
    }
    String[] lines = responseBuilder.toString().split("\n");
    for (String line : lines) {
      // check that the first non-empty line does not end with (client)
      if (line.trim().endsWith("(client)")) {
        throw new AuthenticationException("CVS client does not support server mode operation", null);
      }
      if (line.trim().length() > 0) {
        break;
      }
    }
  }
  catch (IOException e) {
    throw new AuthenticationException("Can't read CVS version", e);
  }
  closeInternal();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:LocalConnection.java


示例19: Cell

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
private Cell(final ThrowableComputable<Connection, AuthenticationException> factory, final String repository) {
  myConnectionLifeCycle = new ConnectionLifeCycle(CHECK_GRANULARITY, factory);
  myRepository = repository;
  mySessions = new LinkedList<IConnection>();

  myCloseListener = new Consumer<SshSessionConnection>() {
        public void consume(final SshSessionConnection sshSessionConnection) {
          synchronized (myLock) {
            final boolean removed = mySessions.remove(sshSessionConnection);
            SshLogger.debug("shared connection: session closed notification, removed: " + removed);
            myTs = System.currentTimeMillis();
          }
        }
      };

  mySessionProvider = new ThrowableComputable<Session, AuthenticationException>() {
    public Session compute() throws AuthenticationException {
      final Connection connection;
      synchronized (myLock) {
        connection = myConnectionLifeCycle.getConnection();
      }
      SshLogger.debug("shared connection: opening session");
      try {
        final Session session = connection.openSession();
        session.execCommand("cvs server");
        return session;
      }
      catch (IOException e) {
        throw new AuthenticationException(e.getMessage(), e);
      }
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:34,代码来源:SshSharedConnection.java


示例20: openConnection

import org.netbeans.lib.cvsclient.connection.AuthenticationException; //导入依赖的package包/类
public static Connection openConnection(final ConnectionSettings connectionSettings, final SshAuthentication authentication)
  throws AuthenticationException, IOException {
  final int port = connectionSettings.getPort() == -1 ? SSH_DEFAULT_PORT : connectionSettings.getPort();
  final Connection connection = new Connection(connectionSettings.getHostName(), port);
  final ProxyData proxy = SshProxyFactory.createAndRegister(connectionSettings);
  if (proxy != null) {
    connection.setProxyData(proxy);
  }
  connection.connect(null, connectionSettings.getConnectionTimeout(), connectionSettings.getConnectionTimeout());
  authentication.authenticate(connection);
  //HTTPProxyException
  return connection;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:SshConnectionUtils.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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