private void getTree(FSFS fsfs, FSRoot root, String path, SVNNodeKind kind, FSID id, boolean includeIDs, int depth, boolean recursive, ISVNTreeHandler handler) throws SVNException { checkCancelled(); if (handler != null) { handler.handlePath(new SVNAdminPath(path, includeIDs ? id.toString() : null, depth, kind == SVNNodeKind.DIR)); } if (kind != SVNNodeKind.DIR) { return; } if (recursive || depth == 0) { FSRevisionNode node = root.getRevisionNode(path); Map entries = node.getDirEntries(fsfs); for (Iterator names = entries.keySet().iterator(); names.hasNext();) { String name = (String) names.next(); FSEntry entry = (FSEntry) entries.get(name); getTree(fsfs, root, SVNPathUtil.getAbsolutePath(SVNPathUtil.append(path, entry.getName())), entry.getType(), includeIDs ? entry.getId() : null, includeIDs, depth + 1, recursive, handler); } } }
private void getTree(FSFS fsfs, FSRoot root, String path, SVNNodeKind kind, FSID id, boolean includeIDs, int depth, boolean recursive, ISVNTreeHandler handler) throws SVNException { checkCancelled(); if (handler != null) { handler.handlePath(new SVNAdminPath(path, includeIDs ? id.toString() : null, depth, kind == SVNNodeKind.DIR)); } if (kind != SVNNodeKind.DIR) { return; } if (recursive || depth == 0) { FSRevisionNode node = root.getRevisionNode(path); Map entries = node.getDirEntries(fsfs); for (Iterator names = entries.keySet().iterator(); names.hasNext();) { String name = (String) names.next(); FSEntry entry = (FSEntry) entries.get(name); getTree(fsfs, root, SVNPathUtil.getAbsolutePath(SVNPathUtil.append(path, entry.getName())), entry.getType(), includeIDs ? entry.getId() : null, includeIDs, depth + 1, recursive, handler); } } }
private void getTree(FSFS fsfs, FSRoot root, String path, SVNNodeKind kind, FSID id, boolean includeIDs, int depth, boolean recursive, ISVNTreeHandler handler) throws SVNException { checkCancelled(); if (handler != null) { handler.handlePath(new SVNAdminPath(path, includeIDs ? id.toString() : null, depth, kind == SVNNodeKind.DIR)); } if (kind != SVNNodeKind.DIR) { return; } if (recursive || depth == 0) { FSRevisionNode node = root.getRevisionNode(path); Map entries = node.getDirEntries(fsfs); for (Iterator names = entries.keySet().iterator(); names.hasNext();) { String name = (String) names.next(); FSEntry entry = (FSEntry) entries.get(name); getTree(fsfs, root, SVNPathUtil.getAbsolutePath(SVNPathUtil.append(path, entry.getName())), entry.getType(), includeIDs ? entry.getId() : null, includeIDs, depth + 1, recursive, handler); } } }
private void catFile(FSRoot root, String path, OutputStream out) throws SVNException { SVNNodeKind kind = verifyPath(root, path); if (kind != SVNNodeKind.FILE) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FILE, "Path ''{0}'' is not a file", path); SVNErrorManager.error(err, SVNLogType.FSFS); } if (out != null) { InputStream contents = null; try { contents = root.getFileStreamForPath(new SVNDeltaCombiner(), path); byte[] buffer = new byte[SVNFileUtil.STREAM_CHUNK_SIZE]; int len = 0; do { checkCancelled(); len = SVNFileUtil.readIntoBuffer(contents, buffer, 0, buffer.length); if (len > 0) { out.write(buffer, 0, len); } } while (len == SVNFileUtil.STREAM_CHUNK_SIZE); } catch (IOException ioe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage()); SVNErrorManager.error(err, ioe, SVNLogType.FSFS); } finally { SVNFileUtil.closeFile(contents); } } }
private void catFile(FSRoot root, String path, OutputStream out) throws SVNException { SVNNodeKind kind = verifyPath(root, path); if (kind != SVNNodeKind.FILE) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FILE, "Path ''{0}'' is not a file", path); SVNErrorManager.error(err, SVNLogType.FSFS); } if (out != null) { InputStream contents = null; try { contents = root.getFileStreamForPath(new SVNDeltaCombiner(), path); byte[] buffer = new byte[SVNFileUtil.STREAM_CHUNK_SIZE]; int len = 0; do { checkCancelled(); len = SVNFileUtil.readIntoBuffer(contents, buffer, 0, buffer.length); out.write(buffer, 0, len); } while (len == SVNFileUtil.STREAM_CHUNK_SIZE); } catch (IOException ioe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage()); SVNErrorManager.error(err, ioe, SVNLogType.FSFS); } finally { SVNFileUtil.closeFile(contents); } } }
private void catFile(FSRoot root, String path, OutputStream out) throws SVNException { SVNNodeKind kind = verifyPath(root, path); if (kind != SVNNodeKind.FILE) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FILE, "Path ''{0}'' is not a file", path); SVNErrorManager.error(err, SVNLogType.FSFS); } if (out != null) { InputStream contents = null; try { contents = root.getFileStreamForPath(new SVNDeltaCombiner(), path); byte[] buffer = new byte[SVNFileUtil.STREAM_CHUNK_SIZE]; int len = 0; do { checkCancelled(); len = SVNFileUtil.readIntoBuffer(contents, buffer, 0, buffer.length); if (len > 0) { out.write(buffer, 0, len); } } while (len == SVNFileUtil.STREAM_CHUNK_SIZE); } catch (IOException ioe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage()); SVNErrorManager.error(err, ioe, SVNLogType.FSFS); } finally { SVNFileUtil.closeFile(contents); } } }