public class NativeSshFile extends Object implements SshFile
| Modifier | Constructor and Description |
|---|---|
protected |
NativeSshFile(String fileName,
File file,
String userName)
Constructor, internal do not use directly.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
String |
getOwner()
Get owner 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.
|
public String getAbsolutePath()
getAbsolutePath in interface SshFilepublic String getName()
public String getOwner()
public boolean isDirectory()
isDirectory in interface SshFileSshFile is a directorypublic boolean isFile()
public boolean doesExist()
public long getSize()
public 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()
SshFilegetParentFile in interface SshFilepublic boolean delete()
public boolean create()
throws IOException
create in interface SshFileIOException - if something wrong happenpublic void truncate()
throws IOException
truncate in interface SshFileIOException - if something wrong happenpublic boolean move(SshFile dest)
public boolean mkdir()
public List<SshFile> listSshFiles()
listSshFiles in interface SshFileList of SshFilespublic OutputStream createOutputStream(long offset) throws 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 SshFileIOExceptionpublic InputStream createInputStream(long offset) throws 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 SshFileIOExceptionpublic void handleClose()
SshFilehandleClose in interface SshFilepublic 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)
Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.