Examples of UploadInfo


Examples of europadm.upload.UploadInfo

    /**
     * {@inheritDocs}
     */
    public int compare(Object o1, Object o2) {
  UploadInfo u1 = (UploadInfo) o1;
  UploadInfo u2 = (UploadInfo) o2;
  long s1 = u1.getStartTime();
  long s2 = u2.getStartTime();

  if (s1 < s2) {
      return 1;
  } else if (s1 == s2) {
      return 0;
View Full Code Here

Examples of org.apache.wicket.protocol.http.servlet.UploadInfo

    final String upload = attributes.getParameters().get(UPLOAD_PARAMETER).toString();

    final HttpServletRequest req = (HttpServletRequest)attributes.getRequest()
      .getContainerRequest();

    UploadInfo info = MultipartServletWebRequestImpl.getUploadInfo(req, upload);

    String status;
    if ((info == null) || (info.getTotalBytes() < 1))
    {
      status = "100|";
    }
    else
    {
      status = info.getPercentageComplete() +
        "|" +
        new StringResourceModel(RESOURCE_STATUS, (Component)null, Model.of(info)).getString();
    }
    return status;
  }
View Full Code Here

Examples of org.apache.wicket.protocol.http.servlet.UploadInfo

   *         browser to update the progress bar
   */
  private String getStatus(final Attributes attributes)
  {
    HttpServletRequest req = (HttpServletRequest)attributes.getRequest().getContainerRequest();
    UploadInfo info = MultipartServletWebRequestImpl.getUploadInfo(req);

    String status = null;
    if ((info == null) || (info.getTotalBytes() < 1))
    {
      status = "0|0|0|0|0";
    }
    else
    {
      status = "" + info.getPercentageComplete() + "|" + info.getBytesUploadedString() + "|" +
        info.getTotalBytesString() + "|" + info.getTransferRateString() + "|" +
        info.getRemainingTimeString();
    }
    status = "<html><body>|" + status + "|</body></html>";
    return status;
  }
View Full Code Here

Examples of org.apache.wicket.protocol.http.servlet.UploadInfo

    final String upload = attributes.getParameters().get(UPLOAD_PARAMETER).toString();

    final HttpServletRequest req = (HttpServletRequest)attributes.getRequest()
      .getContainerRequest();

    UploadInfo info = MultipartServletWebRequestImpl.getUploadInfo(req, upload);

    String status = null;
    if ((info == null) || (info.getTotalBytes() < 1))
    {
      status = "100|";
    }
    else
    {
      status = info.getPercentageComplete() +
        "|" +
        new StringResourceModel(RESOURCE_STATUS, (Component)null, Model.of(info)).getString();
    }
    return status;
  }
View Full Code Here

