T - Generic type that defined a directory/file like node that is used for item creationpublic abstract class AbstractSharedItem<T extends SharedItem> extends Object implements SharedItem
| 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 |
|---|
AbstractSharedItem(SharedConnection sharedConnection,
String pathName)
Create a new abstract shared item based on the shared connection and the path name.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
createSharedNodeItem(String pathName)
Create a new shared item.
|
abstract boolean |
equals(Object object)
Check if the current and the given objects are equals.
|
protected com.hierynomus.smbj.share.DiskShare |
getDiskShare()
Get the disk share of the shared connection.
|
String |
getName()
Get the name of the shared item.
|
T |
getParentPath()
Get the parent shared item.
|
String |
getPath()
Get the path of the shared item.
|
T |
getRootPath()
Get the root shared item.
|
String |
getServerName()
Get the server name of the connected server.
|
protected SharedConnection |
getSharedConnection()
Get the shared connection.
|
String |
getShareName()
Get the share name of the connected server.
|
String |
getSmbPath()
Get the full SMB path including the server, share and path, separated by backslashes.
|
boolean |
isDirectory()
Check if the shared item is a directory.
|
boolean |
isExisting()
Check if the shared item does exist.
|
boolean |
isFile()
Check if the shared item is a file.
|
boolean |
isRootPath()
Check if the current shared item or its parent is the root shared item.
|
protected static final String PATH_SEPARATOR
protected static final String ROOT_PATH
public AbstractSharedItem(SharedConnection sharedConnection, String pathName)
sharedConnection - Shared connectionpathName - Path nameRuntimeException - Exception in case of an invalid path namepublic boolean isExisting()
isExisting in interface SharedItempublic boolean isDirectory()
isDirectory in interface SharedItempublic boolean isFile()
isFile in interface SharedItempublic String getName()
getName in interface SharedItempublic String getServerName()
getServerName in interface SharedItempublic String getShareName()
getShareName in interface SharedItempublic String getPath()
getPath in interface SharedItempublic String getSmbPath()
getSmbPath in interface SharedItempublic T getParentPath()
getParentPath in interface SharedItempublic T getRootPath()
getRootPath in interface SharedItempublic boolean isRootPath()
isRootPath in interface SharedItempublic abstract boolean equals(Object object)
protected SharedConnection getSharedConnection()
protected com.hierynomus.smbj.share.DiskShare getDiskShare()
Copyright © 2018. All rights reserved.