public class NativeFtpFile extends Object implements FtpFile
Modifier | Constructor and Description |
---|---|
protected |
NativeFtpFile(String fileName,
File file,
User user)
Constructor, internal do not use directly.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
createInputStream(long offset)
Create input stream for reading.
|
OutputStream |
createOutputStream(long offset)
Create output stream for writing.
|
boolean |
delete()
Delete file.
|
boolean |
doesExist()
Does this file exists?
|
boolean |
equals(Object obj)
Implements equals by comparing getCanonicalPath() for the underlying file instabnce.
|
String |
getAbsolutePath()
Get full name.
|
String |
getGroupName()
Get group name
|
long |
getLastModified()
Get last modified time.
|
int |
getLinkCount()
Get link count
|
String |
getName()
Get short name.
|
String |
getOwnerName()
Get file owner.
|
File |
getPhysicalFile()
Get the physical file object.
|
static String |
getPhysicalName(String rootDir,
String currDir,
String fileName)
Get the physical canonical file name.
|
static String |
getPhysicalName(String rootDir,
String currDir,
String fileName,
boolean caseInsensitive) |
long |
getSize()
Get file size.
|
int |
hashCode() |
boolean |
isDirectory()
Is it a directory?
|
boolean |
isFile()
Is it a file?
|
boolean |
isHidden()
Is a hidden file?
|
boolean |
isReadable()
Check read permission.
|
boolean |
isRemovable()
Has delete permission.
|
boolean |
isWritable()
Check file write permission.
|
List<FtpFile> |
listFiles()
List files.
|
boolean |
mkdir()
Create directory.
|
boolean |
move(FtpFile dest)
Move file object.
|
static String |
normalizeSeparateChar(String pathName)
Normalize separate character.
|
boolean |
setLastModified(long time)
Set the last modified time stamp of a file
|
public String getAbsolutePath()
getAbsolutePath
in interface FtpFile
public String getName()
public boolean isHidden()
public boolean isDirectory()
isDirectory
in interface FtpFile
FtpFile
is a directorypublic boolean isFile()
public boolean doesExist()
public long getSize()
public String getOwnerName()
getOwnerName
in interface FtpFile
FtpFile
public String getGroupName()
getGroupName
in interface FtpFile
FtpFile
public int getLinkCount()
getLinkCount
in interface FtpFile
FtpFile
public long getLastModified()
getLastModified
in interface FtpFile
FtpFile
public boolean setLastModified(long time)
setLastModified
in interface FtpFile
time
- The last modified time, in milliseconds since the epoch. See File.setLastModified(long)
.public boolean isReadable()
isReadable
in interface FtpFile
FtpFile
is readable by the userpublic boolean isWritable()
isWritable
in interface FtpFile
FtpFile
is writable by the userpublic boolean isRemovable()
isRemovable
in interface FtpFile
FtpFile
is removable by the userpublic boolean delete()
public boolean move(FtpFile dest)
public boolean mkdir()
public File getPhysicalFile()
public List<FtpFile> listFiles()
public OutputStream createOutputStream(long offset) throws IOException
createOutputStream
in interface FtpFile
offset
- The number of bytes at where to start writing.
If the file is not random accessible,
any offset other than zero will throw an exception.OutputStream
used to write to the FtpFile
IOException
public InputStream createInputStream(long offset) throws IOException
createInputStream
in interface FtpFile
offset
- The number of bytes of where to start reading.
If the file is not random accessible,
any offset other than zero will throw an exception.InputStream
used to read the FtpFile
IOException
public static final String normalizeSeparateChar(String pathName)
public static final String getPhysicalName(String rootDir, String currDir, String fileName)
rootDir
- The root directory.currDir
- The current directory. It will always be with respect to the
root directory.fileName
- The input file name.public static final String getPhysicalName(String rootDir, String currDir, String fileName, boolean caseInsensitive)
public boolean equals(Object obj)
Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.