Examples of HgRemoteConnectionException


Examples of org.tmatesoft.hg.core.HgRemoteConnectionException

            return new X509Certificate[0];
          }
        };
        sslContext.init(null, new TrustManager[] { new TrustEveryone() }, null);
      } catch (Exception ex) {
        throw new HgRemoteConnectionException("Can't initialize secure connection", ex);
      }
    } else {
      sslContext = null;
    }
  }
View Full Code Here

Examples of org.tmatesoft.hg.core.HgRemoteConnectionException

      while (st.nextToken() != StreamTokenizer.TT_EOF) {
        parseResult.add(Nodeid.fromAscii(st.sval));
      }
      return parseResult;
    } catch (IOException ex) {
      throw new HgRemoteConnectionException("Communication failure", ex).setRemoteCommand(CMD_HEADS).setServerInfo(getLocation());
    } finally {
      remote.sessionEnd();
    }
  }
View Full Code Here

Examples of org.tmatesoft.hg.core.HgRemoteConnectionException

        }
      }
      is.close();
      return rv;
    } catch (IOException ex) {
      throw new HgRemoteConnectionException("Communication failure", ex).setRemoteCommand(CMD_BETWEEN).setServerInfo(getLocation());
    } finally {
      remote.sessionEnd();
    }
  }
View Full Code Here

Examples of org.tmatesoft.hg.core.HgRemoteConnectionException

      ArrayList<Nodeid> parseResult = new ArrayList<Nodeid>(nodes.size() * 4);
      while (st.nextToken() != StreamTokenizer.TT_EOF) {
        parseResult.add(Nodeid.fromAscii(st.sval));
      }
      if (parseResult.size() != nodes.size() * 4) {
        throw new HgRemoteConnectionException(String.format("Bad number of nodeids in result (shall be factor 4), expected %d, got %d", nodes.size()*4, parseResult.size()));
      }
      ArrayList<RemoteBranch> rv = new ArrayList<RemoteBranch>(nodes.size());
      for (int i = 0; i < nodes.size(); i++) {
        RemoteBranch rb = new RemoteBranch(parseResult.get(i*4), parseResult.get(i*4 + 1), parseResult.get(i*4 + 2), parseResult.get(i*4 + 3));
        rv.add(rb);
      }
      return rv;
    } catch (IOException ex) {
      throw new HgRemoteConnectionException("Communication failure", ex).setRemoteCommand(CMD_BRANCHES).setServerInfo(getLocation());
    } finally {
      remote.sessionEnd();
    }
  }
View Full Code Here

Examples of org.tmatesoft.hg.core.HgRemoteConnectionException

      if (debug) {
        System.out.printf("Wrote bundle %s for roots %s\n", tf, roots);
      }
      return getLookupHelper().loadBundle(tf);
    } catch (IOException ex) {
      throw new HgRemoteConnectionException("Communication failure", ex).setRemoteCommand(CMD_CHANGEGROUP).setServerInfo(getLocation());
    } catch (HgRepositoryNotFoundException ex) {
      throw new HgRemoteConnectionException("Communication failure", ex).setRemoteCommand(CMD_CHANGEGROUP).setServerInfo(getLocation());
    } finally {
      remote.sessionEnd();
    }
  }
View Full Code Here

Examples of org.tmatesoft.hg.core.HgRemoteConnectionException

      bundleData.serialize(new OutputStreamSerializer(os));
      os.flush();
      os.close();
      os = null;
    } catch (IOException ex) {
      throw new HgRemoteConnectionException("Communication failure", ex).setRemoteCommand("unbundle").setServerInfo(getLocation());
    } catch (HgIOException ex) {
      throw new HgRemoteConnectionException("Communication failure", ex).setRemoteCommand("unbundle").setServerInfo(getLocation());
    } finally {
      new FileUtils(sessionContext.getLog(), this).closeQuietly(os);
      remote.sessionEnd();
    }
  }
View Full Code Here

Examples of org.tmatesoft.hg.core.HgRemoteConnectionException

      return;
    }
    try {
      remote.connect();
    } catch (HgAuthFailedException ex) {
      throw new HgRemoteConnectionException("Failed to authenticate", ex).setServerInfo(remote.getServerLocation());
    }
    try {
      remote.sessionBegin();
      String capsLine = remote.getCapabilities();
      String[] caps = capsLine.split("\\s");
View Full Code Here

Examples of org.tmatesoft.hg.core.HgRemoteConnectionException

    try {
      conn = new Connection(uri.getHost(), uri.getPort() == -1 ? 22 : uri.getPort());
      conn.connect();
      authenticateClient();
    } catch (IOException ex) {
      throw new HgRemoteConnectionException("Failed to establish connection").setServerInfo(getServerLocation());
    }
  }
View Full Code Here

Examples of org.tmatesoft.hg.core.HgRemoteConnectionException

        rv.add(new Pair<String,String>(l.substring(0, sep), l.substring(sep+1)));
      }
      r.close();
      return rv;
    } catch (IOException ex) {
      throw new HgRemoteConnectionException("Communication failure", ex).setRemoteCommand(CMD_LISTKEYS).setServerInfo(getLocation());
    } finally {
      remote.sessionEnd();
    }
  }
View Full Code Here

Examples of org.tmatesoft.hg.core.HgRemoteConnectionException

      remoteErr = new StreamGobbler(session.getStderr());
      remoteOut = new StreamGobbler(session.getStdout());
      remoteIn = session.getStdin();
      sessionUse = 1;
    } catch (IOException ex) {
      throw new HgRemoteConnectionException("Failed to create ssh session", ex);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.