|
Secure FTP Factory | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jscape.inet.sftp.SftpFile
The SFTP file. This abstraction hides the implementation details, such as protocol commands etc., and provides full access to the remote file through the common interface.
| Constructor Summary | |
SftpFile(SftpFile parent,
java.lang.String child,
com.jscape.inet.sftp.SftpClient client)
Creates a new SFTP file instance from a parent abstract pathname and a child pathname string. |
|
SftpFile(java.lang.String path,
com.jscape.inet.sftp.SftpClient client)
Creates a new SFTP file instance by converting the given path string into an abstract path. |
|
| Method Summary | |
void |
createNewDirectory()
Creates the directory named by this abstract pathname if and only if a file with this name does not yet exist. |
void |
createNewFile()
Creates a new, empty file named by this abstract pathname if and only if a file with this name does not yet exist. |
void |
createNewLink(JFile target)
Creates the symbolic link named by this abstract pathname if and only if a file with this name does not yet exist. |
void |
delete()
Deletes the file or directory denoted by this abstract pathname. |
void |
deleteRecursive()
Recursively deletes the file or directory denoted by this abstract pathname. |
boolean |
exists()
Tests whether the file denoted by this abstract pathname exists. |
long |
getAccessTime()
Returns the file access time as seconds from Jan 1, 1970 in UTC. |
long |
getAccessTimeNsec()
Returns the additional file access time nano-seconds. |
JAcl[] |
getAcl()
Obtains the file ACL array similar to that defined in section 5.9 of NFS version 4 Protocol |
long |
getCreationTime()
Returns the file creation time as seconds from Jan 1, 1970 in UTC. |
long |
getCreationTimeNsec()
Returns the additional file creation time nano-seconds. |
java.util.Date |
getDate()
Returns the file modification date as Data object. |
java.lang.String |
getFilename()
Returns the name of the file or directory denoted by this abstract pathname. |
long |
getFilesize()
Returns the size of the file denoted by this abstract pathname. |
JFileSystem |
getFileSystem()
Returns the underlayed file system object. |
java.lang.String |
getGroup()
Returns the owner group name for this abstract pathname as string. |
JFile |
getLinkTarget()
Returns the link target if the current file is symbolic link. |
long |
getModificationTime()
Returns the file modification time as seconds from Jan 1, 1970 in UTC. |
long |
getModificationTimeNsec()
Returns the additional file modification time nano-seconds. |
java.lang.String |
getOwner()
Returns the owner name for this abstract pathname as string. |
JFile |
getParentFile()
Returns the abstract pathname of this abstract pathname's parent. |
java.lang.String |
getPath()
Converts this abstract pathname into a pathname string. |
java.lang.String |
getPermission()
Returns POSIX string representation of the file permissions. |
JFilePermissions |
getPermissions()
Returns the POSIX file permissions for this abstract pathname. |
JRandomAccessFile |
getRandomAccessFile(com.jscape.inet.file.JFileOpenFlags openFlags,
JAcl.Mask accessType)
Provides access to the file contents returning a new JRandomAccessFile instance. |
java.lang.String |
getTime()
Returns the file modification time as String. |
JFileType |
getType()
Returns the POSIX file type represented by this abstract pathname. |
boolean |
isAppendOnly()
Tests whether the file named by this abstract pathname can only be opened for writing in append mode. |
boolean |
isArchive()
Tests whether the file named by this abstract pathname should be included in backup / archive operations. |
boolean |
isCaseInsensitive()
This attribute can only apply to directories. |
boolean |
isCompressed()
Tests whether the file named by this abstract pathname is compressed. |
boolean |
isDirectory()
Tests whether the file denoted by this abstract pathname is a directory. |
boolean |
isEncrypted()
Tests whether the file named by this abstract pathname is encrypted. |
boolean |
isHidden()
Tests whether the file named by this abstract pathname is a hidden file. |
boolean |
isImmutable()
Tests whether the file named by this abstract pathname cannot be deleted or renamed, no hard link can be created to this file and no data can be written to the file. |
boolean |
isReadOnly()
Tests whether the file named by this abstract pathname is not writable. |
boolean |
isSparse()
Tests whether the file named by this abstract pathname is sparse. |
boolean |
isSync()
Tests whether the file named by this abstract pathname when is modified, the changes are written synchronously to the disk. |
boolean |
isSystem()
Tests whether the file named by this abstract pathname is part of operating system. |
JFile[] |
listFiles()
Returns an array of abstract pathnames denoting the files in the directory denoted by this abstract pathname. |
JFile[] |
listFiles(com.jscape.inet.file.JFileFilter filter)
Returns an array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname that satisfy the specified filter. |
void |
renameTo(JFile dest)
Renames the file denoted by this abstract pathname. |
void |
setAcl(JAcl[] acls)
Setups the file ACL's. |
void |
setArchive(boolean archive)
Setups archive attribute for this file. |
void |
setGroup(java.lang.String gid)
Setups the new file owner group ID. |
void |
setImmutable(boolean immutable)
Setups file immutability. |
void |
setOwner(java.lang.String uid)
Setups the new file user ID. |
void |
setPermissions(JFilePermissions permissions)
Setups the new file permissions. |
void |
setSync(boolean sync)
Setups file changes synchronization mode. |
java.lang.String |
toString()
Obtains the current file string representation in for as Unix "ls -l" command does, i.e.: "-rw-rw-rw- owner group 23412 Oct 10 2004 10:20 somefile.txt" |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public SftpFile(java.lang.String path,
com.jscape.inet.sftp.SftpClient client)
path - a path stringclient - the underlayed SFTP client
public SftpFile(SftpFile parent,
java.lang.String child,
com.jscape.inet.sftp.SftpClient client)
parent - the parent abstract pathnamechild - the child pathname stringclient - the underlayed SFTP client| Method Detail |
public java.lang.String getFilename()
getFilename in interface JFilepublic java.lang.String getPath()
getPath in interface JFilepublic JFile getParentFile()
getParentFile in interface JFile
public JFileType getType()
throws com.jscape.inet.sftp.SftpException
getType in interface JFilecom.jscape.inet.sftp.SftpException - if an I/O error occured
public boolean isDirectory()
throws com.jscape.inet.sftp.SftpException
isDirectory in interface JFiletrue if and only if the file denoted by this
abstract pathname exists and is a directory; false otherwise
com.jscape.inet.sftp.SftpException - if an I/O error occured
public long getFilesize()
throws com.jscape.inet.sftp.SftpException
getFilesize in interface JFilecom.jscape.inet.sftp.SftpException - if an I/O error occured
public java.lang.String getOwner()
throws com.jscape.inet.sftp.SftpException
getOwner in interface JFilecom.jscape.inet.sftp.SftpException - if an I/O error occured
public void setOwner(java.lang.String uid)
throws com.jscape.inet.sftp.SftpException
setOwner in interface JFileuid - the new file user ID
com.jscape.inet.sftp.SftpException - if an I/O error occured
public java.lang.String getGroup()
throws com.jscape.inet.sftp.SftpException
getGroup in interface JFilecom.jscape.inet.sftp.SftpException - if an I/O error occured
public void setGroup(java.lang.String gid)
throws com.jscape.inet.sftp.SftpException
setGroup in interface JFilegid - the new file owner group ID
com.jscape.inet.sftp.SftpException - if an I/O error occured
public JFilePermissions getPermissions()
throws com.jscape.inet.sftp.SftpException
getPermissions in interface JFilecom.jscape.inet.sftp.SftpException - if an I/O error occured
public java.lang.String getPermission()
throws com.jscape.inet.sftp.SftpException
com.jscape.inet.sftp.SftpException - if an I/O error occured
public void setPermissions(JFilePermissions permissions)
throws com.jscape.inet.sftp.SftpException
setPermissions in interface JFilepermissions - the new file permissions
com.jscape.inet.sftp.SftpException - if an I/O error occured
public long getAccessTime()
throws com.jscape.inet.sftp.SftpException
getAccessTime in interface JFilecom.jscape.inet.sftp.SftpException - if an I/O error occured
public long getAccessTimeNsec()
throws com.jscape.inet.sftp.SftpException
getAccessTimeNsec in interface JFilecom.jscape.inet.sftp.SftpException - if an I/O error occured
public long getCreationTime()
throws com.jscape.inet.sftp.SftpException
getCreationTime in interface JFilecom.jscape.inet.sftp.SftpException - if an I/O error occured
public long getCreationTimeNsec()
throws com.jscape.inet.sftp.SftpException
getCreationTimeNsec in interface JFilecom.jscape.inet.sftp.SftpException
public long getModificationTime()
throws com.jscape.inet.sftp.SftpException
getModificationTime in interface JFilecom.jscape.inet.sftp.SftpException - if an I/O error occured
public long getModificationTimeNsec()
throws com.jscape.inet.sftp.SftpException
getModificationTimeNsec in interface JFilecom.jscape.inet.sftp.SftpException
public java.util.Date getDate()
throws com.jscape.inet.sftp.SftpException
Data object.
Legacy code from the FtpFile.
com.jscape.inet.sftp.SftpException - if an I/O error occured
public java.lang.String getTime()
throws com.jscape.inet.sftp.SftpException
String.
Legacy method from the FtpFile.
String
com.jscape.inet.sftp.SftpException - if an I/O error occured
public JAcl[] getAcl()
throws com.jscape.inet.sftp.SftpException
getAcl in interface JFilecom.jscape.inet.sftp.SftpException - if an I/O error occured
public void setAcl(JAcl[] acls)
throws com.jscape.inet.sftp.SftpException
setAcl in interface JFileacls - the new file ACL's
com.jscape.inet.sftp.SftpException - if an I/O error occured
public boolean isReadOnly()
throws com.jscape.inet.sftp.SftpException
isReadOnly in interface JFiletrue if and only if the file denoted by this
abstract pathname is not writable;
false otherwise
- Throws:
com.jscape.inet.sftp.SftpException - if an I/O error occured
public boolean isSystem()
throws com.jscape.inet.sftp.SftpException
isSystem in interface JFiletrue if and only if the file denoted by this
abstract pathname is part of operation system;
false otherwise
- Throws:
com.jscape.inet.sftp.SftpException - if an I/O error occured
public boolean isHidden()
throws com.jscape.inet.sftp.SftpException
isHidden in interface JFiletrue if and only if the file denoted by this
abstract pathname is hidden according to the conventions
of the underlying platform; false otherwise
- Throws:
com.jscape.inet.sftp.SftpException - if an I/O error occured
public boolean isCaseInsensitive()
throws com.jscape.inet.sftp.SftpException
isCaseInsensitive in interface JFiletrue if and only if files and directory names
in this directory should be compared without regard to case;
false otherwise
- Throws:
com.jscape.inet.sftp.SftpException - if an I/O error occured
public boolean isArchive()
throws com.jscape.inet.sftp.SftpException
isArchive in interface JFiletrue if and only if the file denoted by this
abstract pathname should be included in backup / archive operations;
false otherwise
- Throws:
com.jscape.inet.sftp.SftpException - if an I/O error occured
public void setArchive(boolean archive)
throws com.jscape.inet.sftp.SftpException
setArchive in interface JFilearchive - if true the file denoted by this
abstract pathname should be included in backup / archive operations
com.jscape.inet.sftp.SftpException - if an I/O error occured
public boolean isEncrypted()
throws com.jscape.inet.sftp.SftpException
isEncrypted in interface JFiletrue if and only if the file denoted by this
abstract pathname is encrypted; false otherwise
- Throws:
com.jscape.inet.sftp.SftpException - if an I/O error occured
public boolean isCompressed()
throws com.jscape.inet.sftp.SftpException
isCompressed in interface JFiletrue if and only if the file denoted by this
abstract pathname is compressed; false otherwise
- Throws:
com.jscape.inet.sftp.SftpException - if an I/O error occured
public boolean isSparse()
throws com.jscape.inet.sftp.SftpException
isSparse in interface JFiletrue if and only if the file denoted by this
abstract pathname is sparse; false otherwise
- Throws:
com.jscape.inet.sftp.SftpException - if an I/O error occured
public boolean isAppendOnly()
throws com.jscape.inet.sftp.SftpException
isAppendOnly in interface JFiletrue if and only if the file denoted by this
abstract pathname can only be opened for writing in append mode;
false otherwise
- Throws:
com.jscape.inet.sftp.SftpException - if an I/O error occured
public boolean isImmutable()
throws com.jscape.inet.sftp.SftpException
isImmutable in interface JFiletrue if and only if the file denoted by this
abstract pathname is immutable; false otherwise
- Throws:
com.jscape.inet.sftp.SftpException - if an I/O error occured
public void setImmutable(boolean immutable)
throws com.jscape.inet.sftp.SftpException
setImmutable in interface JFileimmutable - if true the file becames immutable
com.jscape.inet.sftp.SftpException - if an I/O error occured
public boolean isSync()
throws com.jscape.inet.sftp.SftpException
isSync in interface JFiletrue if and only if the file denoted by this
abstract pathname is sync; false otherwise
- Throws:
com.jscape.inet.sftp.SftpException - if an I/O error occured
public void setSync(boolean sync)
throws com.jscape.inet.sftp.SftpException
setSync in interface JFilesync - if true the changes to this file must be written
synchronously to the disk
com.jscape.inet.sftp.SftpException - if an I/O error occured
public boolean exists()
throws com.jscape.inet.sftp.SftpException
exists in interface JFiletrue if and only if the file denoted by
this abstract pathname exists; false otherwise
com.jscape.inet.sftp.SftpException
public void createNewFile()
throws com.jscape.inet.sftp.SftpException
createNewFile in interface JFilecom.jscape.inet.sftp.SftpException - if an I/O error occurred
public void createNewDirectory()
throws com.jscape.inet.sftp.SftpException
createNewDirectory in interface JFilecom.jscape.inet.sftp.SftpException - if an I/O error occurred
public void createNewLink(JFile target)
throws com.jscape.inet.sftp.SftpException
createNewLink in interface JFiletarget - target file for the link
com.jscape.inet.sftp.SftpException - if an I/O error occurred
public void renameTo(JFile dest)
throws com.jscape.inet.sftp.SftpException
renameTo in interface JFiledest - the new abstract pathname for the named file
com.jscape.inet.sftp.SftpException - if an I/O error occurred
public void delete()
throws com.jscape.inet.sftp.SftpException
delete in interface JFilecom.jscape.inet.sftp.SftpException - if an I/O error occurred
public void deleteRecursive()
throws com.jscape.inet.sftp.SftpException
deleteRecursive in interface JFilecom.jscape.inet.sftp.SftpException - if an I/O error occurred
public JFile[] listFiles()
throws com.jscape.inet.sftp.SftpException
listFiles in interface JFilecom.jscape.inet.sftp.SftpException - if an I/O error occurred
public JFile[] listFiles(com.jscape.inet.file.JFileFilter filter)
throws com.jscape.inet.sftp.SftpException
listFiles in interface JFilefilter - a file filter
com.jscape.inet.sftp.SftpException - if an I/O error occurred
public JFile getLinkTarget()
throws com.jscape.inet.sftp.SftpException
getLinkTarget in interface JFilecom.jscape.inet.sftp.SftpException - if an I/O error occured
public JRandomAccessFile getRandomAccessFile(com.jscape.inet.file.JFileOpenFlags openFlags,
JAcl.Mask accessType)
throws com.jscape.inet.sftp.SftpException
getRandomAccessFile in interface JFileopenFlags - the file open flagsaccessType - desired access type
com.jscape.inet.sftp.SftpException - if an I/O error occurredpublic JFileSystem getFileSystem()
getFileSystem in interface JFilepublic java.lang.String toString()
|
Secure FTP Factory | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||