@Override public synchronized Locations getLocations(String application, String profile, String label) { if (label == null) { label = this.defaultLabel; } SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); if (hasText(getUsername())) { svnOperationFactory .setAuthenticationManager(new DefaultSVNAuthenticationManager(null, false, getUsername(), getPassword())); } try { String version; if (new File(getWorkingDirectory(), ".svn").exists()) { version = update(svnOperationFactory, label); } else { version = checkout(svnOperationFactory); } return new Locations(application, profile, label, version, getPaths(application, profile, label)); } catch (SVNException e) { throw new IllegalStateException("Cannot checkout repository", e); } finally { svnOperationFactory.dispose(); } }
public ISVNProxyManager getProxyManager(SVNURL url) throws SVNException { final ISVNHostOptions hostOptions = getHostOptionsProvider().getHostOptions(url); String proxyHost = hostOptions.getProxyHost(); if (proxyHost == null) { return null; } String proxyPort = hostOptions.getProxyPort(); String proxyUser = hostOptions.getProxyUserName(); String proxyPassword = hostOptions.getProxyPassword(); return new SimpleProxyManager(proxyHost, proxyPort, proxyUser, proxyPassword); }
public boolean isStorePlainTextPassphrases(String realm, SVNAuthentication auth) throws SVNException { if (!super.hasStorePlainTextPassphrasesOption()) { ISVNAuthStoreHandler handler = getAuthenticationStorageOptions().getAuthStoreHandler(); if (handler != null) { return handler.canStorePlainTextPassphrases(realm, auth); } return false; } return super.isStorePlainTextPassphrases(realm, auth); } }
public void openDir(String path, long revision) throws SVNException { SVNDirectoryInfo parentDir = myCurrentDirectory; myCurrentDirectory = new SVNDirectoryInfo(myCurrentDirectory, path, false); if (parentDir.myIsSkip || parentDir.myIsTreeConflicted) { myCurrentDirectory.myIsSkip = true; return; } myCurrentDirectory.loadFromRepository(revision); boolean[] isTreeConflicted = { false }; getDiffCallback().directoryOpened(path, revision, isTreeConflicted); myCurrentDirectory.myIsTreeConflicted = isTreeConflicted[0]; }
private SVNNodeKind getDiskKind(String path) { File file = getFile(path); SVNFileType type = null; type = SVNFileType.getType(file); if (type == SVNFileType.UNKNOWN) { return SVNNodeKind.UNKNOWN; } if (myIsDryRun && isPathDeleted(path)) { return SVNNodeKind.NONE; } return SVNFileType.getNodeKind(type); }
public void addFile(String path, String copyFromPath, long copyFromRevision) throws SVNException { myCurrentFile = new SVNFileInfo(path, true); myCurrentFile.myBaseProperties = Collections.EMPTY_MAP; myCurrentFile.myBaseFile = SVNFileUtil.createUniqueFile(getTempDirectory(), "diff", ".tmp"); SVNFileUtil.createEmptyFile(myCurrentFile.myBaseFile); }
/** * Sets an autoproperty - binds a file name pattern with a * string in the form of <code>"propName=propValue"</code>. * * @param pattern a file name pattern (usually containing * wildcards) * @param properties a property for <code>pattern</code> */ public void setAutoProperty(String pattern, String properties) { getConfigFile().setPropertyValue(AUTOPROPS_GROUP, pattern, properties, !myIsReadonly); }
private File getTempDirectory() throws SVNException { if (myTempDirectory == null) { myTempDirectory = getDiffCallback().createTempDirectory(); } return myTempDirectory; }
/** * Returns autoproperties as a {@link java.util.Map} * where each key is a file name pattern and the corresponding * value is a string in the form of <code>"propName=propValue"</code>. * * @return a {@link java.util.Map} containing autoproperties */ public Map getAutoProperties() { return getConfigFile().getProperties(AUTOPROPS_GROUP); }
public boolean isStorePlainTextPasswords(String realm, SVNAuthentication auth) throws SVNException { if (!super.hasStorePlainTextPasswordsOption()) { ISVNAuthStoreHandler handler = getAuthenticationStorageOptions().getAuthStoreHandler(); if (handler != null) { return handler.canStorePlainTextPasswords(realm, auth); } return false; } return super.isStorePlainTextPasswords(realm, auth); }
public void openFile(String path, long revision) throws SVNException { myCurrentFile = createFileInfo(path, false); if (myCurrentDirectory.myIsSkip || myCurrentDirectory.myIsTreeConflicted) { myCurrentFile.myIsSkip = true; return; } myCurrentFile.loadFromRepository(revision); }
public TrustManager getTrustManager(SVNURL url) throws SVNException { final ISVNHostOptions hostOptions = getHostOptionsProvider().getHostOptions(url); boolean trustAll = hostOptions.trustDefaultSSLCertificateAuthority(); File[] serverCertFiles = hostOptions.getSSLAuthorityFiles(); File authDir = new File(myConfigDirectory, "auth/svn.ssl.server"); return new DefaultSVNSSLTrustManager(authDir, url, serverCertFiles, trustAll, this); }
public boolean isSSLPassphrasePromtSupported() { if (getAuthenticationProvider() == null) { return true; } else if (getAuthenticationProvider() instanceof ISVNSSLPasspharsePromptSupport) { return ((ISVNSSLPasspharsePromptSupport) getAuthenticationProvider()).isSSLPassphrasePromtSupported(); } return false; }
protected ISVNEntryHandler getMergeInfoEntryHandler(String mergeSrcPath, SVNURL sourceRootURL, long revision1, long revision2, SVNRepository repository, SVNDepth depth, List childrenWithMergeInfo) { if (skipExtendedMerge()) { return super.getMergeInfoEntryHandler(mergeSrcPath, sourceRootURL, revision1, revision2, repository, depth, childrenWithMergeInfo); } return new MergeInfoFetcherExt(mergeSrcPath, sourceRootURL, revision1, revision2, repository, depth, childrenWithMergeInfo); }
public boolean isSSLPassphrasePromptSupported() { if (getAuthenticationStorageOptions() == ISVNAuthenticationStorageOptions.DEFAULT) { return DefaultSVNAuthenticationManager.this.isSSLPassphrasePromtSupported(); } return getAuthenticationStorageOptions().isSSLPassphrasePromptSupported(); }
@Override public ISVNHostOptions getHostOptions(SVNURL url) { return new ExtendedHostOptions(getServersFile(), url); } }
@SuppressWarnings("rawtypes") public void setInMemoryServersOptions(Map serversOptions) { if (getHostOptionsProvider() instanceof DefaultSVNHostOptionsProvider) { DefaultSVNHostOptionsProvider defaultHostOptionsProvider = (DefaultSVNHostOptionsProvider) getHostOptionsProvider(); defaultHostOptionsProvider.setInMemoryServersOptions(serversOptions); } }
public void openDir(String path, long revision) throws SVNException { SVNDirectoryInfo parentDir = myCurrentDirectory; myCurrentDirectory = new SVNDirectoryInfo(myCurrentDirectory, path, false); if (parentDir.myIsSkip || parentDir.myIsTreeConflicted) { myCurrentDirectory.myIsSkip = true; return; } myCurrentDirectory.loadFromRepository(revision); boolean[] isTreeConflicted = { false }; getDiffCallback().directoryOpened(path, revision, isTreeConflicted); myCurrentDirectory.myIsTreeConflicted = isTreeConflicted[0]; }
/** * Removes a particular autoproperty by specifying a file name * pattern. * * @param pattern a file name pattern * @see #setAutoProperty(String, String) * */ public void deleteAutoProperty(String pattern) { getConfigFile().setPropertyValue(AUTOPROPS_GROUP, pattern, null, !myIsReadonly); }
public void openDir(String path, long revision) throws SVNException { SVNDirectoryInfo parentDir = myCurrentDirectory; myCurrentDirectory = new SVNDirectoryInfo(myCurrentDirectory, path, false); if (parentDir.myIsSkip || parentDir.myIsTreeConflicted) { myCurrentDirectory.myIsSkip = true; return; } myCurrentDirectory.loadFromRepository(revision); boolean[] isTreeConflicted = { false }; getDiffCallback().directoryOpened(path, revision, isTreeConflicted); myCurrentDirectory.myIsTreeConflicted = isTreeConflicted[0]; }