public class FTPPath extends Object
Converts FTP paths to share/share relative paths.
Constructor and Description |
---|
FTPPath()
Default constructor
|
FTPPath(FTPPath ftpPath)
Copy constructor
|
FTPPath(String ftpPath)
Class constructor
|
FTPPath(String shrName,
String shrPath)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addDirectory(String dir)
Add a directory to the end of the current path
|
void |
addFile(String file)
Add a file to the end of the current path
|
String |
getFTPPath()
Return the FTP path
|
DiskSharedDevice |
getSharedDevice()
Return the shared device
|
String |
getShareName()
Return the share name
|
String |
getSharePath()
Return the share relative path
|
boolean |
hasFTPPath()
Check if the FTP path is valid
|
static boolean |
hasMultipleDirectories(String path)
Check if an FTP path string contains multiple directories
|
boolean |
hasSharedDevice()
Check if the shared device has been set
|
boolean |
hasShareName()
Check if the share name is valid
|
boolean |
hasSharePath()
Check if the share path is valid
|
boolean |
isDirectory()
Determine if the path is for a directory or file
|
static boolean |
isRelativePath(String path)
Check if the FTP path is a relative path, ie.
|
boolean |
isRootPath()
Determine if the current FTP path is the root path
|
boolean |
isRootSharePath()
Check if the share path is the root path
|
String |
makeFTPPathToFile(String fname)
Build an FTP path to the specified file
|
String |
makeSharePathToFile(String fname)
Build a share relative path to the specified file
|
void |
removeDirectory()
Remove the last directory from the end of the path
|
protected void |
setDirectory(boolean dir)
Set/clear the directory path flag
|
void |
setFTPPath(String path)
Set the paths using the specified FTP path
|
boolean |
setSharedDevice(SharedDeviceList shareList,
FTPSrvSession sess)
Set the shared device
|
void |
setSharePath(String shr,
String path)
Set the paths using the specified share and share relative path
|
String |
toString()
Return the FTP path as a string
|
public FTPPath()
public FTPPath(String ftpPath) throws InvalidPathException
ftpPath
- StringInvalidPathException
public FTPPath(String shrName, String shrPath) throws InvalidPathException
shrName
- StringshrPath
- StringInvalidPathException
public FTPPath(FTPPath ftpPath)
ftpPath
- FTPPathpublic final boolean isRootPath()
public final boolean isDirectory()
public final boolean hasFTPPath()
public final String getFTPPath()
public final boolean hasShareName()
public final String getShareName()
public final boolean isRootSharePath()
public final boolean hasSharePath()
public final String getSharePath()
public final boolean hasSharedDevice()
public final DiskSharedDevice getSharedDevice()
public final void setFTPPath(String path) throws InvalidPathException
path
- StringInvalidPathException
public final void setSharePath(String shr, String path) throws InvalidPathException
shr
- Stringpath
- StringInvalidPathException
public final boolean setSharedDevice(SharedDeviceList shareList, FTPSrvSession sess)
shareList
- SharedDeviceListsess
- FTPSrvSessionpublic final String makeFTPPathToFile(String fname)
fname
- Stringpublic final String makeSharePathToFile(String fname)
fname
- Stringpublic final void addDirectory(String dir)
dir
- Stringpublic final void addFile(String file)
file
- Stringpublic final void removeDirectory()
protected final void setDirectory(boolean dir)
dir
- booleanpublic static final boolean hasMultipleDirectories(String path)
path
- Stringpublic static final boolean isRelativePath(String path)
path
- StringCopyright © 2005–2017 Alfresco Software. All rights reserved.