| 1 19 package org.openharmonise.him.actions.rules; 20 21 import org.openharmonise.vfs.*; 22 23 30 public class IsLockedByOtherUser implements EnableRule { 31 32 boolean m_bComparator = true; 33 34 37 public IsLockedByOtherUser() { 38 super(); 39 } 40 41 44 public boolean isEnabled(VirtualFile vfFile) { 45 if(vfFile.isLocked() && vfFile.getVFS().getVirtualFile(vfFile.getLockOwner()).getResource()!=null && !vfFile.getVFS().getVirtualFile(vfFile.getLockOwner()).getResource().getFileName().trim().equals(vfFile.getVFS().getAuthentication().getUsername())) { 46 return this.m_bComparator==true; 47 } else { 48 return this.m_bComparator==false; 49 } 50 } 51 52 55 public void setResultComparator(boolean bComparator) { 56 this.m_bComparator = bComparator; 57 } 58 59 } 60 | Popular Tags |