Class CreateMode

  • All Implemented Interfaces:
    WriteMode

    @ComponentProfile(summary="Create the file, failing if it already exists")
    public class CreateMode
    extends java.lang.Object
    implements WriteMode
    The default write mode which assumes that a new file will be created.

    Uses SMB2CreateDisposition#FILE_CREATE which means that if the file already exists, the operations will fail.

    In the adapter configuration file this class is aliased as smb-create-mode which is the preferred alternative to the fully qualified classname when building your configuration.

    • Constructor Summary

      Constructors 
      Constructor Description
      CreateMode()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.hierynomus.mssmb2.SMB2CreateDisposition fileOpenMode()
      What's the mode for opening the file.
      java.io.OutputStream getOutputStream​(com.hierynomus.smbj.share.File smbFile)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CreateMode

        public CreateMode()
    • Method Detail

      • fileOpenMode

        public com.hierynomus.mssmb2.SMB2CreateDisposition fileOpenMode()
        Description copied from interface: WriteMode
        What's the mode for opening the file.
        Specified by:
        fileOpenMode in interface WriteMode
        Returns:
        one of (probably) FILE_CREATE, FILE_OPEN_IF, FILE_OVERWRITE_IT depend on the type of operation you want to do.
      • getOutputStream

        public java.io.OutputStream getOutputStream​(com.hierynomus.smbj.share.File smbFile)
        Specified by:
        getOutputStream in interface WriteMode