本文整理汇总了Java中org.eclipse.team.core.TeamException.UNABLE属性的典型用法代码示例。如果您正苦于以下问题:Java TeamException.UNABLE属性的具体用法?Java TeamException.UNABLE怎么用?Java TeamException.UNABLE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.team.core.TeamException
的用法示例。
在下文中一共展示了TeamException.UNABLE属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveKeyFilesHistory
public void saveKeyFilesHistory() throws TeamException {
IPath pluginStateLocation = SVNUIPlugin.getPlugin().getStateLocation();
File tempFile = pluginStateLocation.append(KEYFILE_HIST_FILE + ".tmp").toFile(); //$NON-NLS-1$
File histFile = pluginStateLocation.append(KEYFILE_HIST_FILE).toFile();
try {
XMLWriter writer = new XMLWriter(new BufferedOutputStream(new FileOutputStream(tempFile)));
try {
writer.startTag(ELEMENT_KEYFILE_HISTORY, null, false);
for (int i=0; i<previousKeyFiles.length && i<MAX_FILES; i++)
writer.printSimpleTag(ELEMENT_KEYFILE, previousKeyFiles[i]);
writer.endTag(ELEMENT_KEYFILE_HISTORY);
} finally {
writer.close();
}
if (histFile.exists()) {
histFile.delete();
}
boolean renamed = tempFile.renameTo(histFile);
if (!renamed) {
throw new TeamException(new Status(Status.ERROR, SVNUIPlugin.ID, TeamException.UNABLE, Policy.bind("RepositoryManager.rename", tempFile.getAbsolutePath()), null)); //$NON-NLS-1$
}
} catch (IOException e) {
throw new TeamException(new Status(Status.ERROR, SVNUIPlugin.ID, TeamException.UNABLE, Policy.bind("RepositoryManager.save",histFile.getAbsolutePath()), e)); //$NON-NLS-1$
}
}
示例2: saveCommentHistory
/**
* save the comments history
*/
public void saveCommentHistory() throws TeamException {
IPath pluginStateLocation = SVNUIPlugin.getPlugin().getStateLocation();
File tempFile = pluginStateLocation.append(COMMENT_HIST_FILE + ".tmp").toFile(); //$NON-NLS-1$
File histFile = pluginStateLocation.append(COMMENT_HIST_FILE).toFile();
try {
XMLWriter writer = new XMLWriter(new BufferedOutputStream(new FileOutputStream(tempFile)));
try {
writer.startTag(ELEMENT_COMMIT_HISTORY, null, false);
for (int i=0; i<previousComments.length && i<maxComments; i++)
writer.printSimpleTag(ELEMENT_COMMIT_COMMENT, previousComments[i]);
writer.endTag(ELEMENT_COMMIT_HISTORY);
} finally {
writer.close();
}
if (histFile.exists()) {
histFile.delete();
}
boolean renamed = tempFile.renameTo(histFile);
if (!renamed) {
throw new TeamException(new Status(IStatus.ERROR, SVNUIPlugin.ID, TeamException.UNABLE, Policy.bind("RepositoryManager.rename", tempFile.getAbsolutePath()), null)); //$NON-NLS-1$
}
} catch (IOException e) {
throw new TeamException(new Status(IStatus.ERROR, SVNUIPlugin.ID, TeamException.UNABLE, Policy.bind("RepositoryManager.save",histFile.getAbsolutePath()), e)); //$NON-NLS-1$
}
}
示例3: doRun
@Override
protected IStatus doRun(final IProgressMonitor progressMonitor) throws Exception {
try {
subscriber.refresh(roots, depth, progressMonitor);
} catch (final TeamException e) {
return new Status(
Status.ERROR,
TFSEclipseClientUIPlugin.PLUGIN_ID,
TeamException.UNABLE,
Messages.getString("RefreshSubscriberCommand.CouldNotRefreshSubscribers"), //$NON-NLS-1$
e);
}
return Status.OK_STATUS;
}
示例4: run
public void run(IProgressMonitor monitor) throws SVNException {
monitor = Policy.monitorFor(monitor);
monitor.beginTask(null, 100); //$NON-NLS-1$
if (!folder.getStatus().isManaged())
throw new SVNException(IStatus.ERROR, TeamException.UNABLE,
Policy.bind("SVNTeamProvider.ErrorSettingIgnorePattern", folder.getIResource().getFullPath().toString())); //$NON-NLS-1$
ISVNClientAdapter svnClient = folder.getRepository().getSVNClient();
try {
OperationManager.getInstance().beginOperation(svnClient);
try {
svnClient.addToIgnoredPatterns(folder.getFile(), pattern);
// broadcast changes to unmanaged children - they are the only candidates for being ignored
ISVNResource[] members = folder.members(null, ISVNFolder.UNMANAGED_MEMBERS);
IResource[] possiblesIgnores = new IResource[members.length];
for (int i = 0; i < members.length;i++) {
possiblesIgnores[i] = ((ISVNLocalResource)members[i]).getIResource();
}
folder.refreshStatus(false);
SVNProviderPlugin.broadcastSyncInfoChanges(possiblesIgnores, false);
broadcastNestedFolders(possiblesIgnores);
}
catch (SVNClientException e) {
throw SVNException.wrapException(e);
}
} finally {
OperationManager.getInstance().endOperation();
monitor.done();
folder.getRepository().returnSVNClient(svnClient);
}
}
示例5: deleteResource
private void deleteResource(ISVNLocalResource resource) throws SVNException {
ISVNClientAdapter svnClient = resource.getRepository().getSVNClient();
try {
svnClient.remove(new File[] { resource.getResource().getLocation().toFile() }, true);
} catch (SVNClientException e) {
throw new SVNException(IStatus.ERROR, TeamException.UNABLE, e.getMessage(), e);
}
finally {
resource.getRepository().returnSVNClient(svnClient);
}
}
示例6: saveCommentTemplates
public void saveCommentTemplates() throws TeamException {
IPath pluginStateLocation = SVNUIPlugin.getPlugin().getStateLocation();
File tempFile = pluginStateLocation.append(
COMMENT_TEMPLATES_FILE + ".tmp").toFile(); //$NON-NLS-1$
File histFile = pluginStateLocation.append(COMMENT_TEMPLATES_FILE)
.toFile();
try {
XMLWriter writer = new XMLWriter(new BufferedOutputStream(
new FileOutputStream(tempFile)));
try {
writeCommentTemplates(writer);
} finally {
writer.close();
}
if (histFile.exists()) {
histFile.delete();
}
boolean renamed = tempFile.renameTo(histFile);
if (!renamed) {
throw new TeamException(new Status(IStatus.ERROR,
SVNUIPlugin.ID, TeamException.UNABLE, NLS.bind(
Policy.bind("RepositoryManager.rename"),
new String[] { tempFile.getAbsolutePath() }),
null));
}
} catch (IOException e) {
throw new TeamException(new Status(IStatus.ERROR, SVNUIPlugin.ID,
TeamException.UNABLE, NLS.bind(
Policy.bind("RepositoryManager.save"),
new String[] { histFile.getAbsolutePath() }), e));
}
}