|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.sshd.server.filesystem.NativeSshFile
public class NativeSshFile
Internal class, do not use directly. This class wraps native file object.
Constructor Summary | |
---|---|
protected |
NativeSshFile(String fileName,
File file,
String userName)
Constructor, internal do not use directly. |
Method Summary | |
---|---|
boolean |
create()
Create a new file |
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)
|
String |
getAbsolutePath()
Get full name. |
long |
getLastModified()
Get last modified time. |
String |
getName()
Get short name. |
SshFile |
getParentFile()
Get the immediate parent. |
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. |
void |
handleClose()
Handle post-handle-close functionality. |
boolean |
isDirectory()
Is it a directory? |
boolean |
isExecutable()
Check file exec permission. |
boolean |
isFile()
Is it a file? |
boolean |
isReadable()
Check read permission. |
boolean |
isRemovable()
Has delete permission. |
boolean |
isWritable()
Check file write permission. |
List<SshFile> |
listSshFiles()
List files. |
boolean |
mkdir()
Create directory. |
boolean |
move(SshFile 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 |
void |
truncate()
Truncate file to length 0. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected NativeSshFile(String fileName, File file, String userName)
Method Detail |
---|
public String getAbsolutePath()
getAbsolutePath
in interface SshFile
public String getName()
getName
in interface SshFile
public boolean isDirectory()
isDirectory
in interface SshFile
SshFile
is a directorypublic boolean isFile()
isFile
in interface SshFile
SshFile
is a file, false if it is a directorypublic boolean doesExist()
doesExist
in interface SshFile
SshFile
existspublic long getSize()
getSize
in interface SshFile
SshFile
in bytespublic long getLastModified()
getLastModified
in interface SshFile
SshFile
public boolean setLastModified(long time)
setLastModified
in interface SshFile
time
- The last modified time, in milliseconds since the epoch. See File.setLastModified(long)
.public boolean isReadable()
isReadable
in interface SshFile
SshFile
is readable by the userpublic boolean isWritable()
isWritable
in interface SshFile
SshFile
is writable by the userpublic boolean isExecutable()
isExecutable
in interface SshFile
SshFile
is executable by the userpublic boolean isRemovable()
isRemovable
in interface SshFile
SshFile
is removable by the userpublic SshFile getParentFile()
SshFile
getParentFile
in interface SshFile
public boolean delete()
delete
in interface SshFile
public boolean create() throws IOException
create
in interface SshFile
IOException
- if something wrong happenpublic void truncate() throws IOException
truncate
in interface SshFile
IOException
- if something wrong happenpublic boolean move(SshFile dest)
move
in interface SshFile
dest
- The target SshFile
to move the current SshFile
to
public boolean mkdir()
mkdir
in interface SshFile
public List<SshFile> listSshFiles()
listSshFiles
in interface SshFile
List
of SshFile
spublic OutputStream createOutputStream(long offset) throws IOException
createOutputStream
in interface SshFile
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 SshFile
IOException
public InputStream createInputStream(long offset) throws IOException
createInputStream
in interface SshFile
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 SshFile
IOException
public void handleClose()
SshFile
handleClose
in interface SshFile
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)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |