adminClient.doCreateRepository(repository, null, false, false, false, false, false, false, true); adminClient.doLoad(repository, inputStream);
/** * Verifies the data stored in the repository. This method uses the dump implementation * (non incremental, beginning with revision 0, ending at the latest one) * passing a dummy output stream to it. This allows to check the integrity of the * repository data. * * <p/> * This is identical to <code>doVerify(repositoryRoot, SVNRevision.create(0), SVNRevision.HEAD)</code>. * * @param repositoryRoot a repository root directory path * @throws SVNException verification failed - a repository may be corrupted * @since 1.1.1 */ public void doVerify(File repositoryRoot) throws SVNException { doVerify(repositoryRoot, SVNRevision.create(0), SVNRevision.HEAD); }
/** * list all open transactions in a repository * * @param path the path to the repository * @param receiver receives one transaction name per call * @throws ClientException throw in case of problem */ public void lstxns(String path, final MessageReceiver receiver) throws ClientException { getAdminClient().setEventHandler(new SVNAdminEventAdapter() { public void handleAdminEvent(SVNAdminEvent event, double progress) throws SVNException { if (receiver != null && event.getTxnName() != null) { receiver.receiveMessageLine(event.getTxnName()); } } }); try { getAdminClient().doListTransactions(new File(path).getAbsoluteFile()); } catch (SVNException e) { JavaHLObjectFactory.throwException(e, myDelegate); } finally { getAdminClient().setEventHandler(null); } }
/** * Returns an instance of the {@link org.tmatesoft.svn.core.wc.admin.SVNAdminClient} class. * * <p> * If it's the first time this method is being called the object is * created, initialized and then returned. Further calls to this * method will get the same object instantiated at that moment of * the first call. <b>SVNClientManager</b> does not reinstantiate * its <b>SVN</b>*<b>Client</b> objects. * * @return an <b>SVNAdminClient</b> instance */ public SVNAdminClient getAdminClient() { if (myAdminClient == null) { myAdminClient = new SVNAdminClient(this, myOptions); myAdminClient.setEventHandler(myEventHandler); myAdminClient.setDebugLog(getDebugLog()); myAdminClient.setIgnoreExternals(myIsIgnoreExternals); } return myAdminClient; }
/** * recover the berkeley db of a repository, returns youngest revision * * @param path the path to the repository * @throws ClientException throw in case of problem */ public long recover(String path) throws ClientException { try { File repositoryRoot = new File(path).getAbsoluteFile(); getAdminClient().doRecover(repositoryRoot); return getAdminClient().getYoungestRevision(repositoryRoot); } catch (SVNException e) { JavaHLObjectFactory.throwException(e, myDelegate); } return -1; }
uuidAction = SVNUUIDAction.FORCE_UUID; getAdminClient().setEventHandler(new SVNAdminEventAdapter() { getAdminClient().doLoad(new File(path).getAbsoluteFile(), is, usePreCommitHook, usePostCommitHook, uuidAction, relativePath); } catch (SVNException e) { if (messageOutput != null) { getAdminClient().setEventHandler(null);
public void verify(File path, final OutputStream messageOut, Revision start, Revision end, ReposNotifyCallback callback) throws ClientException { beforeOperation(); try { getAdminClient().setEventHandler(new SVNAdminEventAdapter() { public void handleAdminEvent(SVNAdminEvent event, double progress) throws SVNException { if (messageOut != null && event.getAction() == SVNAdminEventAction.REVISION_DUMPED) { try { messageOut.write(event.getMessage().getBytes()); messageOut.write(client.getOptions().getNativeEOL()); } catch (IOException e) { } } } }); getAdminClient().doVerify(path.getAbsoluteFile(), SVNClientImpl.getSVNRevision(start), SVNClientImpl.getSVNRevision(end)); } catch (SVNException e) { try { if (messageOut != null) { messageOut.write(e.getErrorMessage().getFullMessage().getBytes("UTF-8")); messageOut.write(client.getOptions().getNativeEOL()); } } catch (IOException e1) { // } throwException(e, client); } finally { afterOperation(); } }
getAdminClient().setEventHandler(new SVNAdminEventAdapter() { @Override public void checkCancelled() throws SVNCancelException { getAdminClient().doDump(path.getAbsoluteFile(), os, SVNClientImpl.getSVNRevision(start), SVNClientImpl.getSVNRevision(end), incremental, useDeltas); } catch (SVNException e) { try {
public void run() throws SVNException { SVNAdminClient client = getEnvironment().getClientManager().getAdminClient(); client.setEventHandler(this); client.doRecover(getLocalRepository()); getEnvironment().getOut().println(); getEnvironment().getOut().println("Recovery completed."); long youngestRevision = client.getYoungestRevision(getLocalRepository()); String message = "The latest repos revision is {0}."; message = MessageFormat.format(message, new Object[] { String.valueOf(youngestRevision) }); getEnvironment().getOut().println(message); }
@Override protected SVNAdminEvent run() throws SVNException { SVNAdminClient ac = new SVNAdminClient(getOperation().getAuthenticationManager(), getOperation().getOptions()); ac.setEventHandler(this); ac.doLoad( getOperation().getRepositoryRoot(), getOperation().getDumpStream(), getOperation().isUsePreCommitHook(), getOperation().isUsePostCommitHook(), getOperation().getUuidAction(), getOperation().getParentDir()); return getOperation().first(); }
@Override protected SVNAdminEvent run() throws SVNException { SVNAdminClient ac = new SVNAdminClient(getOperation().getAuthenticationManager(), getOperation().getOptions()); ac.setEventHandler(this); ac.doVerify(getOperation().getRepositoryRoot(), getOperation().getStartRevision(), getOperation().getEndRevision()); return getOperation().first(); }
@Override protected SVNAdminEvent run() throws SVNException { SVNAdminClient ac = new SVNAdminClient(getOperation().getAuthenticationManager(), getOperation().getOptions()); ac.setEventHandler(this); ac.doRecover(getOperation().getRepositoryRoot()); return getOperation().first(); }
@Override protected Long run() throws SVNException { SVNAdminClient ac = new SVNAdminClient(getOperation().getAuthenticationManager(), getOperation().getOptions()); ac.setEventHandler(this); ac.doHotCopy(getOperation().getSrcRepositoryRoot(), getOperation().getNewRepositoryRoot()); return 1l; }
@Override protected SVNAdminEvent run() throws SVNException { SVNAdminClient ac = new SVNAdminClient(getOperation().getAuthenticationManager(), getOperation().getOptions()); ac.setEventHandler(this); ac.doListTransactions(getOperation().getRepositoryRoot()); return getOperation().first(); }
public void run() throws SVNException { SVNAdminClient client = getEnvironment().getClientManager().getAdminClient(); List targets = getEnvironment().combineTargets(null, false); if (!targets.isEmpty()) { targets.remove(0); } String[] transactions = (String[]) targets.toArray(new String[targets.size()]); client.setEventHandler(this); client.doRemoveTransactions(getLocalRepository(), transactions); }
@Override protected SVNAdminEvent run() throws SVNException { SVNAdminClient ac = new SVNAdminClient(getOperation().getAuthenticationManager(), getOperation().getOptions()); ac.setEventHandler(this); ac.doRemoveTransactions(getOperation().getRepositoryRoot(), getOperation().getTransactions()); return getOperation().first(); }
@Override protected SVNAdminEvent run() throws SVNException { SVNAdminClient ac = new SVNAdminClient(getOperation().getAuthenticationManager(), getOperation().getOptions()); ac.setEventHandler(this); ac.doDump(getOperation().getRepositoryRoot(), getOperation().getOut(), getOperation().getStartRevision(), getOperation().getEndRevision(), getOperation().isIncremental(), getOperation().isUseDelta()); return getOperation().first(); }
@Override protected SVNAdminEvent run() throws SVNException { SVNAdminClient ac = new SVNAdminClient(getOperation().getAuthenticationManager(), getOperation().getOptions()); ac.setEventHandler(this); ac.doSynchronize(getOperation().getToURL()); return getOperation().first(); }
@Override protected SVNAdminEvent run() throws SVNException { SVNAdminClient ac = new SVNAdminClient(getOperation().getAuthenticationManager(), getOperation().getOptions()); ac.setEventHandler(this); ac.doInitialize(getOperation().getFromURL(), getOperation().getToURL()); return getOperation().first(); }
@Override protected SVNAdminEvent run() throws SVNException { SVNAdminClient ac = new SVNAdminClient(getOperation().getAuthenticationManager(), getOperation().getOptions()); ac.setEventHandler(this); ac.doListLocks(getOperation().getRepositoryRoot()); return getOperation().first(); }