public void loadFromRepository() throws SVNException { myBaseProperties = new HashMap(); myRepos.getDir(myRepositoryPath, myRevision1, myBaseProperties, (ISVNDirEntryHandler) null); }
public void loadProperties(SVNRepository repos, String path, long revision) throws SVNException { pristineProperties = new SVNProperties(); repos.getDir(path, revision, pristineProperties, 0, (ISVNDirEntryHandler) null); } }
public void loadFromRepository(long baseRevision) throws SVNException { myBaseProperties = new SVNProperties(); myRepos.getDir(myRepositoryPath, baseRevision, myBaseProperties, (ISVNDirEntryHandler) null); }
public void loadFromRepository(long baseRevision) throws SVNException { myBaseProperties = new SVNProperties(); myRepos.getDir(myRepositoryPath, baseRevision, myBaseProperties, (ISVNDirEntryHandler) null); }
public void loadFromRepository(long baseRevision) throws SVNException { myBaseProperties = new SVNProperties(); myRepos.getDir(myRepositoryPath, baseRevision, myBaseProperties, (ISVNDirEntryHandler) null); }
private List<String> dirCheckout(SvnOperationFactory svnOperationFactory) throws SVNException { SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(URL),null); repository.setAuthenticationManager(svnOperationFactory.getAuthenticationManager()); Collection<SVNDirEntry> entries = (Collection<SVNDirEntry>) repository.getDir("", (Your Object).getRevision(), null,(Collection<?>) null); Iterator<SVNDirEntry> iterator =entries.iterator(); List<String> list = new ArrayList<String>(); while(iterator.hasNext()){ SVNDirEntry entry =(SVNDirEntry) iterator.next(); if(entry.getKind()==SVNNodeKind.DIR) list.add(entry.getName()); } return list; }
public static void listEntries(SVNRepository repository, String path) throws SVNException { Collection<?> entries = repository.getDir(path, -1, null, (Collection<?>) null); Iterator<?> iterator = entries.iterator(); while (iterator.hasNext()) { SVNDirEntry entry = (SVNDirEntry) iterator.next(); System.out.println("/" + (path.equals("") ? "" : path + "/") + entry.getName()); if (entry.getKind() == SVNNodeKind.DIR) { listEntries(repository, (path.equals("")) ? entry.getName() : path + "/" + entry.getName()); } } }
public long getLatestRevision() throws SVNException { List<Long> revs; SVNDirEntry dir; if (root.getRepository().checkPath(path, -1) == SVNNodeKind.DIR) { dir = root.getRepository().getDir(path, -1, false, new ArrayList<>()); return dir.getRevision(); } else { revs = getRevisions(); return revs.get(revs.size() - 1); } }
public long getLatestRevision() throws SVNException { List<Long> revs; SVNDirEntry dir; if (root.getRepository().checkPath(path, -1) == SVNNodeKind.DIR) { dir = root.getRepository().getDir(path, -1, false, new ArrayList<Object>()); return dir.getRevision(); } else { revs = getRevisions(); return revs.get(revs.size() - 1); } }
@Override public Iterable<SCMFile> children() throws IOException, InterruptedException { try { List<SCMFile> result = new ArrayList<>(); Collection<SVNDirEntry> dirEntries = new ArrayList<>(); fs.getRepository().getDir(getPath(), fs.getLatestRevision(), null, 0, dirEntries); for (SVNDirEntry e : dirEntries) { result.add(newChild(e.getName(), false)); } return result; } catch (SVNException e) { throw new IOException("failed to list children for " + getPath(), e); } }
private static void list(SVNRepository repository, String path, long rev, boolean recursive, ISVNDirEntryHandler handler) throws SVNException { Collection entries = new TreeSet(); entries = repository.getDir(path, rev, null, entries); for (Iterator iterator = entries.iterator(); iterator.hasNext();) { SVNDirEntry entry = (SVNDirEntry) iterator.next(); String childPath = SVNPathUtil.append(path, entry.getName()); entry.setRelativePath(childPath); handler.handleDirEntry(entry); if (entry.getKind() == SVNNodeKind.DIR && entry.getDate() != null && recursive) { list(repository, childPath, rev, recursive, handler); } } }
public Collection getEntries() throws SVNException { if (isCollection() && myEntries == null) { myEntries = new LinkedList(); getRepository().getDir(getResourceURI().getPath(), getRevision(), null, SVNDirEntry.DIRENT_KIND, myEntries); } return myEntries; }
public long getDirectory(long revision, String path, int direntFields, final Map<String, DirEntry> dirents, Map<String, byte[]> properties) throws ClientException { final SVNProperties svnProperties = new SVNProperties(); long fileRevision; try { final String reposRelativePath = getRepositoryRelativePath(path); fileRevision = svnRepository.getDir(path, revision, svnProperties, direntFields, new ISVNDirEntryHandler() { @Override public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { dirents.put(dirEntry.getRelativePath(), SVNClientImpl.getDirEntry(dirEntry, reposRelativePath)); } }); } catch (SVNException e) { throw ClientException.fromException(e); } if (properties != null) { properties.putAll(SVNClientImpl.getProperties(svnProperties)); } return fileRevision; }
private void collectInfo(SVNRepository repos, SVNDirEntry entry, SVNRevision rev, String path, SVNURL root, String uuid, SVNURL url, Map locks, boolean recursive, ISVNInfoHandler handler) throws SVNException { checkCancelled(); String displayPath = repos.getFullPath(path); displayPath = displayPath.substring(repos.getLocation().getPath().length()); if ("".equals(displayPath) || "/".equals(displayPath)) { displayPath = path; } handler.handleInfo(SVNInfo.createInfo(displayPath, root, uuid, url, rev, entry, (SVNLock) locks.get(path))); if (entry.getKind() == SVNNodeKind.DIR && recursive) { Collection children = repos.getDir(path, rev.getNumber(), null, new ArrayList()); for (Iterator ents = children.iterator(); ents.hasNext();) { SVNDirEntry child = (SVNDirEntry) ents.next(); SVNURL childURL = url.appendPath(child.getName(), false); collectInfo(repos, child, rev, SVNPathUtil.append(path, child.getName()), root, uuid, childURL, locks, recursive, handler); } } }
private static void list(SVNRepository repository, String path, long rev, SVNDepth depth, int entryFields, ISVNDirEntryHandler handler) throws SVNException { if (depth == SVNDepth.EMPTY) { return; } Collection entries = new TreeSet(); entries = repository.getDir(path, rev, null, entryFields, entries); for (Iterator iterator = entries.iterator(); iterator.hasNext();) { SVNDirEntry entry = (SVNDirEntry) iterator.next(); String childPath = SVNPathUtil.append(path, entry.getName()); entry.setRelativePath(childPath); if (entry.getKind() == SVNNodeKind.FILE || depth == SVNDepth.IMMEDIATES || depth == SVNDepth.INFINITY) { handler.handleDirEntry(entry); } if (entry.getKind() == SVNNodeKind.DIR && entry.getDate() != null && depth == SVNDepth.INFINITY) { list(repository, childPath, rev, depth, entryFields, handler); } } }
public static void checkDirProp(@NotNull SVNRepository repo, @NotNull String filePath, @Nullable Map<String, String> expected) throws SVNException { SVNProperties props = new SVNProperties(); repo.getDir(filePath, repo.getLatestRevision(), props, new ArrayList<>()); checkProp(props, expected); }
/** * @deprecated */ public long getContentLength() throws SVNException { SVNDirEntry entry = getRepository().getDir(getResourceURI().getPath(), getRevision(), false, null); return entry.getSize(); }
private void pushDirInfo(SVNRepository repos, SVNRevision rev, String dir, SVNURL root, String uuid, SVNURL url, Map<String, SVNLock> locks, SVNDepth depth) throws SVNException { Collection<SVNDirEntry> children = repos.getDir(dir, rev.getNumber(), null, SVNDirEntry.DIRENT_SIZE | SVNDirEntry.DIRENT_KIND | SVNDirEntry.DIRENT_CREATED_REVISION | SVNDirEntry.DIRENT_TIME | SVNDirEntry.DIRENT_LAST_AUTHOR, new ArrayList<SVNDirEntry>()); for (SVNDirEntry child : children) { SVNURL childURL = url.appendPath(child.getName(), false); String path = SVNPathUtil.append(dir, child.getName()); String fsPath = "/" + SVNPathUtil.getRelativePath(root.toDecodedString(), childURL.toDecodedString()); SVNLock lock = locks.get(fsPath); if (depth.compareTo(SVNDepth.IMMEDIATES) >= 0 || (depth == SVNDepth.FILES && child.getKind() == SVNNodeKind.FILE)) { SvnInfo info = creatSvnInfoForEntry(root, uuid, child, childURL, rev.getNumber(), lock); getOperation().receive(SvnTarget.fromURL(childURL), info); } if (depth == SVNDepth.INFINITY && child.getKind() == SVNNodeKind.DIR) { pushDirInfo(repos, rev, path, root, uuid, childURL, locks, depth); } } }
/** * @deprecated */ public SVNProperties getSVNProperties() throws SVNException { if (mySVNProperties == null) { mySVNProperties = new SVNProperties(); if (getResourceURI().getType() == DAVResourceType.REGULAR) { if (isCollection()) { getRepository().getDir(getResourceURI().getPath(), getRevision(), mySVNProperties, (ISVNDirEntryHandler) null); } else { getRepository().getFile(getResourceURI().getPath(), getRevision(), mySVNProperties, null); } } } return mySVNProperties; }
public void process( @NotNull CmdLine cmdLine ) throws IOException, SVNException { cmdLine.out( SubversionMessageHandler.get( "module.list.repository.entries" ) ); String repositoryUrl = cmdLine.read( SubversionMessageHandler.get( "wich.repository.shall.be.used" ), subversionSupport.getRepositoryUrls(), null ); subversionSupport.addRepositoryUrl( repositoryUrl ); cmdLine.warning( SubversionMessageHandler.get( "listing.repository.entries" ) ); cmdLine.out( SubversionMessageHandler.get( "repository" ) ); cmdLine.success( '\t' + repositoryUrl ); SVNURL svnurl = SVNURL.parseURIDecoded( repositoryUrl ); SVNRepository repository = SVNRepositoryFactory.create( svnurl ); repository.setAuthenticationManager( subversionSupport.getAuthenticationManager() ); Collection<SVNDirEntry> dirEntry = repository.getDir( ".", repository.getLatestRevision(), null, ( Collection<?> ) null ); for ( SVNDirEntry entry : dirEntry ) { cmdLine.out( entry.getRelativePath() + "\t\t(" + entry.getKind() + ")" ); } } }