Search in sources :

Example 1 with DirectoryEntryConsumer

use of org.jetbrains.idea.svn.browse.DirectoryEntryConsumer in project intellij-community by JetBrains.

the class SvnUtil method remoteFolderIsEmpty.

public static boolean remoteFolderIsEmpty(@NotNull SvnVcs vcs, @NotNull String url) throws VcsException {
    SvnTarget target = SvnTarget.fromURL(createUrl(url));
    Ref<Boolean> result = new Ref<>(true);
    DirectoryEntryConsumer handler = entry -> {
        if (entry != null) {
            result.set(false);
        }
    };
    vcs.getFactory(target).createBrowseClient().list(target, null, Depth.IMMEDIATES, handler);
    return result.get();
}
Also used : FileUtilRt(com.intellij.openapi.util.io.FileUtilRt) SvnBranchConfigurationNew(org.jetbrains.idea.svn.branchConfig.SvnBranchConfigurationNew) SqlJetException(org.tmatesoft.sqljet.core.SqlJetException) Connection(java.sql.Connection) Change(com.intellij.openapi.vcs.changes.Change) VirtualFile(com.intellij.openapi.vfs.VirtualFile) SqlJetDb(org.tmatesoft.sqljet.core.table.SqlJetDb) VirtualFileManager(com.intellij.openapi.vfs.VirtualFileManager) Matcher(java.util.regex.Matcher) SqlJetSchema(org.tmatesoft.sqljet.core.internal.schema.SqlJetSchema) ResultSet(java.sql.ResultSet) SVNErrorMessage(org.tmatesoft.svn.core.SVNErrorMessage) FileUtil(com.intellij.openapi.util.io.FileUtil) URI(java.net.URI) Logger(com.intellij.openapi.diagnostic.Logger) VcsException(com.intellij.openapi.vcs.VcsException) ProgressEvent(org.jetbrains.idea.svn.api.ProgressEvent) SqlJetEngine(org.tmatesoft.sqljet.core.table.engine.SqlJetEngine) MultiMap(com.intellij.util.containers.MultiMap) FilePath(com.intellij.openapi.vcs.FilePath) ProgressManager(com.intellij.openapi.progress.ProgressManager) SvnBranchConfigurationManager(org.jetbrains.idea.svn.branchConfig.SvnBranchConfigurationManager) Collections.emptyList(java.util.Collections.emptyList) SVNFileUtil(org.tmatesoft.svn.core.internal.wc.SVNFileUtil) Collection(java.util.Collection) LockDialog(org.jetbrains.idea.svn.dialogs.LockDialog) Set(java.util.Set) SVNErrorCode(org.tmatesoft.svn.core.SVNErrorCode) NonWritableChannelException(java.nio.channels.NonWritableChannelException) Status(org.jetbrains.idea.svn.status.Status) LocalFileSystem(com.intellij.openapi.vfs.LocalFileSystem) NotificationType(com.intellij.notification.NotificationType) Nullable(org.jetbrains.annotations.Nullable) ProgressIndicator(com.intellij.openapi.progress.ProgressIndicator) Contract(org.jetbrains.annotations.Contract) List(java.util.List) SqlJetBtreeSchemaTable(org.tmatesoft.sqljet.core.internal.table.SqlJetBtreeSchemaTable) ContainerUtil.map2Array(com.intellij.util.containers.ContainerUtil.map2Array) ApplicationManager(com.intellij.openapi.application.ApplicationManager) Registry(com.intellij.openapi.util.registry.Registry) Pattern(java.util.regex.Pattern) NotNull(org.jetbrains.annotations.NotNull) Ref(com.intellij.openapi.util.Ref) SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException) SVNWCUtil(org.tmatesoft.svn.core.wc.SVNWCUtil) ISqlJetBtreeSchemaTable(org.tmatesoft.sqljet.core.internal.table.ISqlJetBtreeSchemaTable) ArrayUtil(com.intellij.util.ArrayUtil) ProgressTracker(org.jetbrains.idea.svn.api.ProgressTracker) NonNls(org.jetbrains.annotations.NonNls) Computable(com.intellij.openapi.util.Computable) ContainerUtil(com.intellij.util.containers.ContainerUtil) ArrayList(java.util.ArrayList) VcsBalloonProblemNotifier(com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier) ProcessCanceledException(com.intellij.openapi.progress.ProcessCanceledException) StatusBarUtil(com.intellij.openapi.wm.impl.status.StatusBarUtil) ISqlJetOptions(org.tmatesoft.sqljet.core.table.ISqlJetOptions) SvnOperationFactory(org.tmatesoft.svn.core.wc2.SvnOperationFactory) SQLException(java.sql.SQLException) ChangesUtil(com.intellij.openapi.vcs.changes.ChangesUtil) Project(com.intellij.openapi.project.Project) EventAction(org.jetbrains.idea.svn.api.EventAction) VfsUtilCore.virtualToIoFile(com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile) VfsUtilCore(com.intellij.openapi.vfs.VfsUtilCore) SVNException(org.tmatesoft.svn.core.SVNException) StringUtil(com.intellij.openapi.util.text.StringUtil) Convertor(com.intellij.util.containers.Convertor) SvnWcGeneration(org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration) Info(org.jetbrains.idea.svn.info.Info) File(java.io.File) Depth(org.jetbrains.idea.svn.api.Depth) AbstractVcsHelper(com.intellij.openapi.vcs.AbstractVcsHelper) SVNRevision(org.tmatesoft.svn.core.wc.SVNRevision) SVNURL(org.tmatesoft.svn.core.SVNURL) SVNPathUtil(org.tmatesoft.svn.core.internal.util.SVNPathUtil) ContainerUtil.newHashSet(com.intellij.util.containers.ContainerUtil.newHashSet) Pair(com.intellij.openapi.util.Pair) SvnTarget(org.tmatesoft.svn.core.wc2.SvnTarget) DirectoryEntryConsumer(org.jetbrains.idea.svn.browse.DirectoryEntryConsumer) DriverManager(java.sql.DriverManager) Ref(com.intellij.openapi.util.Ref) DirectoryEntryConsumer(org.jetbrains.idea.svn.browse.DirectoryEntryConsumer) SvnTarget(org.tmatesoft.svn.core.wc2.SvnTarget)

