Code example for File

Methods: deletelength

0
		} 
 
		ERCloudFilesAttachment attachment = ERCloudFilesAttachment.createERCloudFilesAttachment(
				editingContext, Boolean.FALSE, new NSTimestamp(), mimeType,
				recommendedFileName, proxy,
				Integer.valueOf((int) uploadedFile.length()), null);
		if (delegate() != null) { 
			delegate().attachmentCreated(this, attachment);
		} 
		try { 
      String key = ERAttachmentProcessor._parsePathTemplate(attachment,
          keyTemplate, recommendedFileName);
      attachment.setWebPath("/" + bucket + "/" + key);
		  attachment.setConfigurationName(configurationName);
			attachment._setPendingUploadFile(uploadedFile, pendingDelete);
		} catch (RuntimeException e) {
			attachment.delete();
			if (pendingDelete) {
				uploadedFile.delete();
			} 
			throw e;
		} 
 
		return attachment;