1 package com.indexdata.mkjsf.pazpar2.commands.sp;
\r
3 import java.io.IOException;
\r
5 import javax.enterprise.context.SessionScoped;
\r
6 import javax.inject.Named;
\r
8 import org.apache.log4j.Logger;
\r
9 import org.apache.myfaces.custom.fileupload.UploadedFile;
\r
11 import com.indexdata.mkjsf.utils.FileUpload;
\r
12 import com.indexdata.mkjsf.utils.Utils;
\r
15 * Helper class for file upload of an Service Proxy init doc.
\r
17 * @author Niels Erik
\r
22 public class InitDocUpload extends FileUpload {
\r
25 private UploadedFile uploadedFile = null;
\r
26 private static Logger logger = Logger.getLogger(InitDocUpload.class);
\r
27 private static final long serialVersionUID = 1846749236304941323L;
\r
29 public InitDocUpload() {
\r
32 public UploadedFile getUploadedFile() {
\r
33 return uploadedFile;
\r
36 public void setUploadedFile(UploadedFile uploadedFile) {
\r
37 logger.info(Utils.objectId(this) + " received an uploaded file [" + Utils.objectId(uploadedFile) + "]");
\r
38 this.uploadedFile = uploadedFile;
\r
40 logger.info("File length: " + this.uploadedFile.getBytes().length);
\r
41 } catch (IOException e) {
\r
42 // TODO Auto-generated catch block
\r
43 e.printStackTrace();
\r