public abstract class AbstractDir extends Object implements DirInterface
Modifier and Type | Field and Description |
---|---|
protected String |
currentDir
Current Directory
|
protected static Boolean |
ISUNIX
Hack to say Windows or Unix (root like X:\ or /)
|
protected OptsMLSxInterface |
optsMLSx
Opts command for MLSx. (-1) means not supported, 0 supported but not
active, 1 supported and active
|
protected static File[] |
roots
Roots for Windows system
|
protected SessionInterface |
session
SessionInterface
|
SEPARATOR, SEPARATORCHAR
Constructor and Description |
---|
AbstractDir() |
Modifier and Type | Method and Description |
---|---|
boolean |
changeParentDirectory()
Change for parent directory
|
void |
checkIdentify()
Check if the authentication is correct
|
void |
clear()
Set empty this FtpDir, mark it unReady.
|
protected String |
consolidatePath(String path)
Consolidate Path as relative or absolute path to an absolute path
|
protected String |
getCanonicalPath(File dir)
Construct the CanonicalPath without taking into account symbolic link
|
protected File |
getCorrespondingRoot(File file) |
OptsMLSxInterface |
getOptsMLSx() |
String |
getPwd() |
SessionInterface |
getSession() |
void |
initAfterIdentification()
Init DirInterface after authentication is done
|
boolean |
isAbsolute(String path) |
protected boolean |
isPathInCurrentDir(File dir)
Validate a file according to the current Directory
|
boolean |
isPathInCurrentDir(String path)
Check if the given path is valid in the sens starting from the current
directory
|
static String |
normalizePath(String path)
Normalize Path to Internal unique representation
|
static String |
pathFromURI(String path)
Convert the URI representation of a file path to a simple path.
|
FileInterface |
setFile(String path,
boolean append)
Set a path as the current FileInterface
|
protected String |
validatePath(File dir)
Same as validatePath but from a FileInterface
|
String |
validatePath(String path)
Construct and Check if the given path is valid from business point of
view
(see
AuthInterface ) |
protected abstract List<String> |
wildcardFiles(String pathWithWildcard)
Finds all files matching a wildcard expression (based on '?'
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canRead, canWrite, changeDirectory, changeDirectoryNotChecked, exists, fileFull, getCRC, getDigest, getFreeSpace, getMD5, getModificationTime, getSHA1, isDirectory, isFile, list, listFull, mkdir, newFile, rmdir, setUniqueFile
protected String currentDir
protected SessionInterface session
protected OptsMLSxInterface optsMLSx
protected static final Boolean ISUNIX
protected static final File[] roots
protected File getCorrespondingRoot(File file)
file
- public static String normalizePath(String path)
path
- public static String pathFromURI(String path)
If the path is not an URI, this method does nothing.
path
- public SessionInterface getSession()
getSession
in interface DirInterface
public String validatePath(String path) throws CommandAbstractException
DirInterface
AuthInterface
)validatePath
in interface DirInterface
CommandAbstractException
public boolean isAbsolute(String path)
path
- protected String consolidatePath(String path) throws CommandAbstractException
path
- CommandAbstractException
protected String getCanonicalPath(File dir)
dir
- protected String validatePath(File dir) throws CommandAbstractException
dir
- CommandAbstractException
public boolean isPathInCurrentDir(String path)
DirInterface
isPathInCurrentDir
in interface DirInterface
protected boolean isPathInCurrentDir(File dir)
dir
- CommandAbstractException
protected abstract List<String> wildcardFiles(String pathWithWildcard) throws CommandAbstractException
pathWithWildcard
- The wildcard expression with a business
path.CommandAbstractException
public String getPwd() throws CommandAbstractException
getPwd
in interface DirInterface
CommandAbstractException
public boolean changeParentDirectory() throws CommandAbstractException
DirInterface
changeParentDirectory
in interface DirInterface
CommandAbstractException
public FileInterface setFile(String path, boolean append) throws CommandAbstractException
DirInterface
setFile
in interface DirInterface
append
- True if this file is supposed to be in append mode
(APPE), False in any other casesCommandAbstractException
public void checkIdentify() throws Reply530Exception
DirInterface
checkIdentify
in interface DirInterface
Reply530Exception
public void clear()
DirInterface
clear
in interface DirInterface
public void initAfterIdentification()
DirInterface
initAfterIdentification
in interface DirInterface
public OptsMLSxInterface getOptsMLSx()
getOptsMLSx
in interface DirInterface
Copyright © 2009–2020 Waarp. All rights reserved.