private boolean fileShouldBeIgnored(String name, boolean isDirectory, File file) { boolean matches = options.getIgnoreFiles().matches(name, isDirectory); if (matches && LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Ignoring file '" + name + "' because the name matches the ignore list."); } if (!matches && options.getMaxFileSize().isPresent()) { if (!googleDriveAdapter.isDirectory(file)) { Long fileSize = file.getSize(); Long maxFileSize = options.getMaxFileSize().get(); if (maxFileSize.compareTo(fileSize) < 0) { matches = true; LOGGER.log(Level.FINE, "Ignoring '" + name + "' because file is bigger than maxFileSize (file: " + fileSize + ", maxFileSize: " + maxFileSize + ")."); } } } return matches; } }
DateTime modifiedDateRemote = remoteChild.getModifiedTime(); long sizeLocal = attr.size(); Long sizeRemote = remoteChild.getSize() == null ? 0L : remoteChild.getSize(); if (!datesAreEqual(modifiedDateLocal.toMillis(), modifiedDateRemote.getValue(), syncItem)) { LOGGER.log(Level.FINE, "Last modification dates are not equal for file '" + syncItemFound.getPath() + "' (local: " + DATE_FORMAT.format(new Date(modifiedDateLocal.toMillis())) + "; remote: " + DATE_FORMAT.format(new Date(modifiedDateRemote.getValue())) + "). Checking MD5 checksums.");
private GFile create(File file) { GFile newFile = new GFile(file.getName() != null ? file.getName() : file.getOriginalFilename()); newFile.setId(file.getId()); newFile.setLastModified(file.getModifiedTime() != null ? file.getModifiedTime().getValue() : 0); newFile.setDirectory(GFile.MIME_TYPE.GOOGLE_FOLDER.getValue().equals(file.getMimeType())); newFile.setSize(file.getSize() != null ? file.getSize() : 0); // null for directories newFile.setMimeType(file.getMimeType()); newFile.setMd5Checksum(file.getMd5Checksum()); if (file.getParents() != null) { Set<String> newParents = new HashSet<>(); for (String newParent : file.getParents()) { newParents.add(newParent.equals(ROOT_FOLDER_ID) ? "root" : newParent); } newFile.setParents(newParents); } else { // does this happen? newFile.setParents(Collections.singleton("root")); } newFile.setTrashed(file.getTrashed() != null && file.getTrashed()); return newFile; }
FileTime localLastModifiedTime = attr.lastModifiedTime(); long sizeLocal = attr.size(); long sizeRemote = remoteFile.getSize() == null ? 0L : remoteFile.getSize(); if (!datesAreEqual(localLastModifiedTime.toMillis(), remoteFileModifiedDate.getValue(), syncItem)) { LOGGER.log(Level.FINE, "Last modification dates are not equal for file '" + syncItem.getPath() + "' (local: " + DATE_FORMAT.format(new Date(localLastModifiedTime.toMillis())) + "; remote: " + DATE_FORMAT.format(new Date(remoteFileModifiedDate.getValue())) + "). Checking MD5 checksums.");
private IndexedRecord convertSearchResultToIndexedRecord(File file) { // Main record IndexedRecord main = new GenericData.Record(schema); main.put(0, file.getId()); main.put(1, file.getName()); main.put(2, file.getMimeType()); main.put(3, file.getModifiedTime().getValue()); main.put(4, file.getSize()); main.put(5, file.getKind()); main.put(6, file.getTrashed()); main.put(7, file.getParents().toString()); // TODO This should be a List<String> main.put(8, file.getWebViewLink()); return main; }
private IndexedRecord convertSearchResultToIndexedRecord(File file) { // Main record IndexedRecord main = new GenericData.Record(schema); main.put(0, file.getId()); main.put(1, file.getName()); main.put(2, file.getMimeType()); main.put(3, file.getModifiedTime().getValue()); main.put(4, file.getSize()); main.put(5, file.getKind()); main.put(6, file.getTrashed()); main.put(7, file.getParents().toString()); // TODO This should be a List<String> main.put(8, file.getWebViewLink()); return main; }