Package org.apache.myfaces.trinidadinternal.share.util

Examples of org.apache.myfaces.trinidadinternal.share.util.MultipartFormItem


        // of this code didn't have any allowed configuration...
        mfh.setMaximumAllowedBytes(_maxAllowedBytes);
        mfh.setCharacterEncoding(ExternalContextUtils.getCharacterEncoding(externalContext));

        final HashMap<String, String[]> parameters = new HashMap<String, String[]>();
        MultipartFormItem item;
        final UploadedFiles files = new UploadedFiles(externalContext);
        while ((item = mfh.getNextPart()) != null)
        {
          final String name = item.getName();
          String value = null;
          // No filename - it's not a file uploaded field
          if (item.getFilename() == null)
          {
            value = item.getValue();
            final Object oldValue = parameters.get(name);
            if (oldValue == null)
            {
              parameters.put(name, new String[]{value});
            }
            else
            {
              final String[] oldArray = (String[]) oldValue;
              final String[] newArray = new String[oldArray.length + 1];
              System.arraycopy(oldArray, 0, newArray, 1, oldArray.length);
              newArray[0] = value;
              parameters.put(name, newArray);
            }
          }
          // Upload a file
          else if (item.getFilename().length() > 0)
          {
            _doUploadFile(RequestContext.getCurrentInstance(), externalContext, files, item);
          }
        }
        externalContext.getRequestMap().put(_PARAMS, parameters);
View Full Code Here


        // of this code didn't have any allowed configuration...
        mfh.setMaximumAllowedBytes(_maxAllowedBytes);
        mfh.setCharacterEncoding(ExternalContextUtils.getCharacterEncoding(externalContext));

        final HashMap<String, String[]> parameters = new HashMap<String, String[]>();
        MultipartFormItem item;
        final UploadedFiles files = new UploadedFiles(externalContext);
        while ((item = mfh.getNextPart()) != null)
        {
          final String name = item.getName();
          String value = null;
          // No filename - it's not a file uploaded field
          if (item.getFilename() == null)
          {
            value = item.getValue();
            final Object oldValue = parameters.get(name);
            if (oldValue == null)
            {
              parameters.put(name, new String[]{value});
            }
            else
            {
              final String[] oldArray = (String[]) oldValue;
              final String[] newArray = new String[oldArray.length + 1];
              System.arraycopy(oldArray, 0, newArray, 1, oldArray.length);
              newArray[0] = value;
              parameters.put(name, newArray);
            }
          }
          // Upload a file
          else if (item.getFilename().length() > 0)
          {
            _doUploadFile(RequestContext.getCurrentInstance(), externalContext, files, item);
          }
        }
        externalContext.getRequestMap().put(_PARAMS, parameters);
View Full Code Here

        // of this code didn't have any allowed configuration...
        mfh.setMaximumAllowedBytes(_maxAllowedBytes);
        mfh.setCharacterEncoding(ExternalContextUtils.getCharacterEncoding(externalContext));

        final HashMap<String, String[]> parameters = new HashMap<String, String[]>();
        MultipartFormItem item;
        final UploadedFiles files = new UploadedFiles(externalContext);
        while ((item = mfh.getNextPart()) != null)
        {
          final String name = item.getName();
          String value = null;
          // No filename - it's not a file uploaded field
          if (item.getFilename() == null)
          {
            value = item.getValue();
            final Object oldValue = parameters.get(name);
            if (oldValue == null)
            {
              parameters.put(name, new String[]{value});
            }
            else
            {
              final String[] oldArray = (String[]) oldValue;
              final String[] newArray = new String[oldArray.length + 1];
              System.arraycopy(oldArray, 0, newArray, 1, oldArray.length);
              newArray[0] = value;
              parameters.put(name, newArray);
            }
          }
          // Upload a file
          else if (item.getFilename().length() > 0)
          {
            _doUploadFile(RequestContext.getCurrentInstance(), externalContext, files, item);
          }
        }
        externalContext.getRequestMap().put(_PARAMS, parameters);
