com.ibm.commerce.command

Interface UploadToStreamCmd

  • All Superinterfaces:
    AccCommand, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, ControllerCommand, ECCommand, Protectable, java.io.Serializable, com.ibm.websphere.command.TargetableCommand
    All Known Subinterfaces:
    AttachmentUploadCmd, ContractUploadCmd, RFQAttachmentReplaceCmd, RFQAttachmentUploadCmd, RFQPattributeAttachmentAddCmd, RFQResponseAttachmentUploadCmd, RFQResponsePattributeAttachmentAddCmd
    All Known Implementing Classes:
    AttachmentUploadCmdImpl, ContractUploadCmdImpl, RFQAttachmentReplaceCmdImpl, RFQAttachmentUploadCmdImpl, RFQPattributeAttachmentAddCmdImpl, RFQResponseAttachmentUploadCmdImpl, RFQResponsePattributeAttachmentAddCmdImpl, UploadToStreamCmdImpl


    public interface UploadToStreamCmd
    extends ControllerCommand

    UploadToStreamCmd will upload the file to an InputStream. Note that this is not registered in URL configuration. UploadToStreamCmd is not intended to be used directly. It should be extended by other commands. It will return an InputStream. Any command that uses UploadToStreamCmd can convert the InputStream to whatever format is necessary.

    This is not recommended for uploading a very large file, there may be performance issues.

    If the uploaded file is a JAR or ZIP file the system will not verify whether the JAR or ZIP contains unsupported file types or extensions.

    There is no access control management used with this command. If your command extends from UploadToStreamCmd, you should implement your own access control checking.

    In addition, if your command extends from UploadToStreamCmd, it is required to set up the attachment configuration section in the instance file. For example:

     
     <Attachment display="false"
           maxuploadsize="100000000">
          <Command maxuploadsize="1000000"
          name="MyUploadCmd"
          supportedFileExtension="gif,jpg"
          uploadReturnURL_enabled="false"
          viruscheck="no" />
     </Attachment>
     
     
    • name = MyUploadCmd: This is the command name that extends TempUploadCmd. This must be the command name that is retrieved from the command context.
    • maxuploadsize: This is the maximum allowable upload size for MyUploadCmd. This must be less than the site maxuploadsize.
    • supportedFileExtension: This is the file extension that is allowed to be uploaded.
    • uploadReturnURL_enabled: This indicates whether to return to the URL when the command is completed. The command writers' own commands should set response properties and handle the returns according to their requirements.
    • virusCheck: This indicates whether virusCheck should be enabled. Virus checking is not provided by default.

    This class returns the input stream used to upload the file (inputstream).

    • Field Detail

      • COPYRIGHT

        static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
      • defaultCommandClassName

        static final java.lang.String defaultCommandClassName
        This is the default class.
        See Also:
        Constant Field Values
    • Method Detail

      • getUrl

        java.lang.String getUrl()
        This method gets the return URL when the upload is completed.
        Returns:
        This method returns the return URL of when the upload is completed.
      • getAttachmentStream

        java.io.InputStream getAttachmentStream()
        This method gets the attachment stream from when the upload is completed.
        Returns:
        This method returns an InputStream object that represents the attachment upload stream.
      • getAttachmentOwner

        long getAttachmentOwner()
        This method gets the owner_id of the creator of the uploaded attachment. The owner is the one who logs into the store and performs the command.
        Returns:
        This method returns the owner_id of the person who uploads the attachment.
      • getFileSize

        long getFileSize()
        This method gets the filesize of the uploaded file.
        Returns:
        This method returns the filesize of the uploaded file.
      • getFileName

        java.lang.String getFileName()
        This method gets the filename of the uploaded file.
        Returns:
        This method returns the filename of the uploaded file.