/** * Shortcut to {@code #start(null, false)} */ public final long start() { if (canExitEarly()) { return -1; } return start(null, false); }
@Override protected String computeNext() { String diff = computeNextDiff(); if (diff == null) { close(); return endOfData(); } return diff; }
public static BurnOnCloseFileIterator<String> wrap(LineIterator iter, File backingFile) { return new BurnOnCloseFileIterator<String>(iter, backingFile, new Function<String, String>() { public String apply(String s) { return s; } }); } }
private static int getElementCount(String path) { int count = 0; for (String p : PathUtils.elements(path)) { assertFalse(PathUtils.isAbsolute(p)); count++; } return count; }
private String getPathPrefix(String indexPath) { // 2 = /oak:index/<index name> String parentPath = PathUtils.getAncestorPath(indexPath, 2); return PathUtils.denotesRoot(parentPath) ? "" : parentPath; }
@Override public String apply(String path) { return getParentPath(path); } });
private static String getIndexPath(String path, String indexName) { if (PathUtils.denotesRoot(path)) { return "/" + INDEX_DEFINITIONS_NAME + "/" + indexName; } return path + "/" + INDEX_DEFINITIONS_NAME + "/" + indexName; }
@Override public String apply(String input) { return PathUtils.getAncestorPath(input, level); } });
public LuceneDoc(String path, SearchContext sc) { this.path = path; this.sc = sc; this.depth = PathUtils.getDepth(path); }
/** * Shortcut to {@link #end(long, long, long, String, Object...)} for * {@code logMessagePrefix} = {@link Long#MAX_VALUE} */ public void end(long start, long logAtDebugIfSlowerThanMs, String logMessagePrefix, Object... arguments) { end(start, logAtDebugIfSlowerThanMs, Long.MAX_VALUE, logMessagePrefix, arguments); }
public void testNextSlash() { String path = "/test/a"; int n = PathUtils.getNextSlash(path, 0); assertEquals(0, n); n = PathUtils.getNextSlash(path, n + 1); assertEquals(5, n); n = PathUtils.getNextSlash(path, n + 1); assertEquals(-1, n); }
private static Iterator<String> createItr(String marked, String all) throws IOException { return new FileLineDifferenceIterator(lineItr(marked), lineItr(all)); }
/** * @deprecated Use {@link UUIDUtils#isValidUUID(String)} (String)} */ public static boolean isValidUUID(String uuid) { return UUIDUtils.isValidUUID(uuid); }
/** * Return any ids not existing in the deletions being tracked from the ids in file parameter. * * @param recs the file to search for ids existing in the deletions here * @return */ public Iterator<String> filter(File recs) throws IOException { return new FileLineDifferenceIterator(delFile, recs, transformer); } }
/** * @return same as {@code canExitEarly(false)} */ private boolean canExitEarly() { return canExitEarly(false); }
/** * Shortcut to {@code start(traceMsgOrNull, true)} */ public final long startForInfoLog(String traceMsgOrNull) { if (canExitEarly(true)) { return -1; } return start(traceMsgOrNull, true); }
/** * @deprecated Use {@link UUIDUtils#isValidUUID(String)} (String)} */ public static boolean isValidUUID(String uuid) { return UUIDUtils.isValidUUID(uuid); }