/** Register that an upload has ended. */
 public void endUpload(String uploadId) {
   // NOTE: Don't enforce existence of upload, as this is also called if upload control becomes
   // non-relevant, and
   // also because asynchronously if the client notifies us to end an upload after a control has
   // become non-relevant,
   // we don't want to fail.
   if (pendingUploads != null) pendingUploads.remove(uploadId);
 }
 /** Register that an upload has started. */
 public void startUpload(String uploadId) {
   if (pendingUploads == null) pendingUploads = new HashSet<String>();
   pendingUploads.add(uploadId);
 }
 /** Whether an upload is pending for the given upload control. */
 public boolean isUploadPendingFor(XFormsUploadControl uploadControl) {
   return (pendingUploads != null) && pendingUploads.contains(uploadControl.getUploadUniqueId());
 }
 /** Return the number of pending uploads. */
 public int countPendingUploads() {
   return (pendingUploads == null) ? 0 : pendingUploads.size();
 }