@Override public void visit(final AttributedList<Path> list, final int index, final Path p) { if(p.isFile()) { if(p.attributes().isDuplicate()) { if(p.attributes().getRevision() == 1) { final Map<String, String> custom = new HashMap<>(p.attributes().getCustom()); custom.put(SpectraVersioningFeature.KEY_REVERTABLE, Boolean.TRUE.toString()); p.attributes().setCustom(custom); } } } } });
public PathAttributes toAttributes(final Node node) throws BackgroundException { final PathAttributes attributes = new PathAttributes(); attributes.setVersionId(String.valueOf(node.getId())); attributes.setRevision(node.getBranchVersion()); attributes.setChecksum(Checksum.parse(node.getHash())); attributes.setCreationDate(node.getCreatedAt() != null ? node.getCreatedAt().getMillis() : -1L); attributes.setModificationDate(node.getUpdatedAt() != null ? node.getUpdatedAt().getMillis() : -1L); attributes.setSize(node.getSize()); attributes.setPermission(this.toPermission(node)); attributes.setAcl(this.toAcl(node)); final Map<String, String> custom = new HashMap<>(); if(null != node.getCntDownloadShares()) { custom.put(SDSAttributesFinderFeature.KEY_CNT_DOWNLOADSHARES, String.valueOf(node.getCntDownloadShares())); } if(null != node.getCntUploadShares()) { custom.put(SDSAttributesFinderFeature.KEY_CNT_UPLOADSHARES, String.valueOf(node.getCntUploadShares())); } custom.put(SDSAttributesFinderFeature.KEY_ENCRYPTED, String.valueOf(node.getIsEncrypted())); attributes.setCustom(custom); return attributes; }
attributes.setDuplicate((marker.isDeleteMarker() && marker.isLatest()) || !marker.isLatest()); if(marker.isDeleteMarker()) { attributes.setCustom(Collections.singletonMap(KEY_DELETE_MARKER, Boolean.TRUE.toString()));
attributes.setVersionId("null".equals(version.getVersionId()) ? null : version.getVersionId()); if(version.isDeleteMarker()) { attributes.setCustom(ImmutableMap.of(KEY_DELETE_MARKER, Boolean.TRUE.toString())); attributes.setDuplicate(true);
if(marker.getItems().length == 1) { final BaseVersionOrDeleteMarker markerObject = marker.getItems()[0]; copy.attributes().withVersionId(markerObject.getVersionId()).setCustom(Collections.singletonMap(KEY_DELETE_MARKER, Boolean.TRUE.toString())); delete.delete(Collections.singletonList(source), connectionCallback, callback);