Package com.hierynomus.smbj.utils
Class SmbFiles
- java.lang.Object
-
- com.hierynomus.smbj.utils.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 sharevoid
mkdirs(DiskShare diskShare, SmbPath path)
Create a set of nested sub-directories in the given path, for example, 2345 \ 3456 \ 4453 \ 123123.txtvoid
mkdirs(DiskShare diskShare, java.lang.String path)
Create a set of nested sub-directories in the given path, for example, 2345 \ 3456 \ 4453 \ 123123.txtstatic 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
-
-
-
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 sharedestPath
- the path to write tosource
- the local Fileoverwrite
- 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 existjava.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 Fileshare
- the sharedestPath
- the path to write tooverwrite
- 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
-
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
-
-