/** * @see org.apache.wicket.markup.html.form.FormComponent#getInputAsArray() */ public String[] getInputAsArray() { FileUpload fu = getFileUpload(); if (fu != null) { return new String[] { fu.getClientFileName() }; } return null; }
@Override protected List<FileUpload> convertValue(String[] value) throws ConversionException { final String[] filenames = getInputAsArray(); if (filenames == null) { return null; } return getFileUploads(); }
/** * Get the MD5 checksum. * * @return The MD5 checksum of the file */ public byte[] getMD5() { return getDigest("MD5"); }
public FileUploadPanel(final String id) { this(id, new FileUploadField(FileUploadPanel.WICKET_ID)); }
/** * @see org.apache.wicket.markup.html.form.FormComponent#updateModel() */ public void updateModel() { // Only update the model if one was passed in if (hasExplicitModel) { setModelObject(getFileUpload()); } }
/** * * @see org.apache.wicket.markup.html.form.FormComponent#convertValue(java.lang.String[]) */ @Override protected FileUpload convertValue(String[] value) throws ConversionException { final String[] filenames = getInputAsArray(); if (filenames == null) { return null; } return getFileUpload(); }
public FileUpload getFileUpload() { return fileUploadField.getFileUpload(); }
/** * Saves this file upload to a given file on the server side. * * @param file * The file * @throws IOException */ public void writeTo(final File file) throws IOException { writeTo(file, 4096); }
/** * @see org.projectforge.web.wicket.flowlayout.ComponentWrapperPanel#getComponentOutputId() */ @Override public String getComponentOutputId() { fileUploadField.setOutputMarkupId(true); return fileUploadField.getMarkupId(); }
public String getContentType() { return upload.getContentType(); }
public byte[] get() { return upload.getBytes(); }
public Collection<FileUpload> getUploads() { return uploadField.getConvertedInput(); } }
public long getSize() { return upload.getSize(); }
public void delete() { upload.delete(); }
/** * @see org.apache.wicket.markup.html.form.FormComponent#getInputAsArray() */ @Override public String[] getInputAsArray() { FileUpload fu = getFileUpload(); if (fu != null) { return new String[] { fu.getClientFileName() }; } return null; }
public FileUpload getFileUpload() { return fileUploadField.getFileUpload(); }
/** * @see org.projectforge.web.wicket.flowlayout.ComponentWrapperPanel#getComponentOutputId() */ @Override public String getComponentOutputId() { fileUploadField.setOutputMarkupId(true); return fileUploadField.getMarkupId(); }
@Override protected List<FileUpload> convertValue(String[] value) throws ConversionException { final String[] filenames = getInputAsArray(); if (filenames == null) { return null; } return getFileUploads(); }
public Collection<FileUpload> getUploads() { return uploadField.getConvertedInput(); } }
/** * Get the MD5 checksum. * * @return The MD5 checksum of the file */ public byte[] getMD5() { return getDigest("MD5"); }