1 43 package net.jforum.entities; 44 45 import java.io.File ; 46 47 import net.jforum.util.preferences.ConfigKeys; 48 import net.jforum.util.preferences.SystemGlobals; 49 50 54 public class Attachment 55 { 56 private int id; 57 private int postId; 58 private int privmsgsId; 59 private int userId; 60 private AttachmentInfo info; 61 62 65 public int getId() 66 { 67 return this.id; 68 } 69 70 73 public void setId(int id) 74 { 75 this.id = id; 76 } 77 78 81 public int getPostId() 82 { 83 return this.postId; 84 } 85 86 89 public void setPostId(int postId) 90 { 91 this.postId = postId; 92 } 93 94 97 public int getPrivmsgsId() 98 { 99 return this.privmsgsId; 100 } 101 102 105 public void setPrivmsgsId(int privmsgsId) 106 { 107 this.privmsgsId = privmsgsId; 108 } 109 110 113 public int getUserId() 114 { 115 return this.userId; 116 } 117 120 public void setUserId(int userId) 121 { 122 this.userId = userId; 123 } 124 125 128 public AttachmentInfo getInfo() 129 { 130 return this.info; 131 } 132 133 136 public void setInfo(AttachmentInfo info) 137 { 138 this.info = info; 139 } 140 141 public boolean hasThumb() 142 { 143 return SystemGlobals.getBoolValue(ConfigKeys.ATTACHMENTS_IMAGES_CREATE_THUMB) 144 && new File (SystemGlobals.getValue(ConfigKeys.ATTACHMENTS_STORE_DIR) 145 + '/' 146 + this.info.getPhysicalFilename() + "_thumb").exists(); 147 } 148 149 public String thumbPath() { 150 return SystemGlobals.getValue(ConfigKeys.ATTACHMENTS_UPLOAD_DIR) 151 + '/' 152 + this.info.getPhysicalFilename() 153 + "_thumb"; 154 } 155 } 156 | Popular Tags |