|
||||||||||
| 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(java.lang.String fileName,
java.io.File file,
java.lang.String userName)
Constructor, internal do not use directly. |
| Method Summary | |
|---|---|
boolean |
create()
Create a new file |
java.io.InputStream |
createInputStream(long offset)
Create input stream for reading. |
java.io.OutputStream |
createOutputStream(long offset)
Create output stream for writing. |
boolean |
delete()
Delete file. |
boolean |
doesExist()
Does this file exists? |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getAbsolutePath()
Get full name. |
long |
getLastModified()
Get last modified time. |
java.lang.String |
getName()
Get short name. |
SshFile |
getParentFile()
Get the immediate parent. |
static java.lang.String |
getPhysicalName(java.lang.String rootDir,
java.lang.String currDir,
java.lang.String fileName)
Get the physical canonical file name. |
static java.lang.String |
getPhysicalName(java.lang.String rootDir,
java.lang.String currDir,
java.lang.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. |
java.util.List<SshFile> |
listSshFiles()
List files. |
boolean |
mkdir()
Create directory. |
boolean |
move(SshFile dest)
Move file object. |
static java.lang.String |
normalizeSeparateChar(java.lang.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(java.lang.String fileName,
java.io.File file,
java.lang.String userName)
| Method Detail |
|---|
public java.lang.String getAbsolutePath()
getAbsolutePath in interface SshFilepublic java.lang.String getName()
getName in interface SshFilepublic boolean isDirectory()
isDirectory in interface SshFileSshFile is a directorypublic boolean isFile()
isFile in interface SshFileSshFile is a file, false if it is a directorypublic boolean doesExist()
doesExist in interface SshFileSshFile existspublic long getSize()
getSize in interface SshFileSshFile in bytespublic long getLastModified()
getLastModified in interface SshFileSshFilepublic boolean setLastModified(long time)
setLastModified in interface SshFiletime - The last modified time, in milliseconds since the epoch. See File.setLastModified(long).public boolean isReadable()
isReadable in interface SshFileSshFile is readable by the userpublic boolean isWritable()
isWritable in interface SshFileSshFile is writable by the userpublic boolean isExecutable()
isExecutable in interface SshFileSshFile is executable by the userpublic boolean isRemovable()
isRemovable in interface SshFileSshFile is removable by the userpublic SshFile getParentFile()
SshFile
getParentFile in interface SshFilepublic boolean delete()
delete in interface SshFile
public boolean create()
throws java.io.IOException
create in interface SshFilejava.io.IOException - if something wrong happen
public void truncate()
throws java.io.IOException
truncate in interface SshFilejava.io.IOException - if something wrong happenpublic boolean move(SshFile dest)
move in interface SshFiledest - The target SshFile to move the current SshFile to
public boolean mkdir()
mkdir in interface SshFilepublic java.util.List<SshFile> listSshFiles()
listSshFiles in interface SshFileList of SshFiles
public java.io.OutputStream createOutputStream(long offset)
throws java.io.IOException
createOutputStream in interface SshFileoffset - 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
java.io.IOException
public java.io.InputStream createInputStream(long offset)
throws java.io.IOException
createInputStream in interface SshFileoffset - 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
java.io.IOExceptionpublic void handleClose()
SshFile
handleClose in interface SshFilepublic static final java.lang.String normalizeSeparateChar(java.lang.String pathName)
public static final java.lang.String getPhysicalName(java.lang.String rootDir,
java.lang.String currDir,
java.lang.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 java.lang.String getPhysicalName(java.lang.String rootDir,
java.lang.String currDir,
java.lang.String fileName,
boolean caseInsensitive)
public boolean equals(java.lang.Object obj)
equals in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||