/** * Returns an instance of the {@link SVNDiffClient} 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>SVNDiffClient</b> instance */ public SVNDiffClient getDiffClient() { if (myDiffClient == null) { myDiffClient = myOperationFactory != null ? new SVNDiffClient(myOperationFactory) : new SVNDiffClient(this, myOptions); initClientDefaults(myDiffClient); } return myDiffClient; }
public ByteArrayOutputStream getDiff(String text) throws IOException { File pathToFile = new File(checkoutdir, fileName); SVNDiffClient diffClient = new SVNDiffClient(manager, svnOption); FileUtils.writeStringToFile(pathToFile, text, "UTF-8"); ByteArrayOutputStream diff = new ByteArrayOutputStream(); try { diffClient.doDiff(pathToFile, SVNRevision.UNDEFINED, SVNRevision.WORKING, SVNRevision.HEAD, SVNDepth.INFINITY, true, diff, null); } catch (SVNException e) { log.error("Diff fail", e); } return diff; }
SVNDiffClient diffClient = new SVNDiffClient(authManager, null);
/** * Returns an instance of the {@link SVNDiffClient} 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>SVNDiffClient</b> instance */ public SVNDiffClient getDiffClient() { if (myDiffClient == null) { myDiffClient = new SVNDiffClient(this, myOptions); myDiffClient.setEventHandler(myEventHandler); myDiffClient.setDebugLog(getDebugLog()); } return myDiffClient; }
/** * Returns an instance of the {@link SVNDiffClient} 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>SVNDiffClient</b> instance */ public SVNDiffClient getDiffClient() { if (myDiffClient == null) { myDiffClient = new SVNDiffClient(this, myOptions); myDiffClient.setEventHandler(myEventHandler); myDiffClient.setDebugLog(getDebugLog()); myDiffClient.setIgnoreExternals(myIsIgnoreExternals); } return myDiffClient; }
/** * Returns an instance of the {@link SVNDiffClient} 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>SVNDiffClient</b> instance */ public SVNDiffClient getDiffClient() { if (myDiffClient == null) { myDiffClient = new SVNDiffClient(this, myOptions); myDiffClient.setEventHandler(myEventHandler); myDiffClient.setDebugLog(getDebugLog()); myDiffClient.setIgnoreExternals(myIsIgnoreExternals); } return myDiffClient; }