Example 2 with DirectoryEntryConsumer

use of org.jetbrains.idea.svn.browse.DirectoryEntryConsumer in project intellij-community by JetBrains.

the class BranchesLoader method loadBranches.

@NotNull
public List<SvnBranchItem> loadBranches() throws SVNException, VcsException {
    SvnVcs vcs = SvnVcs.getInstance(myProject);
    SVNURL branchesUrl = SVNURL.parseURIEncoded(myUrl);
    List<SvnBranchItem> result = new LinkedList<>();
    SvnTarget target = SvnTarget.fromURL(branchesUrl);
    DirectoryEntryConsumer handler = createConsumer(result);
    vcs.getFactory(target).create(BrowseClient.class, !myPassive).list(target, SVNRevision.HEAD, Depth.IMMEDIATES, handler);
    Collections.sort(result);
    return result;
}
Also used : DirectoryEntryConsumer(org.jetbrains.idea.svn.browse.DirectoryEntryConsumer) BrowseClient(org.jetbrains.idea.svn.browse.BrowseClient) SVNURL(org.tmatesoft.svn.core.SVNURL) SvnTarget(org.tmatesoft.svn.core.wc2.SvnTarget) LinkedList(java.util.LinkedList) SvnVcs(org.jetbrains.idea.svn.SvnVcs) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

NotNull (org.jetbrains.annotations.NotNull)2 DirectoryEntryConsumer (org.jetbrains.idea.svn.browse.DirectoryEntryConsumer)2 SVNURL (org.tmatesoft.svn.core.SVNURL)2 SvnTarget (org.tmatesoft.svn.core.wc2.SvnTarget)2 NotificationType (com.intellij.notification.NotificationType)1 ApplicationManager (com.intellij.openapi.application.ApplicationManager)1 Logger (com.intellij.openapi.diagnostic.Logger)1 ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)1 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 ProgressManager (com.intellij.openapi.progress.ProgressManager)1 Project (com.intellij.openapi.project.Project)1 Computable (com.intellij.openapi.util.Computable)1 Pair (com.intellij.openapi.util.Pair)1 Ref (com.intellij.openapi.util.Ref)1 FileUtil (com.intellij.openapi.util.io.FileUtil)1 FileUtilRt (com.intellij.openapi.util.io.FileUtilRt)1 Registry (com.intellij.openapi.util.registry.Registry)1 StringUtil (com.intellij.openapi.util.text.StringUtil)1 AbstractVcsHelper (com.intellij.openapi.vcs.AbstractVcsHelper)1 FilePath (com.intellij.openapi.vcs.FilePath)1