@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof EncryptionZoneInt)) { return false; } EncryptionZoneInt b = (EncryptionZoneInt)o; return new EqualsBuilder() .append(inodeId, b.getINodeId()) .append(suite, b.getSuite()) .append(version, b.getVersion()) .append(keyName, b.getKeyName()) .isEquals(); }
final String pathName = getFullPathName(ezi.getINodeId()); if (!pathResolvesToId(ezi.getINodeId(), pathName)) { continue; zones.add(new EncryptionZone(ezi.getINodeId(), pathName, ezi.getSuite(), ezi.getVersion(), ezi.getKeyName())); count++;
final String srcEZPath = getFullPathName(srcParentEZI.getINodeId()); final String dstEZPath = getFullPathName(dstParentEZI.getINodeId()); final StringBuilder sb = new StringBuilder(srcIIP.getPath()); sb.append(" can't be moved from encryption zone "); srcParentEZI.getINodeId()); } else if (dstInEZ) { checkMoveValidityForReencryption(dstIIP.getPath(), dstParentEZI.getINodeId());
if (srcInEZ) { if (!dstInEZ) { if (srcEZI.getINodeId() == srcIIP.getLastINode().getId()) {
if (srcInEZ) { if (!dstInEZ) { if (srcEZI.getINodeId() == srcIIP.getLastINode().getId()) {
INodesInPath iip = dir.getINodesInPath(pathName, false); INode lastINode = iip.getLastINode(); if (lastINode == null || lastINode.getId() != ezi.getINodeId()) { continue; zones.add(new EncryptionZone(ezi.getINodeId(), pathName, ezi.getSuite(), ezi.getVersion(), ezi.getKeyName())); count++;
INodesInPath iip = dir.getINodesInPath(pathName, false); INode lastINode = iip.getLastINode(); if (lastINode == null || lastINode.getId() != ezi.getINodeId()) { continue; zones.add(new EncryptionZone(ezi.getINodeId(), pathName, ezi.getSuite(), ezi.getVersion(), ezi.getKeyName())); count++;
/** * Returns an EncryptionZone representing the ez for a given path. * Returns an empty marker EncryptionZone if path is not in an ez. * * @param iip The INodesInPath of the path to check * @return the EncryptionZone representing the ez for the path. */ EncryptionZone getEZINodeForPath(INodesInPath iip) { final EncryptionZoneInt ezi = getEncryptionZoneForPath(iip); if (ezi == null) { return null; } else { return new EncryptionZone(ezi.getINodeId(), getFullPathName(ezi), ezi.getSuite(), ezi.getVersion(), ezi.getKeyName()); } }
/** * Returns an EncryptionZone representing the ez for a given path. * Returns an empty marker EncryptionZone if path is not in an ez. * * @param iip The INodesInPath of the path to check * @return the EncryptionZone representing the ez for the path. */ EncryptionZone getEZINodeForPath(INodesInPath iip) { final EncryptionZoneInt ezi = getEncryptionZoneForPath(iip); if (ezi == null) { return null; } else { return new EncryptionZone(ezi.getINodeId(), getFullPathName(ezi), ezi.getSuite(), ezi.getVersion(), ezi.getKeyName()); } }
/** * Returns the path of the EncryptionZoneInt. * <p/> * Called while holding the FSDirectory lock. */ private String getFullPathName(EncryptionZoneInt ezi) { assert dir.hasReadLock(); return dir.getInode(ezi.getINodeId()).getFullPathName(); }
/** * Returns the path of the EncryptionZoneInt. * <p/> * Called while holding the FSDirectory lock. */ private String getFullPathName(EncryptionZoneInt ezi) { assert dir.hasReadLock(); return dir.getInode(ezi.getINodeId()).getFullPathName(); }
/** * Returns an EncryptionZone representing the ez for a given path. * Returns an empty marker EncryptionZone if path is not in an ez. * * @param iip The INodesInPath of the path to check * @return the EncryptionZone representing the ez for the path. */ EncryptionZone getEZINodeForPath(INodesInPath iip) throws IOException { final EncryptionZoneInt ezi = getEncryptionZoneForPath(iip); if (ezi == null) { return null; } else { return new EncryptionZone(ezi.getINodeId(), getFullPathName(ezi.getINodeId()), ezi.getSuite(), ezi.getVersion(), ezi.getKeyName()); } }