View Full Code Here

        // of this code didn't have any allowed configuration...
        mfh.setMaximumAllowedBytes(_maxAllowedBytes);
        mfh.setCharacterEncoding(ExternalContextUtils.getCharacterEncoding(externalContext));

        final HashMap<String, String[]> parameters = new HashMap<String, String[]>();
        MultipartFormItem item;
        final UploadedFiles files = new UploadedFiles(externalContext);
        while ((item = mfh.getNextPart()) != null)
        {
          final String name = item.getName();
          String value = null;
          // No filename - it's not a file uploaded field
          if (item.getFilename() == null)
          {
            value = item.getValue();
            final Object oldValue = parameters.get(name);
            if (oldValue == null)
            {
              parameters.put(name, new String[]{value});
            }
            else
            {
              final String[] oldArray = (String[]) oldValue;
              final String[] newArray = new String[oldArray.length + 1];
              System.arraycopy(oldArray, 0, newArray, 1, oldArray.length);
              newArray[0] = value;
              parameters.put(name, newArray);
            }
          }
          // Upload a file
          else if (item.getFilename().length() > 0)
          {
            _doUploadFile(RequestContext.getCurrentInstance(), externalContext, files, item);
          }
        }
        externalContext.getRequestMap().put(_PARAMS, parameters);
View Full Code Here

        // of this code didn't have any allowed configuration...
        mfh.setMaximumAllowedBytes(_maxAllowedBytes);
        mfh.setCharacterEncoding(ExternalContextUtils.getCharacterEncoding(externalContext));

        final HashMap<String, String[]> parameters = new HashMap<String, String[]>();
        MultipartFormItem item;
        final UploadedFiles files = new UploadedFiles(externalContext);
        while ((item = mfh.getNextPart()) != null)
        {
          final String name = item.getName();
          String value = null;
          // No filename - it's not a file uploaded field
          if (item.getFilename() == null)
          {
            value = item.getValue();
            final Object oldValue = parameters.get(name);
            if (oldValue == null)
            {
              parameters.put(name, new String[]{value});
            }
            else
            {
              final String[] oldArray = (String[]) oldValue;
              final String[] newArray = new String[oldArray.length + 1];
              System.arraycopy(oldArray, 0, newArray, 1, oldArray.length);
              newArray[0] = value;
              parameters.put(name, newArray);
            }
          }
          // Upload a file
          else if (item.getFilename().length() > 0)
          {
            _doUploadFile(RequestContext.getCurrentInstance(), externalContext, files, item);
          }
        }
        externalContext.getRequestMap().put(_PARAMS, parameters);
View Full Code Here

        // of this code didn't have any allowed configuration...
        mfh.setMaximumAllowedBytes(_maxAllowedBytes);
        mfh.setCharacterEncoding(ExternalContextUtils.getCharacterEncoding(externalContext));

        final HashMap<String, String[]> parameters = new HashMap<String, String[]>();
        MultipartFormItem item;
        final UploadedFiles files = new UploadedFiles(externalContext);
        while ((item = mfh.getNextPart()) != null)
        {
          final String name = item.getName();
          String value = null;
          // No filename - it's not a file uploaded field
          if (item.getFilename() == null)
          {
            value = item.getValue();
            final Object oldValue = parameters.get(name);
            if (oldValue == null)
            {
              parameters.put(name, new String[]{value});
            }
            else
            {
              final String[] oldArray = (String[]) oldValue;
              final String[] newArray = new String[oldArray.length + 1];
              System.arraycopy(oldArray, 0, newArray, 1, oldArray.length);
              newArray[0] = value;
              parameters.put(name, newArray);
            }
          }
          // Upload a file
          else if (item.getFilename().length() > 0)
          {
            _doUploadFile(RequestContext.getCurrentInstance(), externalContext, files, item);
          }
        }
        externalContext.getRequestMap().put(_PARAMS, parameters);
View Full Code Here

        // of this code didn't have any allowed configuration...
        mfh.setMaximumAllowedBytes(_maxAllowedBytes);
        mfh.setCharacterEncoding(ExternalContextUtils.getCharacterEncoding(externalContext));

        final HashMap<String, String[]> parameters = new HashMap<String, String[]>();
        MultipartFormItem item;
        UploadedFiles files = new UploadedFiles(externalContext);
        while ((item = mfh.getNextPart()) != null)
        {
          final String name = item.getName();
          String value = null;
          // No filename - it's not a file uploaded field
          if (item.getFilename() == null)
          {
            value = item.getValue();
            final Object oldValue = parameters.get(name);
            if (oldValue == null)
            {
              parameters.put(name, new String[]{value});
            }
            else
            {
              final String[] oldArray = (String[]) oldValue;
              final String[] newArray = new String[oldArray.length + 1];
              System.arraycopy(oldArray, 0, newArray, 1, oldArray.length);
              newArray[0] = value;
              parameters.put(name, newArray);
            }
          }
          else if (item.getFilename().length() > 0)
          {
            // Upload a file
            _doUploadFile(RequestContext.getCurrentInstance(), externalContext, files, item);
          }
        }
