private void uploadFilesInSingleThread(List<File> files, long totalSize) throws RepositoryException { long startTime = System.currentTimeMillis(); LOG.info("Upload: [{}] files in single thread.", files.size()); long currentCount = 0; long currentSize = 0; long time = System.currentTimeMillis(); for (File f : files) { String name = f.getName(); LOG.debug("upload file [{}] ", name); if (!name.startsWith(TMP) && !name.endsWith(DS_STORE) && f.length() > 0) { uploadFileToBackEnd(f, false); } currentSize += f.length(); currentCount++; long now = System.currentTimeMillis(); if (now > time + 5000) { LOG.info("Uploaded: [{}/{}] files, [{}/{}] size data", new Object[] { currentCount, files.size(), currentSize, totalSize }); time = now; } } long endTime = System.currentTimeMillis(); LOG.info( "Uploaded: [{}/{}] files, [{}/{}] size data, time taken = [{}] sec", new Object[] { currentCount, files.size(), currentSize, totalSize, ((endTime - startTime) / 1000) }); }
private void uploadFilesInSingleThread(List<File> files, long totalSize) throws RepositoryException { long startTime = System.currentTimeMillis(); LOG.info("Upload: [{}] files in single thread.", files.size()); long currentCount = 0; long currentSize = 0; long time = System.currentTimeMillis(); for (File f : files) { String name = f.getName(); LOG.debug("upload file [{}] ", name); if (!name.startsWith(TMP) && !name.endsWith(DS_STORE) && f.length() > 0) { uploadFileToBackEnd(f, false); } currentSize += f.length(); currentCount++; long now = System.currentTimeMillis(); if (now > time + 5000) { LOG.info("Uploaded: [{}/{}] files, [{}/{}] size data", new Object[] { currentCount, files.size(), currentSize, totalSize }); time = now; } } long endTime = System.currentTimeMillis(); LOG.info( "Uploaded: [{}/{}] files, [{}/{}] size data, time taken = [{}] sec", new Object[] { currentCount, files.size(), currentSize, totalSize, ((endTime - startTime) / 1000) }); }
private void uploadFilesInSingleThread(List<File> files, long totalSize) throws RepositoryException { long startTime = System.currentTimeMillis(); LOG.info("Upload: [{}] files in single thread.", files.size()); long currentCount = 0; long currentSize = 0; long time = System.currentTimeMillis(); for (File f : files) { String name = f.getName(); LOG.debug("upload file [{}] ", name); if (!name.startsWith(TMP) && !name.endsWith(DS_STORE) && f.length() > 0) { uploadFileToBackEnd(f, false); } currentSize += f.length(); currentCount++; long now = System.currentTimeMillis(); if (now > time + 5000) { LOG.info("Uploaded: [{}/{}] files, [{}/{}] size data", new Object[] { currentCount, files.size(), currentSize, totalSize }); time = now; } } long endTime = System.currentTimeMillis(); LOG.info( "Uploaded: [{}/{}] files, [{}/{}] size data, time taken = [{}] sec", new Object[] { currentCount, files.size(), currentSize, totalSize, ((endTime - startTime) / 1000) }); }