/** * Returns the entry's path. * * @return a path relative to a repository location or * <span class="javakeyword">null</span> if no path is * specified */ public String getRelativePath() { return myPath == null ? getName() : myPath; }
@Override public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { if(filterPattern == null || filterPattern.matcher(dirEntry.getName()).matches()) { dirs.add(dirEntry); } }
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 static void main(String[] args) throws SVNException { final SvnList list = new SvnOperationFactory().createList(); list.setSingleTarget(SvnTarget.fromURL(SVNURL.parseURIEncoded("http://svn.apache.org/repos/asf/spamassassin/tags"))); list.setReceiver(new ISvnObjectReceiver<SVNDirEntry>() { public void receive(SvnTarget target, SVNDirEntry object) throws SVNException { System.out.println(object.getName()); } }); list.run(); }
@Override public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { if (!dirEntry.getKind().equals(SVNNodeKind.DIR)) { return; } dirs.add(Util.removeTrailingSlash(dirEntry.getName())); } }
public void handleDirEntry( SVNDirEntry svnDirEntry ) throws SVNException { infos.put( svnDirEntry.getName(), svnDirEntry.getURL().toString() ); } }
@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); } }
/** * 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())); }
private SVNDirEntry getEntry(String lastChanged, String directoryName) throws ParseException { SVNDirEntry entry = Mockito.mock(SVNDirEntry.class); Mockito.when(entry.getDate()).thenReturn(df.parse(lastChanged)); Mockito.when(entry.getName()).thenReturn(directoryName); return entry; } }
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 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); } };
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()); }
public Object next() { SVNDirEntry entry = (SVNDirEntry) entriesIterator.next(); String childURI = DAVPathUtil.append(getResourceURI().getURI(), entry.getName()); try { DAVResourceURI newResourceURI = new DAVResourceURI(getResourceURI().getContext(), childURI, null, false); return new DAVResource(myRepositoryManager, getRepository(), newResourceURI, getRevision(), isSVNClient(), getDeltaBase(), getVersion(), getClientOptions(), null, null, getUserName(), getActivitiesDB(), getLockTokens(), getClientCapabilities()); } catch (SVNException e) { return null; } } };