use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.
the class LocalResource method getSvnProperties.
/* (non-Javadoc)
* @see org.tigris.subversion.subclipse.core.ISVNLocalResource#getSvnProperties()
*/
public ISVNProperty[] getSvnProperties() throws SVNException {
ISVNClientAdapter svnClient = null;
try {
svnClient = getRepository().getSVNClient();
ISVNProperty[] properties = svnClient.getProperties(getFile());
return properties;
} catch (SVNClientException e) {
throw SVNException.wrapException(e);
} finally {
getRepository().returnSVNClient(svnClient);
}
}
use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.
the class LogEntry method updateRootUrl.
/**
* @param resource
* @return rootURL
*/
private SVNUrl updateRootUrl(ISVNResource resource) {
ISVNClientAdapter client = null;
try {
client = SVNProviderPlugin.getPlugin().getSVNClient();
SVNProviderPlugin.disableConsoleLogging();
ISVNInfo info = client.getInfo(resource.getUrl());
SVNProviderPlugin.enableConsoleLogging();
if (info.getRepository() == null)
return resource.getUrl();
else {
// update the saved root URL
resource.getRepository().setRepositoryRoot(info.getRepository());
return info.getRepository();
}
} catch (Exception e) {
SVNProviderPlugin.enableConsoleLogging();
return resource.getUrl();
} finally {
SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
}
}
use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.
the class SVNRepositoryLocation method fromString.
/*
* Parse a location string and return a SVNRepositoryLocation.
* If useRootUrl is true, use the repository root URL.
*/
public static SVNRepositoryLocation fromString(String location, boolean validateOnly, boolean useRootUrl) throws SVNException {
if (!useRootUrl)
return fromString(location, validateOnly);
ISVNClientAdapter svnClient = SVNProviderPlugin.getPlugin().getSVNClient();
try {
SVNUrl url = new SVNUrl(location);
ISVNInfo info = svnClient.getInfo(url);
SVNUrl rootUrl = info.getRepository();
return fromString(rootUrl.toString());
} catch (MalformedURLException e) {
throw SVNException.wrapException(e);
} catch (SVNClientException e) {
throw SVNException.wrapException(e);
} finally {
SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(svnClient);
}
}
use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.
the class SVNRepositoryLocation method validateConnection.
/*
* Validate that the receiver contains valid information for
* making a connection. If the receiver contains valid
* information, the method returns. Otherwise, an exception
* indicating the problem is throw.
*/
public void validateConnection(IProgressMonitor monitor) throws SVNException {
ISVNClientAdapter svnClient = getSVNClient();
try {
// we try to get the list of directories and files using the connection
ISVNInfo info = svnClient.getInfo(getUrl());
repositoryRootUrl = info.getRepository();
} catch (SVNClientException e) {
// If the validation failed, dispose of any cached info
dispose();
throw SVNException.wrapException(e);
}
}
use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.
the class SVNHistoryPage method tagsPropertySet.
private boolean tagsPropertySet(ISVNRemoteResource resource) {
ISVNClientAdapter client = null;
try {
client = SVNProviderPlugin.getPlugin().getSVNClient();
ISVNProperty property = null;
SVNProviderPlugin.disableConsoleLogging();
// $NON-NLS-1$
property = client.propertyGet(resource.getUrl(), "subclipse:tags");
if (property != null && property.getValue() != null) {
SVNProviderPlugin.enableConsoleLogging();
return true;
}
ISVNRemoteResource checkResource = resource;
while (checkResource.getParent() != null) {
checkResource = checkResource.getParent();
// $NON-NLS-1$
property = client.propertyGet(checkResource.getUrl(), "subclipse:tags");
if (property != null && property.getValue() != null) {
SVNProviderPlugin.enableConsoleLogging();
return true;
}
}
} catch (Exception e) {
SVNProviderPlugin.enableConsoleLogging();
} finally {
SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
}
return false;
}
Aggregations