- Timestamp:
- Sep 20, 2010, 8:51:41 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/service/ImageService.java
r6972 r6980 51 51 .getLog(ImageService.class); 52 52 53 /** 54 * Singleton 55 */ 53 56 private static ImageService instance; 54 57 58 /** 59 * @return the singleton 60 */ 55 61 public static ImageService getInstance() { 56 62 if (instance == null) { … … 60 66 } 61 67 68 /** 69 * private constructor to use a singleton 70 */ 62 71 private ImageService() { 63 72 64 73 } 65 74 75 /** 76 * Lists all images for a category 77 * @param categoryId the id of the category 78 * @param rafraichir true : refresh the list of images 79 * @return the list of images 80 * @throws IOException 81 */ 66 82 public List<Image> listerParCategory(Integer categoryId, boolean rafraichir) throws IOException { 67 83 return ImageDao.getInstance().listerParCategory(categoryId, rafraichir); … … 70 86 /** 71 87 * Method called to send an image to the server. 72 73 88 * @param filePath 74 89 * @param idCategory … … 77 92 */ 78 93 public boolean creer(String filePath, Integer idCategory) throws Exception { 79 MainFrame.getInstance().set ReussiteMessage(Messages.getMessage("mainFrame_resizing") + " " + filePath);94 MainFrame.getInstance().setMessage(Messages.getMessage("mainFrame_resizing") + " " + filePath); 80 95 //get the byte array of the original file, to keep metadata 81 96 byte[] bytesFichierOriginal = Outil.getBytesFromFile(new File(filePath)); … … 98 113 //I use here a try catch because if the original file isn't a jpeg 99 114 //the methode Outil.enrich will fail, but the procedure has to continue 100 MainFrame.getInstance().set ReussiteMessage(Messages.getMessage("mainFrame_addMetadata") + " " + filePath);115 MainFrame.getInstance().setMessage(Messages.getMessage("mainFrame_addMetadata") + " " + filePath); 101 116 try { 102 117 byte[] fichierEnrichi = Outil.enrich(bytesFichierOriginal, Outil.getBytesFromFile(new File(System … … 115 130 image.setOriginale(originale); 116 131 image.setIdCategory(idCategory); 117 MainFrame.getInstance().set ReussiteMessage(Messages.getMessage("mainFrame_sendingFiles") + " " + filePath);132 MainFrame.getInstance().setMessage(Messages.getMessage("mainFrame_sendingFiles") + " " + filePath); 118 133 //now we call the dao to send the image to the webservice 119 134 return ImageDao.getInstance().creer(image);
Note: See TracChangeset
for help on using the changeset viewer.