@Override public Long call() throws Exception { return summary0(path).totalLength(); } });
/** {@inheritDoc} */ @Override public ContentSummary getContentSummary(Path f) throws IOException { A.notNull(f, "f"); enterBusy(); try { IgfsPathSummary sum = rmtClient.contentSummary(convert(f)); return new ContentSummary(sum.totalLength(), sum.filesCount(), sum.directoriesCount(), -1, sum.totalLength(), rmtClient.fsStatus().spaceTotal()); } finally { leaveBusy(); } }
/** * Calculates size of directory or file for given ID. * * @param file IGFS File object. * @param sum Summary object that will collect information. * @throws IgniteCheckedException If failed. */ private void summaryRecursive(IgfsFile file, IgfsPathSummary sum) throws IgniteCheckedException { assert file != null; assert sum != null; if (file.isDirectory()) { if (!F.eq(IgfsPath.ROOT, file.path())) sum.directoriesCount(sum.directoriesCount() + 1); for (IgfsFile childFile : listFiles(file.path())) summaryRecursive(childFile, sum); } else { sum.filesCount(sum.filesCount() + 1); sum.totalLength(sum.totalLength() + file.length()); } }
@Override public Long call() throws Exception { return summary0(path).totalLength(); } });
/** * Calculates size of directory or file for given ID. * * @param file IGFS File object. * @param sum Summary object that will collect information. * @throws IgniteCheckedException If failed. */ private void summaryRecursive(IgfsFile file, IgfsPathSummary sum) throws IgniteCheckedException { assert file != null; assert sum != null; if (file.isDirectory()) { if (!F.eq(IgfsPath.ROOT, file.path())) sum.directoriesCount(sum.directoriesCount() + 1); for (IgfsFile childFile : listFiles(file.path())) summaryRecursive(childFile, sum); } else { sum.filesCount(sum.filesCount() + 1); sum.totalLength(sum.totalLength() + file.length()); } }