public abstract class SmbItem extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
PATH_SEPARATOR
String used to separate paths.
|
protected static String |
ROOT_PATH
String used to represent the root path.
|
| Constructor and Description |
|---|
SmbItem(SmbConnection smbConnection,
String pathName)
Create a new abstract SMB item based on the SMB connection and the path name.
|
| Modifier and Type | Method and Description |
|---|---|
protected static String |
buildProperItemPath(String path,
String name)
Build the proper item path for a path and a name.
|
abstract boolean |
equals(Object object)
Check if the current and the given objects are equals.
|
com.hierynomus.msdtyp.FileTime |
getChangeTime()
Get the change time of the SMB item.
|
com.hierynomus.msdtyp.FileTime |
getCreationTime()
Get the creation time of the SMB item.
|
protected com.hierynomus.smbj.share.DiskShare |
getDiskShare()
Get the disk share of the SMB connection.
|
com.hierynomus.msdtyp.FileTime |
getLastAccessTime()
Get the last access time of the SMB item.
|
com.hierynomus.msdtyp.FileTime |
getLastWriteTime()
Get the last write time of the SMB item.
|
String |
getName()
Get the name of the SMB item.
|
SmbDirectory |
getParentPath()
Get the parent SMB item.
|
String |
getPath()
Get the path of the SMB item.
|
SmbDirectory |
getRootPath()
Get the root SMB item.
|
String |
getServerName()
Get the server name of the connected server.
|
String |
getShareName()
Get the share name of the connected server.
|
protected SmbConnection |
getSmbConnection()
Get the SMB connection.
|
String |
getSmbPath()
Get the full SMB path including the server, share and path, separated by backslashes.
|
boolean |
isDirectory()
Check if the SMB item is a directory.
|
boolean |
isExisting()
Check if the SMB item does exist.
|
boolean |
isFile()
Check if the SMB item is a file.
|
boolean |
isHidden()
Check if the SMB item is hidden on an SMB level.
|
boolean |
isRootPath()
Check if the current SMB item is the root SMB item.
|
protected static boolean |
isValidSmbItemName(String itemName)
Check if the SMB item name is valid and does not contain some invalid characters
|
abstract SmbItem |
renameTo(String newItemName,
boolean replaceIfExist)
Rename the current item and return it as newly renamed item.
|
protected static final String PATH_SEPARATOR
protected static final String ROOT_PATH
public SmbItem(SmbConnection smbConnection, String pathName)
smbConnection - SMB connectionpathName - Path nameRuntimeException - Exception in case of an invalid path namepublic boolean isExisting()
public boolean isDirectory()
public boolean isFile()
public boolean isHidden()
public String getServerName()
public String getShareName()
public String getName()
public String getPath()
public String getSmbPath()
public SmbDirectory getParentPath()
public SmbDirectory getRootPath()
public boolean isRootPath()
public com.hierynomus.msdtyp.FileTime getCreationTime()
public com.hierynomus.msdtyp.FileTime getLastAccessTime()
public com.hierynomus.msdtyp.FileTime getLastWriteTime()
public com.hierynomus.msdtyp.FileTime getChangeTime()
protected static String buildProperItemPath(String path, String name)
path - Pathname - Name to appendprotected static boolean isValidSmbItemName(String itemName)
itemName - Item name to be checkedpublic abstract boolean equals(Object object)
protected SmbConnection getSmbConnection()
protected com.hierynomus.smbj.share.DiskShare getDiskShare()
public abstract SmbItem renameTo(String newItemName, boolean replaceIfExist)
newItemName - New item namereplaceIfExist - Flag to replace an existing path of the same type (File/Directory)Copyright © 2022. All rights reserved.