Examples of org.apache.wicket.protocol.http.servlet.UploadInfo

    final HttpServletRequest req = (HttpServletRequest)attributes.getRequest()
      .getContainerRequest();

    final String upload = req.getParameter(UPLOAD_PARAMETER);

    UploadInfo info = MultipartServletWebRequestImpl.getUploadInfo(req, upload);

    String status = null;
    if ((info == null) || (info.getTotalBytes() < 1))
    {
      status = "100|";
    }
    else
    {
      status = info.getPercentageComplete() +
        "|" +
        new StringResourceModel(
          RESOURCE_STATUS,
          (Component)null,
          Model.of(info),
View Full Code Here

Examples of org.apache.wicket.protocol.http.servlet.UploadInfo

    final HttpServletRequest req = (HttpServletRequest)attributes.getRequest()
      .getContainerRequest();

    final String upload = req.getParameter(UPLOAD_PARAMETER);

    UploadInfo info = MultipartServletWebRequestImpl.getUploadInfo(req, upload);

    String status = null;
    if ((info == null) || (info.getTotalBytes() < 1))
    {
      status = "100|";
    }
    else
    {
      status = info.getPercentageComplete() +
        "|" +
        new StringResourceModel(RESOURCE_STATUS, (Component)null, Model.of(info)).getString();
    }
    return status;
  }
View Full Code Here

Examples of org.chiba.web.upload.UploadInfo

                    }

                    this.chibaBean.updateControlValue(id, item.getContentType(), item.getName(), data);
                   
                    // After the value has been set and the RRR took place, create new UploadInfo with status set to 'done'
                    request.getSession().setAttribute(XFormsSession.ADAPTER_PREFIX + sessionKey+"-uploadInfo", new UploadInfo(1, 0, 0, 0,"done"));
                }
                else {
                    if (LOGGER.isDebugEnabled()) {
                        LOGGER.debug("ignoring empty upload " + id);
                    }
View Full Code Here

Examples of org.chiba.web.upload.UploadInfo

     *         param is the upload control id and second will be the current
     *         progress of the upload.
     */
    public org.w3c.dom.Element fetchProgress(String id, String filename, String sessionKey) {
        String progress;
        UploadInfo uploadInfo;

        if (session.getAttribute(XFormsSession.ADAPTER_PREFIX + sessionKey + "-uploadInfo") != null) {
            uploadInfo = (UploadInfo) session.getAttribute(XFormsSession.ADAPTER_PREFIX + sessionKey + "-uploadInfo");

            if (uploadInfo.isInProgress()) {
                double p = uploadInfo.getBytesRead() / uploadInfo.getTotalSize();

                progress = p + "";
                float total = uploadInfo.getTotalSize();
                float read = uploadInfo.getBytesRead();
                int iProgress = (int) Math.ceil((read / total) * 100);
                if (iProgress < 100) {
                  progress = Integer.toString(iProgress);
                }
                else {
                  progress = "99";
                }
                if (LOGGER.isDebugEnabled()) {
                    LOGGER.debug("Bytes total: " + uploadInfo.getTotalSize());
                    LOGGER.debug("Bytes read: " + uploadInfo.getBytesRead());
                    LOGGER.debug("elapsed time: " + uploadInfo.getElapsedTime());
                    LOGGER.debug("status: " + uploadInfo.getStatus());
                    LOGGER.debug("Percent completed: " + Math.ceil((read / total) * 100));
                }
            } else {
                progress = "100";
            }
View Full Code Here

Examples of org.jclouds.nirvanix.sdn.domain.UploadInfo

   public void testApplyInputStreamDetails() throws UnknownHostException {
      InputStream is = getClass().getResourceAsStream("/authtoken.json");

      ParseUploadInfoFromJsonResponse parser = i.getInstance(ParseUploadInfoFromJsonResponse.class);
      UploadInfo response = parser.apply(new HttpResponse(200, "ok", Payloads.newInputStreamPayload(is)));
      assertEquals(response.getHost(), URI.create("https://node1.nirvanix.com"));
      assertEquals(response.getToken(), "siR-ALYd~BEcJ8GR2tE~oX3SEHO8~2WXKT5xjFk~YLS5OvJyHI21TN34rQ");
   }
View Full Code Here

Examples of org.jclouds.nirvanix.sdn.domain.UploadInfo

   public void testUploadToken() throws InterruptedException, ExecutionException, TimeoutException, IOException {
      String containerName = containerPrefix + ".testObjectOperations";
      long size = 1024;

      UploadInfo uploadInfo = connection.getStorageNode(containerName, size);
      assertNotNull(uploadInfo.getHost());
      assertNotNull(uploadInfo.getToken());

      Blob blob = connection.newBlob();
      blob.getMetadata().setName("test.txt");
      blob.setPayload("value");
      Payloads.calculateMD5(blob);

      byte[] md5 = blob.getMetadata().getContentMetadata().getContentMD5();
      connection.upload(uploadInfo.getHost(), uploadInfo.getToken(), containerName, blob);

      Map<String, String> metadata = connection.getMetadata(containerName + "/test.txt");
      assertEquals(metadata.get("MD5"), Base64.encodeBytes(md5));

      String content = connection.getFile(containerName + "/test.txt");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.