本文整理汇总了Java中org.tmatesoft.svn.core.SVNErrorMessage类的典型用法代码示例。如果您正苦于以下问题:Java SVNErrorMessage类的具体用法?Java SVNErrorMessage怎么用?Java SVNErrorMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SVNErrorMessage类属于org.tmatesoft.svn.core包,在下文中一共展示了SVNErrorMessage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getCopy
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
public long getCopy(String relativePath, long revision, SVNProperties properties, OutputStream contents) throws SVNException {
// URL 검증
if (relativePath.isEmpty() || relativePath.endsWith("/"))
throw new SVNException(SVNErrorMessage.create(SVNErrorCode.BAD_URL, "Invalide relativePath : " + relativePath));
SVNRepository repository = getRepository();
LOGGER.debug("getCopy : {} ", relativePath);
SVNNodeKind checkPath = repository.checkPath(relativePath, revision);
long result = -1;
if (checkPath == SVNNodeKind.FILE) {
// return the revision the file has been taken at
result = repository.getFile(relativePath, revision, properties, contents);
int lastIndexOf = ValueUtil.lastIndexOf(relativePath, '/');
String fileName = relativePath.substring(lastIndexOf) + 1;
LOGGER.debug(fileName);
}
return result;
}
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:24,代码来源:SVNCheckout.java
示例2: checkForException
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
private void checkForException(final StringBuffer sbError) throws SVNException {
if (sbError.length() == 0) return;
final String message = sbError.toString();
final Matcher matcher = ourExceptionPattern.matcher(message);
if (matcher.matches()) {
final String group = matcher.group(1);
if (group != null) {
try {
final int code = Integer.parseInt(group);
throw new SVNException(SVNErrorMessage.create(SVNErrorCode.getErrorCode(code), message));
} catch (NumberFormatException e) {
//
}
}
}
if (message.contains(ourAuthenticationRealm)) {
throw new SVNException(SVNErrorMessage.create(SVNErrorCode.AUTHN_CREDS_UNAVAILABLE, message));
}
throw new SVNException(SVNErrorMessage.create(SVNErrorCode.UNKNOWN, message));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:CmdUpdateClient.java
示例3: requestClientAuthentication
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
public SVNAuthentication requestClientAuthentication(final String kind, final SVNURL url, final String realm, final SVNErrorMessage errorMessage,
final SVNAuthentication previousAuth, final boolean authMayBeStored) {
try {
return wrapNativeCall(new ThrowableComputable<SVNAuthentication, SVNException>() {
@Override
public SVNAuthentication compute() throws SVNException {
final SVNAuthentication svnAuthentication =
myDelegate.requestClientAuthentication(kind, url, realm, errorMessage, previousAuth, authMayBeStored);
myListener.getMulticaster().requested(ProviderType.persistent, url, realm, kind, svnAuthentication == null);
return svnAuthentication;
}
});
}
catch (SVNException e) {
LOG.info(e);
throw new RuntimeException(e);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:SvnAuthenticationManager.java
示例4: requestClientAuthentication
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
public SVNAuthentication requestClientAuthentication(final String kind,
final SVNURL url,
final String realm,
SVNErrorMessage errorMessage,
final SVNAuthentication previousAuth,
final boolean authMayBeStored) {
if (ApplicationManager.getApplication().isUnitTestMode() && ISVNAuthenticationManager.USERNAME.equals(kind)) {
final String userName = previousAuth != null && previousAuth.getUserName() != null ? previousAuth.getUserName() : SystemProperties.getUserName();
return new SVNUserNameAuthentication(userName, false);
}
final SvnAuthenticationNotifier.AuthenticationRequest obj =
new SvnAuthenticationNotifier.AuthenticationRequest(myProject, kind, url, realm);
final SVNURL wcUrl = myAuthenticationNotifier.getWcUrl(obj);
if (wcUrl == null || ourForceInteractive.contains(Thread.currentThread())) {
// outside-project url
return mySvnInteractiveAuthenticationProvider.requestClientAuthentication(kind, url, realm, errorMessage, previousAuth, authMayBeStored);
} else {
if (myAuthenticationNotifier.ensureNotify(obj)) {
return myAuthenticationManager.requestFromCache(kind, url, realm, errorMessage, previousAuth, authMayBeStored);
}
}
return null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:SvnAuthenticationProvider.java
示例5: getEnabledFactories
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
public Collection getEnabledFactories(File path, Collection factories, boolean writeAccess) throws SVNException {
if (ApplicationManager.getApplication().isUnitTestMode()) {
return factories;
}
if (!writeAccess) {
return factories;
}
Collection result = null;
final WorkingCopyFormat presetFormat = SvnWorkingCopyFormatHolder.getPresetFormat();
if (presetFormat != null) {
result = format2Factories(presetFormat, factories);
}
if (result == null) {
final WorkingCopyFormat format = SvnFormatSelector.getWorkingCopyFormat(path);
result = format2Factories(format, factories);
}
if (result == null) {
throw new SVNException(SVNErrorMessage.create(SVNErrorCode.WC_NOT_DIRECTORY));
}
return result;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:SvnKitAdminAreaFactorySelector.java
示例6: waitForFreeConnections
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
private void waitForFreeConnections() throws SVNException {
synchronized (myLock) {
while (myCurrentlyActiveConnections >= CachingSvnRepositoryPool.ourMaxTotal && ! myDisposed) {
try {
myLock.wait(500);
}
catch (InterruptedException e) {
//
}
ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
if (indicator != null && indicator.isCanceled()) {
throw new SVNException(SVNErrorMessage.create(SVNErrorCode.CANCELLED));
}
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ApplicationLevelNumberConnectionsGuardImpl.java
示例7: requestClientAuthentication
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
@Override
public SVNAuthentication requestClientAuthentication(String kind,
SVNURL url,
String realm,
SVNErrorMessage errorMessage,
SVNAuthentication previousAuth,
boolean authMayBeStored) {
authMayBeStored = authMayBeStored && mySaveData;
Convertor<SVNURL, SVNAuthentication> convertor = myData.get(kind);
SVNAuthentication result = convertor == null ? null : convertor.convert(url);
if (result == null) {
if (ISVNAuthenticationManager.USERNAME.equals(kind)) {
result = new SVNUserNameAuthentication("username", authMayBeStored);
} else if (ISVNAuthenticationManager.PASSWORD.equals(kind)) {
result = new SVNPasswordAuthentication("username", "abc", authMayBeStored, url, false);
} else if (ISVNAuthenticationManager.SSH.equals(kind)) {
result = new SVNSSHAuthentication("username", "abc", -1, authMayBeStored, url, false);
} else if (ISVNAuthenticationManager.SSL.equals(kind)) {
result = new SVNSSLAuthentication(new File("aaa"), "abc", authMayBeStored, url, false);
}
}
if (! ISVNAuthenticationManager.USERNAME.equals(kind)) {
myManager.requested(ProviderType.interactive, url, realm, kind, result == null);
}
return result;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnTestInteractiveAuthentication.java
示例8: requestClientAuthentication
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
@Override
public SVNAuthentication requestClientAuthentication(String kind,
SVNURL url,
String realm,
SVNErrorMessage errorMessage,
SVNAuthentication previousAuth,
boolean authMayBeStored) {
authMayBeStored = authMayBeStored && mySaveData;
SVNAuthentication result = null;
if (ISVNAuthenticationManager.USERNAME.equals(kind)) {
result = new SVNUserNameAuthentication("username", authMayBeStored);
} else if (ISVNAuthenticationManager.PASSWORD.equals(kind)) {
result = new SVNPasswordAuthentication("username", "abc", authMayBeStored, url, false);
} else if (ISVNAuthenticationManager.SSH.equals(kind)) {
result = new SVNSSHAuthentication("username", "abc", -1, authMayBeStored, url, false);
} else if (ISVNAuthenticationManager.SSL.equals(kind)) {
result = new SVNSSLAuthentication(new File("aaa"), "abc", authMayBeStored, url, false);
}
if (! ISVNAuthenticationManager.USERNAME.equals(kind)) {
myManager.requested(ProviderType.interactive, url, realm, kind, result == null);
}
return result;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:SvnAuthenticationTest.java
示例9: handleAttributes
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
protected void handleAttributes(DAVElement parent, DAVElement element, Attributes attrs) throws SVNException {
if (element == ENTRY && parent == ServletDAVHandler.UPDATE_REPORT) {
setEntryLinkPath(attrs.getValue(LINKPATH_ATTR));
setEntryLockToken(attrs.getValue(LOCK_TOKEN_ATTR));
String revisionString = attrs.getValue(REVISION_ATTR);
if (revisionString == null) {
SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "Missing XML attribute: rev"), SVNLogType.NETWORK);
}
try {
setEntryRevision(Long.parseLong(revisionString));
} catch (NumberFormatException nfe) {
SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, nfe), SVNLogType.NETWORK);
}
setDepth(SVNDepth.fromString(attrs.getValue(DEPTH_ATTR)));
if (attrs.getValue(START_EMPTY_ATTR) != null) {
setEntryStartEmpty(true);
}
} else if (element != MISSING || parent != ServletDAVHandler.UPDATE_REPORT) {
if (isInitialized()) {
SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "Invalid XML elements order: entry elements should follow any other."), SVNLogType.NETWORK);
}
getDAVRequest().startElement(parent, element, attrs);
}
}
开发者ID:naver,项目名称:svngit,代码行数:25,代码来源:SVNGitDAVUpdateHandler.java
示例10: getFileSHA1Checksum
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
@Override
public String getFileSHA1Checksum() throws SVNException {
String path = getCreatedPath();
long revision = getTextRepresentation().getRevision();
Repository gitRepository = myGitFS.getGitRepository();
try {
RevTree tree = new RevWalk(gitRepository).parseTree(gitRepository.resolve("refs/svn/" + revision));
TreeWalk treeWalk = TreeWalk.forPath(gitRepository, path, tree);
if (treeWalk.isSubtree()) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FILE, "Attempted to get checksum of a *non*-file node");
SVNErrorManager.error(err, SVNLogType.FSFS);
}
return treeWalk.getObjectId(0).getName();
} catch (IOException e) {
SVNDebugLog.getDefaultLog().logError(SVNLogType.DEFAULT, e.getMessage());
return "";
}
}
开发者ID:naver,项目名称:svngit,代码行数:19,代码来源:GitFSRevisionNode.java
示例11: getResourcePathInfo
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
private String getResourcePathInfo(HttpServletRequest request) throws SVNException {
String pathInfo = request.getPathInfo();
if (pathInfo == null || "".equals(pathInfo)) {
pathInfo = "/";
} else {
pathInfo = SVNEncodingUtil.uriDecode(pathInfo);
}
if (getDAVConfig().isUsingRepositoryPathDirective()) {
return pathInfo;
}
if (pathInfo == null || pathInfo.length() == 0 || "/".equals(pathInfo)) {
SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED), SVNLogType.NETWORK);
//TODO: client tried to access repository parent path, result status code should be FORBIDDEN.
}
return DAVPathUtil.removeHead(pathInfo, true);
}
开发者ID:naver,项目名称:svngit,代码行数:19,代码来源:SVNGitRepositoryManager.java
示例12: downloadFile
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
public long downloadFile(String svn_path, String local_path) throws SVNException, IOException {
SVNNodeKind nodeKind = repository.checkPath(svn_path, version);
if ( nodeKind == SVNNodeKind.FILE ) {
SVNProperties props = new SVNProperties();
FileOutputStream fOS = new FileOutputStream(new File(local_path));
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
long updated = repository.getFile(svn_path, version, props, fOS);
buffer.flush();
buffer.close();
try {
updated = Long.parseLong(props.getStringValue(COMMIT_VERSION));
} catch (NumberFormatException e) {
logger.warn("Could not transform committed revision " + props.getStringValue("svn:entry:committed-rev") + " to a long value");
}
return updated;
} else {
throw new SVNException(SVNErrorMessage.create(SVNErrorCode.BAD_FILENAME, "requested file " + svn_path + " is not a file"));
}
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:23,代码来源:MySVNClient.java
示例13: getFile
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
/**
* Gets a file from the repository.
*
* @param sourceURL The full path to the file, reachable via the read repository.
* @param destination The destination file.
* @param revision The subversion revision.
* @throws SVNException If an error occurs retrieving the file from Subversion.
* @throws IOException If an error occurs writing the file contents to disk.
*/
public void getFile(SVNURL sourceURL, File destination, long revision) throws SVNException, IOException {
readRepository.setLocation(sourceURL, false);
SVNNodeKind nodeKind = readRepository.checkPath("", revision);
SVNErrorMessage error = SvnUtils.checkNodeIsFile(nodeKind, sourceURL);
if (error != null) {
Message.error("Error retrieving" + sourceURL + " [revision=" + revision + "]");
throw new IOException(error.getMessage());
}
BufferedOutputStream output = null;
try {
output = new BufferedOutputStream(new FileOutputStream(destination));
readRepository.getFile("", revision, null, output);
} finally {
if (output != null) {
output.close();
}
}
}
开发者ID:massdosage,项目名称:ivysvn,代码行数:28,代码来源:SvnDao.java
示例14: printStats
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
private void printStats(String path) {
try {
SVNURL url = SVNURL.parseURIEncoded(urlBase + path);
synccount = syncsize = 0;
logClient.doList(url, SVNRevision.HEAD, SVNRevision.HEAD, false, true,
this);
LOG.info(String.format("%s/%d items (%d bytes)... ", path, synccount,
syncsize));
} catch (SVNException e) {
SVNErrorMessage em = e.getErrorMessage();
if (em.getErrorCode().getCode() == 160013)
LOG.warning(String.format("%s not found\n", path));
else
LOG.warning(String.format("doList: %s\n", e.getMessage()));
}
}
开发者ID:open744,项目名称:terramaster,代码行数:17,代码来源:Svn.java
示例15: testRenameLocked
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
public void testRenameLocked() throws Exception {
String originalName = "TheOriginalPage";
String newName = "TheRenamedPage";
final PageReference originalPage = new PageReferenceImpl(originalName);
final PageReference newPage = new PageReferenceImpl(newName);
_operations.moveFile(null, originalName, 1, newName);
expectLastCall().andThrow(new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED)));
replay();
SVNRenameAction action = new SVNPageStore.SVNRenameAction("", newPage, false, originalPage, 1);
try {
action.driveCommitEditor(null, _operations);
fail("Expected RenameException");
}
catch (RenameException ex) {
// OK
}
verify();
}
开发者ID:CoreFiling,项目名称:reviki,代码行数:19,代码来源:TestSVNPageStore.java
示例16: acknowledgeForSSL
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
public void acknowledgeForSSL(boolean accepted, String kind, String realm, SVNErrorMessage message, SVNAuthentication proxy) {
if (accepted && proxy instanceof SVNSSLAuthentication && (((SVNSSLAuthentication) proxy).getCertificateFile() != null)) {
final SVNSSLAuthentication svnsslAuthentication = (SVNSSLAuthentication)proxy;
final SVNURL url = svnsslAuthentication.getURL();
final IdeaSVNHostOptionsProvider provider = getHostOptionsProvider();
final SVNCompositeConfigFile serversFile = provider.getServersFile();
String groupName = getGroupName(serversFile.getProperties("groups"), url.getHost());
if (StringUtil.isEmptyOrSpaces(groupName)) {
serversFile.setPropertyValue("global", SvnServerFileKeys.SSL_CLIENT_CERT_FILE, svnsslAuthentication.getCertificateFile().getPath(), true);
//serversFile.setPropertyValue("global", SvnServerFileKeys.SSL_CLIENT_CERT_PASSWORD, null, true);
} else {
serversFile.setPropertyValue(groupName, SvnServerFileKeys.SSL_CLIENT_CERT_FILE, svnsslAuthentication.getCertificateFile().getPath(), true);
//serversFile.setPropertyValue(groupName, SvnServerFileKeys.SSL_CLIENT_CERT_PASSWORD, null, true);
}
serversFile.save();
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:SvnAuthenticationManager.java
示例17: copyUnversionedMembersOfDirectory
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
private void copyUnversionedMembersOfDirectory(final File src, final File dst) throws SVNException {
if (src.isDirectory()) {
final SVNException[] exc = new SVNException[1];
FileUtil.processFilesRecursively(src, new Processor<File>() {
@Override
public boolean process(File file) {
String relativePath = FileUtil.getRelativePath(src, file);
File newFile = new File(dst, relativePath);
if (!newFile.exists()) {
try {
copyFileOrDir(src, dst);
}
catch (IOException e) {
exc[0] = new SVNException(SVNErrorMessage.create(SVNErrorCode.IO_ERROR), e);
return false;
}
}
return true;
}
});
if (exc[0] != null) {
throw exc[0];
}
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:SvnFileSystemListener.java
示例18: handleWorkingCopyRoot
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
public void handleWorkingCopyRoot(File root, ProgressIndicator progress) {
if (progress != null) {
showProgressMessage(progress, root);
}
try {
SVNUpdateClient client = myVcs.createUpdateClient();
client.setEventHandler(myHandler);
long rev = doUpdate(root, client);
if (rev < 0 && !isMerge()) {
throw new SVNException(SVNErrorMessage.create(SVNErrorCode.UNKNOWN, SvnBundle.message("exception.text.root.was.not.properly.updated", root)));
}
}
catch (SVNException e) {
LOG.info(e);
myExceptions.add(new VcsException(e));
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:AbstractUpdateIntegrateCrawler.java
示例19: load
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
public void load(final RepositoryTreeNode node, final Expander expander) {
SwingUtilities.invokeLater(new Runnable(){
public void run() {
final String nodeUrl = node.getURL().toString();
final List<SVNDirEntry> cached = myCache.getChildren(nodeUrl);
if (cached != null) {
refreshNode(node, cached, expander);
}
final SVNErrorMessage error = myCache.getError(nodeUrl);
if (error != null) {
refreshNodeError(node, error);
}
// refresh anyway
myRepositoryLoader.load(node, expander);
}
});
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:CacheLoader.java
示例20: requestClientAuthentication
import org.tmatesoft.svn.core.SVNErrorMessage; //导入依赖的package包/类
public SVNAuthentication requestClientAuthentication(final String kind,
final SVNURL url,
final String realm,
SVNErrorMessage errorMessage,
final SVNAuthentication previousAuth,
final boolean authMayBeStored) {
if (ApplicationManager.getApplication().isUnitTestMode() && ISVNAuthenticationManager.USERNAME.equals(kind)) {
final String userName = previousAuth != null && previousAuth.getUserName() != null ? previousAuth.getUserName() : SystemProperties.getUserName();
return new SVNUserNameAuthentication(userName, false);
}
final SvnAuthenticationNotifier.AuthenticationRequest obj =
new SvnAuthenticationNotifier.AuthenticationRequest(myProject, kind, url, realm);
final SVNURL wcUrl = myAuthenticationNotifier.getWcUrl(obj);
if (wcUrl == null || ourForceInteractive.contains(Thread.currentThread())) {
// outside-project url
return mySvnInteractiveAuthenticationProvider.requestClientAuthentication(kind, url, realm, errorMessage, previousAuth, authMayBeStored);
} else {
if (myAuthenticationNotifier.ensureNotify(obj)) {
return (SVNAuthentication) myAuthenticationStorage.getData(kind, realm);
}
}
return null;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:SvnAuthenticationProvider.java
注:本文中的org.tmatesoft.svn.core.SVNErrorMessage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论