/** * Recursively get all entries within a subtree. * * @param path * the subtree path to get all entries within. * @return all entries recursively contained within the subtree. */ public DirCacheEntry[] getEntriesWithin(String path) { if (path.length() == 0) { DirCacheEntry[] r = new DirCacheEntry[entryCnt]; System.arraycopy(sortedEntries, 0, r, 0, entryCnt); return r; } if (!path.endsWith("/")) //$NON-NLS-1$ path += "/"; //$NON-NLS-1$ final byte[] p = Constants.encode(path); final int pLen = p.length; int eIdx = findEntry(p, pLen); if (eIdx < 0) eIdx = -(eIdx + 1); final int lastIdx = nextEntry(p, pLen, eIdx); final DirCacheEntry[] r = new DirCacheEntry[lastIdx - eIdx]; System.arraycopy(sortedEntries, eIdx, r, 0, r.length); return r; }
/** * Recursively get all entries within a subtree. * * @param path * the subtree path to get all entries within. * @return all entries recursively contained within the subtree. */ public DirCacheEntry[] getEntriesWithin(String path) { if (path.length() == 0) { DirCacheEntry[] r = new DirCacheEntry[entryCnt]; System.arraycopy(sortedEntries, 0, r, 0, entryCnt); return r; } if (!path.endsWith("/")) //$NON-NLS-1$ path += "/"; //$NON-NLS-1$ final byte[] p = Constants.encode(path); final int pLen = p.length; int eIdx = findEntry(p, pLen); if (eIdx < 0) eIdx = -(eIdx + 1); final int lastIdx = nextEntry(p, pLen, eIdx); final DirCacheEntry[] r = new DirCacheEntry[lastIdx - eIdx]; System.arraycopy(sortedEntries, eIdx, r, 0, r.length); return r; }
/** * Recursively get all entries within a subtree. * * @param path * the subtree path to get all entries within. * @return all entries recursively contained within the subtree. */ public DirCacheEntry[] getEntriesWithin(String path) { if (path.length() == 0) { DirCacheEntry[] r = new DirCacheEntry[entryCnt]; System.arraycopy(sortedEntries, 0, r, 0, entryCnt); return r; } if (!path.endsWith("/")) //$NON-NLS-1$ path += "/"; //$NON-NLS-1$ final byte[] p = Constants.encode(path); final int pLen = p.length; int eIdx = findEntry(p, pLen); if (eIdx < 0) eIdx = -(eIdx + 1); final int lastIdx = nextEntry(p, pLen, eIdx); final DirCacheEntry[] r = new DirCacheEntry[lastIdx - eIdx]; System.arraycopy(sortedEntries, eIdx, r, 0, r.length); return r; }