View Full Code Here

        // of this code didn't have any allowed configuration...
        mfh.setMaximumAllowedBytes(_maxAllowedBytes);
        mfh.setCharacterEncoding(ExternalContextUtils.getCharacterEncoding(externalContext));

        final HashMap<String, String[]> parameters = new HashMap<String, String[]>();
        MultipartFormItem item;
        final UploadedFiles files = new UploadedFiles(externalContext);
        while ((item = mfh.getNextPart()) != null)
        {
          final String name = item.getName();
          String value = null;
          // No filename - it's not a file uploaded field
          if (item.getFilename() == null)
          {
            value = item.getValue();
            final Object oldValue = parameters.get(name);
            if (oldValue == null)
            {
              parameters.put(name, new String[]{value});
            }
            else
            {
              final String[] oldArray = (String[]) oldValue;
              final String[] newArray = new String[oldArray.length + 1];
              System.arraycopy(oldArray, 0, newArray, 1, oldArray.length);
              newArray[0] = value;
              parameters.put(name, newArray);
            }
          }
          // Upload a file
          else if (item.getFilename().length() > 0)
          {
            _doUploadFile(RequestContext.getCurrentInstance(), externalContext, files, item);
          }
        }
        externalContext.getRequestMap().put(_PARAMS, parameters);
View Full Code Here

        // of this code didn't have any allowed configuration...
        mfh.setMaximumAllowedBytes(_maxAllowedBytes);
        mfh.setCharacterEncoding(ExternalContextUtils.getCharacterEncoding(externalContext));

        final HashMap<String, String[]> parameters = new HashMap<String, String[]>();
        MultipartFormItem item;
        final UploadedFiles files = new UploadedFiles(externalContext);
        while ((item = mfh.getNextPart()) != null)
        {
          final String name = item.getName();
          String value = null;
          // No filename - it's not a file uploaded field
          if (item.getFilename() == null)
          {
            value = item.getValue();
            final Object oldValue = parameters.get(name);
            if (oldValue == null)
            {
              parameters.put(name, new String[]{value});
            }
            else
            {
              final String[] oldArray = (String[]) oldValue;
              final String[] newArray = new String[oldArray.length + 1];
              System.arraycopy(oldArray, 0, newArray, 1, oldArray.length);
              newArray[0] = value;
              parameters.put(name, newArray);
            }
          }
          // Upload a file
          else if (item.getFilename().length() > 0)
          {
            _doUploadFile(RequestContext.getCurrentInstance(), externalContext, files, item);
          }
        }
        externalContext.getRequestMap().put(_PARAMS, parameters);
View Full Code Here

        // of this code didn't have any allowed configuration...
        mfh.setMaximumAllowedBytes(_maxAllowedBytes);
        mfh.setCharacterEncoding(ExternalContextUtils.getCharacterEncoding(externalContext));

        final HashMap<String, String[]> parameters = new HashMap<String, String[]>();
        MultipartFormItem item;
        final UploadedFiles files = new UploadedFiles(externalContext);
        while ((item = mfh.getNextPart()) != null)
        {
          final String name = item.getName();
          String value = null;
          // No filename - it's not a file uploaded field
          if (item.getFilename() == null)
          {
            value = item.getValue();
            final Object oldValue = parameters.get(name);
            if (oldValue == null)
            {
              parameters.put(name, new String[]{value});
            }
            else
            {
              final String[] oldArray = (String[]) oldValue;
              final String[] newArray = new String[oldArray.length + 1];
              System.arraycopy(oldArray, 0, newArray, 1, oldArray.length);
              newArray[0] = value;
              parameters.put(name, newArray);
            }
          }
          // Upload a file
          else if (item.getFilename().length() > 0)
          {
            _doUploadFile(RequestContext.getCurrentInstance(), externalContext, files, item);
          }
        }
        externalContext.getRequestMap().put(_PARAMS, parameters);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidadinternal.share.util.MultipartFormItem

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.