private static void ensureMutable(File file) {
   if (file.isDirectory()) {
     FileEntry entry = ClearcaseUtils.readEntry(Clearcase.getInstance().getClient(), file);
     if (entry == null || entry.isCheckedout() || entry.isViewPrivate()) {
       return;
     }
   } else {
     if (file.canWrite()) return;
   }
   CheckoutCommand command =
       new CheckoutCommand(new File[] {file}, null, CheckoutCommand.Reserved.Reserved, true);
   Clearcase.getInstance().getClient().exec(command, true);
 }
 private void uncheckout(File file) {
   FileEntry entry = ClearcaseUtils.readEntry(Clearcase.getInstance().getClient(), file);
   if (entry != null && entry.isCheckedout()) {
     Clearcase.getInstance()
         .getClient()
         .exec(new UnCheckoutCommand(new File[] {file}, false), true);
   }
   File[] files = file.listFiles();
   if (files == null) {
     return;
   }
   for (File f : files) {
     uncheckout(f);
   }
 }