Class SmbFiles


  • public class SmbFiles
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      SmbFiles()  
    • Method Summary

      Modifier and Type Method Description
      static long copy​(java.io.File source, DiskShare share, java.lang.String destPath, boolean overwrite)
      Copies a local file to a destination path on the share
      void mkdirs​(DiskShare diskShare, SmbPath path)
      Create a set of nested sub-directories in the given path, for example, 2345 \ 3456 \ 4453 \ 123123.txt
      void mkdirs​(DiskShare diskShare, java.lang.String path)
      Create a set of nested sub-directories in the given path, for example, 2345 \ 3456 \ 4453 \ 123123.txt
      static long write​(java.io.InputStream source, DiskShare share, java.lang.String destPath, boolean overwrite)
      Writes an input stream to a destination path on the share
      • Methods inherited from class java.lang.Object

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

      • SmbFiles

        public SmbFiles()
    • Method Detail

      • copy

        public static long copy​(java.io.File source,
                                DiskShare share,
                                java.lang.String destPath,
                                boolean overwrite)
                         throws java.io.IOException
        Copies a local file to a destination path on the share
        Parameters:
        share - the share
        destPath - the path to write to
        source - the local File
        overwrite - true/false to overwrite existing file
        Returns:
        the actual number of bytes that was written to the file
        Throws:
        java.io.FileNotFoundException - file with the specified pathname does not exist
        java.io.IOException - file could not be read
      • write

        public static long write​(java.io.InputStream source,
                                 DiskShare share,
                                 java.lang.String destPath,
                                 boolean overwrite)
        Writes an input stream to a destination path on the share
        Parameters:
        source - the local File
        share - the share
        destPath - the path to write to
        overwrite - true/false to overwrite existing file
        Returns:
        the actual number of bytes that was written to the file
      • mkdirs

        public void mkdirs​(DiskShare diskShare,
                           java.lang.String path)
                    throws SMBApiException
        Create a set of nested sub-directories in the given path, for example, 2345 \ 3456 \ 4453 \ 123123.txt
        Throws:
        SMBApiException