当前位置: 首页>>代码示例>>Java>>正文


Java SVNNodeKind.DIR属性代码示例

本文整理汇总了Java中org.tigris.subversion.svnclientadapter.SVNNodeKind.DIR属性的典型用法代码示例。如果您正苦于以下问题:Java SVNNodeKind.DIR属性的具体用法?Java SVNNodeKind.DIR怎么用?Java SVNNodeKind.DIR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.tigris.subversion.svnclientadapter.SVNNodeKind的用法示例。


在下文中一共展示了SVNNodeKind.DIR属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isEnabled

@Override
public boolean isEnabled() {
    Browser browser = getBrowser();
    if(browser == null) {
        return false;
    }        
    if(browser.getExplorerManager().getRootContext() == Node.EMPTY) {
        return false;
    }
    Node[] nodes = getBrowser().getSelectedNodes();
    if(nodes.length != 1) {
        return false;
    }
    return nodes[0] instanceof RepositoryPathNode && 
           ((RepositoryPathNode) nodes[0]).getEntry().getSvnNodeKind() == SVNNodeKind.DIR;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:CreateFolderAction.java

示例2: validateInput

private boolean validateInput(File root, RepositoryFile toRepositoryFile) {
    boolean ret = false;
    SvnClient client;
    try {                   
        client = Subversion.getInstance().getClient(toRepositoryFile.getRepositoryUrl());
        ISVNInfo info = client.getInfo(toRepositoryFile.getFileUrl());
        if(info.getNodeKind() == SVNNodeKind.DIR && root.isFile()) {
            SvnClientExceptionHandler.annotate(NbBundle.getMessage(SwitchToAction.class, "LBL_SwitchFileToFolderError"));
            ret = false;
        } else if(info.getNodeKind() == SVNNodeKind.FILE && root.isDirectory()) {
            SvnClientExceptionHandler.annotate(NbBundle.getMessage(SwitchToAction.class, "LBL_SwitchFolderToFileError"));
            ret = false;
        } else {
            ret = true;
        }
    } catch (SVNClientException ex) {
        SvnClientExceptionHandler.notifyException(ex, true, true);
        return ret;
    }                            
    return ret;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:SwitchToAction.java

示例3: RepositoryPathNode

private RepositoryPathNode(BrowserClient client, RepositoryPathEntry entry, boolean repositoryFolder) {
    super(entry.getSvnNodeKind() == SVNNodeKind.DIR ? new RepositoryPathChildren(client) : Children.LEAF);
    this.entry = entry;
    this.client = client;
    this.repositoryFolder = repositoryFolder;
    initProperties();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:RepositoryPathNode.java

示例4: getIcon

@Override
public Image getIcon(int type) {
    if (entry.getSvnNodeKind() == SVNNodeKind.DIR) {
        return getTreeFolderIcon(false);
    } else {
        return super.getIcon(type);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:RepositoryPathNode.java

示例5: getOpenedIcon

@Override
public Image getOpenedIcon(int type) {
    if (entry.getSvnNodeKind() == SVNNodeKind.DIR) {
        return getTreeFolderIcon(true);
    } else {
        return super.getOpenedIcon(type);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:RepositoryPathNode.java

示例6: convertNodeKind

public static SVNNodeKind convertNodeKind(org.apache.subversion.javahl.types.NodeKind javahlNodeKind) {
	if (javahlNodeKind == null) {
		return null;
	}
    switch(javahlNodeKind) {
        case dir  : return SVNNodeKind.DIR; 
        case file : return SVNNodeKind.FILE; 
        case none : return SVNNodeKind.NONE; 
        case unknown : return SVNNodeKind.UNKNOWN;
        default: {
        	log.severe("unknown node kind :"+javahlNodeKind);
        	return SVNNodeKind.UNKNOWN; // should never go here
        }
    }
}
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:15,代码来源:JhlConverter.java

示例7: FileInformation

FileInformation(int status, ISVNStatus entry) {
    this(status, 0, entry, entry.getNodeKind() == SVNNodeKind.DIR);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:3,代码来源:FileInformation.java

示例8: listRepositoryPath

@Override
public List<RepositoryPathNode.RepositoryPathEntry> listRepositoryPath(final RepositoryPathNode.RepositoryPathEntry entry, SvnProgressSupport support) throws SVNClientException {

    List<RepositoryPathNode.RepositoryPathEntry> ret = new ArrayList<RepositoryPathNode.RepositoryPathEntry>();

    synchronized (supportList) {
        if(cancelled) {
            support.cancel();
            return ret;
        }
        supportList.add(support);
    }

    try {

        if(entry.getSvnNodeKind().equals(SVNNodeKind.FILE)) {
            return ret; // nothing to do...
        }

        Subversion subversion = Subversion.getInstance();
        SVNUrl svnUrl = this.repositoryRoot.getRepositoryUrl();
        SvnClient client = (username != null)
                           ? subversion.getClient(svnUrl, username, password, support)
                           : subversion.getClient(svnUrl, support);
        if(support.isCanceled()) {
            return null;
        }

        ISVNDirEntry[] dirEntries = client.getList(
                                        entry.getRepositoryFile().getFileUrl(),
                                        entry.getRepositoryFile().getRevision(),
                                        false
                                    );

        if(dirEntries == null || dirEntries.length == 0) {
            return ret; // nothing to do...
        }
        for (ISVNDirEntry dirEntry : dirEntries) {
            if(support.isCanceled()) {
                return null;
            }
            if( dirEntry.getNodeKind()==SVNNodeKind.DIR ||                  // directory or
                    (dirEntry.getNodeKind()==SVNNodeKind.FILE &&                // (file and show_files_allowed)
                    ((mode & BROWSER_SHOW_FILES) == BROWSER_SHOW_FILES)) )
            {
                RepositoryFile repositoryFile = new RepositoryFile(
                        entry.getRepositoryFile().getRepositoryUrl(),
                        entry.getRepositoryFile().getFileUrl().appendPath(dirEntry.getPath()),
                        dirEntry.getLastChangedRevision());
                RepositoryPathNode.RepositoryPathEntry e =
                        new RepositoryPathNode.RepositoryPathEntry(
                        repositoryFile,
                        dirEntry.getNodeKind(),
                        dirEntry.getLastChangedRevision(),
                        dirEntry.getLastChangedDate(),
                        dirEntry.getLastCommitAuthor());
                ret.add(e);
            }
        }

    } catch (SVNClientException ex) {
        if(SvnClientExceptionHandler.isWrongURLInRevision(ex.getMessage())) {
            // is not a folder in the repository
            return null;
        } else {
            support.annotate(ex);
            throw ex;
        }
    }
    finally {
        synchronized (supportList) {
            supportList.remove(support);
        }
    }

    return ret;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:77,代码来源:Browser.java

示例9: createDelayedExpandNode

private static RepositoryPathNode createDelayedExpandNode(BrowserClient client, RepositoryFile file) {
    return new DelayedExpandNode(client, new RepositoryPathEntry(file, SVNNodeKind.DIR, new SVNRevision(0), null, ""), true);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:3,代码来源:RepositoryPathNode.java

示例10: execute

/**
 * {@inheritDoc}
 */
public void execute() {

    try {
        ISVNDirEntry[] content = getClient().getList( url, revision, recurse );
        int ignored = 0;
        for( int i = 0; i < content.length; i++ ) {
            if( content[i].getNodeKind() == SVNNodeKind.DIR ) {
                if( !listDirs ) {
                    content[i] = null;
                    ignored++;
                }
            } else if( content[i].getNodeKind() == SVNNodeKind.FILE ) {
                if( !listFiles ) {
                    content[i] = null;
                    ignored++;
                }
            } else {
                content[i] = null;
                ignored++;
            }
        }
        StringBuffer value = new StringBuffer();
        if( ignored < content.length ) {
            int pos = 0;
            for( int i = 0; i < content.length; i++ ) {
                if( content[i] != null ) {
                    if( pos > 0 ) {
                        value.append( delimiter );
                    }
                    String path = content[i].getPath();
                    if( !onlynames ) {
                        path = url.appendPath( path ).toString();
                    }
                    value.append( path );
                    pos++;
                }
            }
        }
        getProject().setProperty( property, value.toString() );
    } catch( SVNClientException ex ) {
        throw ex( ex, MSG_CANT_LIST );
    }
}
 
开发者ID:subclipse,项目名称:svnant,代码行数:46,代码来源:List.java

示例11: scandir

/**
 * Scans the given directory for files and directories. Found files and
 * directories are placed in their respective collections, based on the
 * matching of includes, excludes, and the selectors.  When a directory
 * is found, it is scanned recursively.
 *
 * @param dir   The directory to scan. Must not be <code>null</code>.
 * @param vpath The path relative to the base directory (needed to
 *              prevent problems with an absolute path when using
 *              dir). Must not be <code>null</code>.
 * @param fast  Whether or not this call is part of a fast scan.
 *
 * @see #filesIncluded
 * @see #filesNotIncluded
 * @see #filesExcluded
 * @see #dirsIncluded
 * @see #dirsNotIncluded
 * @see #dirsExcluded
 * @see #slowScan
 */
protected void scandir( File dir, String vpath, boolean fast ) {
    // avoid double scanning of directories, can only happen in fast mode
    if( fast && hasBeenScanned( vpath ) ) {
        return;
    }
    ISVNStatus[] newfiles = list( dir );

    if( newfiles == null ) {
        /*
         * two reasons are mentioned in the API docs for File.list
         * (1) dir is not a directory. This is impossible as
         *     we wouldn't get here in this case.
         * (2) an IO error occurred (why doesn't it throw an exception
         *     then???)
         */
        throw new BuildException( "IO error scanning directory " + dir.getAbsolutePath() );
    }

    for( int i = 0; i < newfiles.length; i++ ) {
        String name = vpath + newfiles[i].getFile().getName();
        File file = new File( dir, newfiles[i].getFile().getName() );
        if( SVNNodeKind.DIR == newfiles[i].getNodeKind()
                        || (SVNNodeKind.UNKNOWN == newfiles[i].getNodeKind() && newfiles[i].getFile().isDirectory()) ) {
            if( isIncluded( name ) ) {
                accountForIncludedDir( name, file, fast );
            } else {
                everythingIncluded = false;
                dirsNotIncluded.addElement( name );
                if( fast && couldHoldIncluded( name ) ) {
                    scandir( file, name + File.separator, fast );
                }
            }
            if( !fast ) {
                scandir( file, name + File.separator, fast );
            }
        } else if( SVNNodeKind.FILE == newfiles[i].getNodeKind()
                        || (SVNNodeKind.UNKNOWN == newfiles[i].getNodeKind() && newfiles[i].getFile().isFile()) ) {
            if( isIncluded( name ) ) {
                accountForIncludedFile( name, file );
            } else {
                everythingIncluded = false;
                filesNotIncluded.addElement( name );
            }
        }
    }
}
 
开发者ID:subclipse,项目名称:svnant,代码行数:66,代码来源:SvnDirScanner.java


注:本文中的org.tigris.subversion.svnclientadapter.SVNNodeKind.DIR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。