Class SmbFiles

java.lang.Object
com.hierynomus.smbj.utils.SmbFiles

public class SmbFiles extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static long
    copy(File source, DiskShare share, 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, String path)
    Create a set of nested sub-directories in the given path, for example, 2345 \ 3456 \ 4453 \ 123123.txt
    static long
    write(InputStream source, DiskShare share, 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 Details

    • SmbFiles

      public SmbFiles()
  • Method Details

    • copy

      public static long copy(File source, DiskShare share, String destPath, boolean overwrite) throws IOException
      Copies a local file 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
      Throws:
      FileNotFoundException - file with the specified pathname does not exist
      IOException - file could not be read
    • write

      public static long write(InputStream source, DiskShare share, 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, String path) throws SMBApiException
      Create a set of nested sub-directories in the given path, for example, 2345 \ 3456 \ 4453 \ 123123.txt
      Throws:
      SMBApiException
    • mkdirs

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