1 17 18 19 20 package org.apache.lenya.cms.rc; 21 22 import java.util.Date ; 23 24 25 28 public class FileReservedCheckInException extends Exception { 29 private String source = null; 30 private Date date = null; 31 private String username = null; 32 private String typeString = null; 33 private short type; 34 35 43 public FileReservedCheckInException(String source, RCML rcml) 44 throws Exception { 45 this.source = source; 46 47 try { 48 RCMLEntry rcmlEntry = rcml.getLatestEntry(); 49 50 username = rcmlEntry.getIdentity(); 51 date = new Date (rcmlEntry.getTime()); 52 type = rcmlEntry.getType(); 53 54 if (type == RCML.co) { 55 typeString = "Checkout"; 56 } else { 57 typeString = "Checkin"; 58 } 59 } catch (Exception exception) { 60 throw new Exception ("Unable to create FileReservedCheckInException object!"); 61 } 62 } 63 64 69 public String getMessage() { 70 return "Unable to check in the file " + this.source + " because of a " + this.typeString + 71 " by user " + this.username + " at " + this.date; 72 } 73 78 public Date getDate() { 79 return date; 80 } 81 82 87 public String getTypeString() { 88 return typeString; 89 } 90 91 96 public String getUsername() { 97 return username; 98 } 99 100 105 public String getSource() { 106 return source; 107 } 108 } 109 | Popular Tags |