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 String |
pathName
Path name of the abstract shared item.
|
protected SharedConnection |
sharedConnection
Shared connection to access the server.
|
| 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.
|
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.
|
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 final SharedConnection sharedConnection
protected final String pathName
public AbstractSharedItem(SharedConnection sharedConnection, String pathName) throws IOException
sharedConnection - Shared connectionpathName - Path nameIOException - Exception in case of a problempublic 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() throws IOException
getParentPath in interface SharedItemIOException - Exception in case of a problempublic T getRootPath() throws IOException
getRootPath in interface SharedItemIOException - Exception in case of a problempublic boolean isRootPath()
isRootPath in interface SharedItempublic abstract boolean equals(Object object)
protected abstract T createSharedNodeItem(String pathName) throws IOException
pathName - Path name of the shared itemIOException - Exception in case of a problemCopyright © 2018. All rights reserved.