Package de.metalcon.utils

Examples of de.metalcon.utils.FormFile


              this.commandQueue.add(createStatusUpdateCommand);

              commandStacked = true;
            } catch (final StatusUpdateInstantiationFailedException e) {
              // remove the files
              FormFile fileItem;
              File file;
              for (String fileIdentifier : formItemList
                  .getFileIdentifiers()) {
                fileItem = formItemList.getFile(fileIdentifier);
                file = fileItem.getFile();

                if (file != null) {
                  file.delete();
                }
              }
View Full Code Here


   * @throws Exception
   *             if a file could not be written
   */
  private void writeFiles(final StatusUpdateTemplate template,
      final FormItemList items) throws Exception {
    FormFile fileItem;
    TemplateFileInfo fileInfo;
    for (String fileIdentifier : items.getFileIdentifiers()) {
      fileItem = items.getFile(fileIdentifier);
      fileInfo = template.getFiles().get(fileIdentifier);

      if (fileInfo.getContentType().equals(fileItem.getContentType())) {
        // write the file and store it within the instantiation item
        final File file = this.writeFile(fileItem);
        fileItem.setFile(file);
      } else {
        throw new StatusUpdateInstantiationFailedException("file \""
            + fileIdentifier + "\" must have content type "
            + fileInfo.getContentType());
      }
View Full Code Here

    return response;
  }

  private static String checkImage(FormItemList items,
      ProcessCreateResponse response) {
    FormFile image = null;
    String imageB64 = null;
    FileItem imageFile;
    // FormItem imageFile = null;
    try {
      // TODO: double check, if it works that way on images
      image = items.getFile(ProtocolConstants.IMAGE);
      imageFile = image.getFormItem();
      // imageFile = image.get;
    } catch (IllegalArgumentException e) {
      // response.addNoImageWarning(CreateStatusCodes.NO_IMAGE);
      return null;
    }
View Full Code Here

TOP

Related Classes of de.metalcon.utils.FormFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.