private long getFileSize(FSRoot root, String path) 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); } return root.getFileSize(path); }
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); } } }
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); } } }
verifyPath(root, path); FSRevisionNode node = root.getRevisionNode(path); return node.getProperties(fsfs);
verifyPath(root, path); FSRevisionNode node = root.getRevisionNode(path); return node.getProperties(fsfs);
verifyPath(root, path); FSRevisionNode node = root.getRevisionNode(path); return node.getProperties(fsfs);