public final class SmbDirectory extends SmbItem
PATH_SEPARATOR, ROOT_PATH| Constructor and Description |
|---|
SmbDirectory(SmbConnection smbConnection)
Create a new SMB directory based on the SMB connection.
|
SmbDirectory(SmbConnection smbConnection,
String pathName)
Create a new SMB directory based on the SMB connection and the path name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
createDirectory()
Create the current directory.
|
SmbDirectory |
createDirectoryInCurrentDirectory(String directoryName)
Create a directory in the current directory.
|
SmbFile |
createFileInCurrentDirectory(String fileName)
Create a file in the current directory.
|
void |
deleteDirectoryRecursively()
Delete the current directory with all its subdirectories and subfiles.
|
void |
ensureExists()
Ensure that the given directory path does exist - if not, the path is created.
|
boolean |
equals(Object object)
Check if the current and the given objects are equals.
|
List<SmbDirectory> |
getDirectories()
Get all directories of the current directory.
|
List<SmbFile> |
getFiles()
Get all files of the current directory.
|
List<SmbItem> |
listItems()
List all files and directories of the current directory.
|
List<SmbItem> |
listItems(Predicate<SmbItem> searchPredicate,
boolean searchRecursive)
List all files and directories that match the search predicate.
|
List<SmbItem> |
listItems(String searchPattern,
boolean searchRecursive)
List all files and directories that match the search pattern.
|
SmbDirectory |
renameTo(String newDirectoryName,
boolean replaceIfExist)
Rename the current item and return it as newly renamed item.
|
buildProperItemPath, getChangeTime, getCreationTime, getDiskShare, getLastAccessTime, getLastWriteTime, getName, getParentPath, getPath, getRootPath, getServerName, getShareName, getSmbConnection, getSmbPath, isDirectory, isExisting, isFile, isHidden, isRootPath, isValidSmbItemNamepublic SmbDirectory(SmbConnection smbConnection, String pathName)
smbConnection - SMB connectionpathName - Path namepublic SmbDirectory(SmbConnection smbConnection)
smbConnection - SMB connectionpublic void ensureExists()
public SmbDirectory createDirectoryInCurrentDirectory(String directoryName)
directoryName - Name of the new directorypublic SmbFile createFileInCurrentDirectory(String fileName)
fileName - Name of the new filepublic void createDirectory()
public void deleteDirectoryRecursively()
public List<SmbDirectory> getDirectories()
public List<SmbFile> getFiles()
public List<SmbItem> listItems()
public List<SmbItem> listItems(Predicate<SmbItem> searchPredicate, boolean searchRecursive)
searchPredicate - Search predicate that is used for testingsearchRecursive - Flag to search recursivepublic List<SmbItem> listItems(String searchPattern, boolean searchRecursive)
searchPattern - Search regex pattern that is used for matchingsearchRecursive - Flag to search recursivepublic SmbDirectory renameTo(String newDirectoryName, boolean replaceIfExist)
Copyright © 2022. All rights reserved.