@Override public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { if (!dirEntry.getKind().equals(SVNNodeKind.DIR)) { return; } dirs.add(Util.removeTrailingSlash(dirEntry.getName())); } }
@Override public void handleDirEntry(final SVNDirEntry dirEntry) throws SVNException { if (!dirEntry.getKind().equals(SVNNodeKind.DIR)) { return; } String directoryName = Util.removeTrailingSlash(dirEntry.getName()); dirs.put(Long.valueOf(dirEntry.getRevision()), directoryName); } }
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()); } } }
/** * Constructs ... * * * @param resource * @param entry */ public DirectoryEntry(DAVResource resource, SVNDirEntry entry) { this.name = entry.getName(); this.url = createUrl(resource, entry); this.directory = entry.getKind() == SVNNodeKind.DIR; }
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 void handleDirEntry(SVNDirEntry entry) throws SVNException { children.add( new ChildEntry(entry.getRevision(), entry.getDate().getTime(), entry.getKind(), entry.getName())); }
@Override public long size() throws SizeException { SVNDirEntry entry; try { entry = root.getRepository().info(path, -1); if (entry == null || entry.getKind() != SVNNodeKind.FILE) { throw new SizeException(this, new IOException("file expected")); } return entry.getSize(); } catch (SVNException e) { throw new SizeException(this, 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); } } }
@Override public long length() throws LengthException { SVNDirEntry entry; try { entry = root.getRepository().info(path, -1); if (entry == null || entry.getKind() != SVNNodeKind.FILE) { throw new LengthException(this, new IOException("file expected")); } return entry.getSize(); } catch (SVNException e) { throw new LengthException(this, e); } }
private void checkEquals(@NotNull Collection<SVNDirEntry> listA, @NotNull Collection<SVNDirEntry> listB) { final Set<String> entries = new HashSet<>(); for (SVNDirEntry entry : listA) { entries.add(entry.getName() + '\t' + entry.getKind() + '\t' + entry.getSize()); } for (SVNDirEntry entry : listB) { Assert.assertTrue(entries.remove(entry.getName() + '\t' + entry.getKind() + '\t' + entry.getSize())); } Assert.assertTrue(entries.isEmpty()); }
static SVNInfo createInfo(String path, SVNURL reposRootURL, String uuid, SVNURL url, SVNRevision revision, SVNDirEntry dirEntry, SVNLock lock) { if (dirEntry == null) { return null; } return new SVNInfo(path, url, revision, dirEntry.getKind(), uuid, reposRootURL, dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor(), lock); }
static SVNInfo createInfo(String path, SVNURL reposRootURL, String uuid, SVNURL url, SVNRevision revision, SVNDirEntry dirEntry, SVNLock lock) { if (dirEntry == null) { return null; } return new SVNInfo(path, url, revision, dirEntry.getKind(), uuid, reposRootURL, dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor(), lock, SVNDepth.UNKNOWN, dirEntry.getSize()); }
public static SVNInfo createInfo(String path, SVNURL reposRootURL, String uuid, SVNURL url, SVNRevision revision, SVNDirEntry dirEntry, SVNLock lock) { if (dirEntry == null) { return null; } return new SVNInfo(path, url, revision, dirEntry.getKind(), uuid, reposRootURL, dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor(), lock, SVNDepth.UNKNOWN, dirEntry.getSize()); }
static SVNInfo createInfo(String path, SVNURL reposRootURL, String uuid, SVNURL url, SVNRevision revision, SVNDirEntry dirEntry, SVNLock lock) { if (dirEntry == null) { return null; } return new SVNInfo(path, url, revision, dirEntry.getKind(), uuid, reposRootURL, dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor(), lock, SVNDepth.UNKNOWN, dirEntry.getSize()); }
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { if (entries != null) { dirEntry = new SVNDirEntry(url.appendPath(dirEntry.getName(), false), repositoryRoot, dirEntry.getName(), dirEntry.getKind(), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor()); entries.add(dirEntry); } } };
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { if (entries != null) { dirEntry = new SVNDirEntry(url.appendPath(dirEntry.getName(), false), repositoryRoot, dirEntry.getName(), dirEntry.getKind(), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor()); entries.add(dirEntry); } } };
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { if (entries != null) { dirEntry = new SVNDirEntry(url.appendPath(dirEntry.getName(), false), repositoryRoot, dirEntry.getName(), dirEntry.getKind(), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor()); entries.add(dirEntry); } } };
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { dirEntry = new SVNDirEntry(url.appendPath(dirEntry.getName(), false), dirEntry.getName(), dirEntry.getKind(), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor()); entries.add(dirEntry); } };
protected static DirEntry getDirEntry(SVNDirEntry dirEntry, String reposRelativePath) { if (dirEntry == null) { return null; } return new DirEntry(dirEntry.getRelativePath(), SVNPathUtil.append(reposRelativePath, dirEntry.getRelativePath()), SVNClientImpl.getNodeKind(dirEntry.getKind()), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate().getTime(), dirEntry.getAuthor()); }
private DirEntry getDirEntry(SVNDirEntry dirEntry) { if (dirEntry == null) { return null; } String repositoryRootString = getUrlString(dirEntry.getRepositoryRoot()); String urlString = getUrlString(dirEntry.getURL()); String absolutePath = SVNPathUtil.getRelativePath(repositoryRootString, urlString); return new DirEntry(dirEntry.getRelativePath(), absolutePath, getNodeKind(dirEntry.getKind()), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), getLongDate(dirEntry.getDate()), dirEntry.getAuthor()); }