Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.flexstor.common.io.xfile.ftp
Class FtpFile  view FtpFile download FtpFile.java

java.lang.Object
  extended bycom.flexstor.common.io.xfile.ftp.FtpFile
All Implemented Interfaces:
com.flexstor.common.io.xfile.FlexXFileI

public class FtpFile
extends java.lang.Object
implements com.flexstor.common.io.xfile.FlexXFileI


Field Summary
private static boolean debug
           
private  java.lang.String failureMessage
           
private static java.lang.String FILE_SYSTEM_NAME
           
private  boolean isDirectory
           
private  boolean isNew
           
private  long nFileLength
           
private  long nLinks
           
private  java.lang.String presentDirectory
           
private  java.lang.String strFile
           
private  java.lang.String strFileGroup
           
private  java.lang.String strFileName
           
private  java.lang.String strFileOwner
           
private  java.lang.String strFilePermissions
           
private  java.lang.String strModDate
           
private  java.lang.String strModMonth
           
private  java.lang.String strModTime
           
protected  java.lang.String strServerName
           
protected  int strServerPort
           
 
Constructor Summary
FtpFile(FtpFile file, java.lang.String str)
           
FtpFile(java.lang.String str)
           
 
Method Summary
 boolean canRead()
           
 boolean canWrite()
           
private  void collectInitialInfo()
           
 boolean delete()
           
 boolean exists()
           
 java.lang.String[] extendedList()
          An improved method provided to give isDir/isFile information along with the list.
 java.lang.String[] extendedList(com.flexstor.common.io.xfile.XFilenameFilterI filter)
           
 java.lang.String getAbsolutePath()
           
 java.io.BufferedInputStream getBufferedInputStream()
           
 java.io.BufferedInputStream getBufferedInputStream(int bufferSize)
           
 java.io.BufferedOutputStream getBufferedOutputStream()
           
 java.io.BufferedOutputStream getBufferedOutputStream(int bufferSize)
           
 java.io.BufferedReader getBufferedReader()
           
 java.io.BufferedReader getBufferedReader(int bufferSize)
           
 java.io.BufferedWriter getBufferedWriter()
           
 java.io.BufferedWriter getBufferedWriter(int bufferSize)
           
 java.lang.String getFileGroup()
          Returns the name of the group this file belongs to.
 long getFileLinks()
          Returns number of links to the file.
 java.lang.String getFileOwner()
          Returns owner of the file.
 java.lang.String getFilePermissions()
          Returns file permission in format -rwxrwxrwx.
 java.lang.String getFileSeparator()
           
 java.lang.String getFileSystemName()
           
 FtpInputStream getInputStream()
           
 java.lang.String getLocalParent()
           
 java.lang.String getLocalPath()
           
 java.lang.String getLocalUNCPath()
           
 java.lang.String getModDate()
          Returns the date on which the file is modified.
 java.lang.String getModMonth()
          Returns the month, in which the file was modified.
 java.lang.String getModTime()
          Returns the time, when the file was modified last time.
 java.lang.String getName()
           
 FtpOutputStream getOutputStream()
           
 java.lang.String getParent()
           
private  java.lang.String getParentDirectory(java.lang.String file)
           
 java.lang.String getPath()
           
 FtpReader getReader()
           
 java.lang.String getServer()
           
 java.lang.String getUNCPath()
           
 FtpWriter getWriter()
           
 FtpWriter getWriterToAppend()
           
 boolean isAbsolute()
           
 boolean isDirectory()
           
 boolean isFile()
           
 boolean isLocalPath()
           
 long lastModified()
           
 long length()
          Returns the length of the file.
 java.lang.String[] list()
           
 java.lang.String[] list(com.flexstor.common.io.xfile.XFilenameFilterI filter)
           
static void main(java.lang.String[] args)
           
 boolean mkdir()
           
 boolean mkdirs()
           
private  boolean mkStru(java.lang.String path, FtpSession session)
           
private static void print(java.lang.String string)
           
static void printArray(java.lang.String[] arr)
           
 boolean renameTo(com.flexstor.common.io.xfile.FlexXFileI file)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

strFile

private java.lang.String strFile

isDirectory

private boolean isDirectory

presentDirectory

private java.lang.String presentDirectory

strFileName

private java.lang.String strFileName

strModTime

private java.lang.String strModTime

strModDate

private java.lang.String strModDate

strModMonth

private java.lang.String strModMonth

strFileGroup

private java.lang.String strFileGroup

strFileOwner

private java.lang.String strFileOwner

strFilePermissions

private java.lang.String strFilePermissions

nFileLength

private long nFileLength

nLinks

private long nLinks

FILE_SYSTEM_NAME

private static java.lang.String FILE_SYSTEM_NAME

isNew

private boolean isNew

debug

private static final boolean debug
See Also:
Constant Field Values

failureMessage

private final java.lang.String failureMessage
See Also:
Constant Field Values

strServerName

protected java.lang.String strServerName

strServerPort

protected int strServerPort
Constructor Detail

FtpFile

public FtpFile(FtpFile file,
               java.lang.String str)

FtpFile

public FtpFile(java.lang.String str)
Method Detail

collectInitialInfo

private void collectInitialInfo()

lastModified

public long lastModified()
Specified by:
lastModified in interface com.flexstor.common.io.xfile.FlexXFileI

getModTime

public java.lang.String getModTime()
Returns the time, when the file was modified last time.


getModDate

public java.lang.String getModDate()
Returns the date on which the file is modified.


getModMonth

public java.lang.String getModMonth()
Returns the month, in which the file was modified.


length

public long length()
Returns the length of the file.

Specified by:
length in interface com.flexstor.common.io.xfile.FlexXFileI

getFileGroup

public java.lang.String getFileGroup()
Returns the name of the group this file belongs to.


getFileOwner

public java.lang.String getFileOwner()
Returns owner of the file.


getFileLinks

public long getFileLinks()
Returns number of links to the file.


getFilePermissions

public java.lang.String getFilePermissions()
Returns file permission in format -rwxrwxrwx.


getParentDirectory

private java.lang.String getParentDirectory(java.lang.String file)

getReader

public FtpReader getReader()

getInputStream

public FtpInputStream getInputStream()

getWriterToAppend

public FtpWriter getWriterToAppend()

getBufferedInputStream

public java.io.BufferedInputStream getBufferedInputStream()
                                                   throws java.io.IOException
Specified by:
getBufferedInputStream in interface com.flexstor.common.io.xfile.FlexXFileI

getBufferedInputStream

public java.io.BufferedInputStream getBufferedInputStream(int bufferSize)
                                                   throws java.io.IOException
Specified by:
getBufferedInputStream in interface com.flexstor.common.io.xfile.FlexXFileI

getBufferedOutputStream

public java.io.BufferedOutputStream getBufferedOutputStream(int bufferSize)
                                                     throws java.io.IOException
Specified by:
getBufferedOutputStream in interface com.flexstor.common.io.xfile.FlexXFileI

getBufferedReader

public java.io.BufferedReader getBufferedReader(int bufferSize)
                                         throws java.io.IOException
Specified by:
getBufferedReader in interface com.flexstor.common.io.xfile.FlexXFileI

getBufferedWriter

public java.io.BufferedWriter getBufferedWriter(int bufferSize)
                                         throws java.io.IOException
Specified by:
getBufferedWriter in interface com.flexstor.common.io.xfile.FlexXFileI

getBufferedOutputStream

public java.io.BufferedOutputStream getBufferedOutputStream()
                                                     throws java.io.IOException
Specified by:
getBufferedOutputStream in interface com.flexstor.common.io.xfile.FlexXFileI

getBufferedReader

public java.io.BufferedReader getBufferedReader()
                                         throws java.io.IOException
Specified by:
getBufferedReader in interface com.flexstor.common.io.xfile.FlexXFileI

getBufferedWriter

public java.io.BufferedWriter getBufferedWriter()
                                         throws java.io.IOException
Specified by:
getBufferedWriter in interface com.flexstor.common.io.xfile.FlexXFileI

getWriter

public FtpWriter getWriter()

getOutputStream

public FtpOutputStream getOutputStream()

delete

public boolean delete()
Specified by:
delete in interface com.flexstor.common.io.xfile.FlexXFileI

exists

public boolean exists()
Specified by:
exists in interface com.flexstor.common.io.xfile.FlexXFileI

getFileSystemName

public java.lang.String getFileSystemName()
Specified by:
getFileSystemName in interface com.flexstor.common.io.xfile.FlexXFileI

extendedList

public java.lang.String[] extendedList()
An improved method provided to give isDir/isFile information along with the list.

Specified by:
extendedList in interface com.flexstor.common.io.xfile.FlexXFileI

list

public java.lang.String[] list()
Specified by:
list in interface com.flexstor.common.io.xfile.FlexXFileI

isAbsolute

public boolean isAbsolute()
Specified by:
isAbsolute in interface com.flexstor.common.io.xfile.FlexXFileI

isLocalPath

public boolean isLocalPath()
Specified by:
isLocalPath in interface com.flexstor.common.io.xfile.FlexXFileI

isFile

public boolean isFile()
Specified by:
isFile in interface com.flexstor.common.io.xfile.FlexXFileI

isDirectory

public boolean isDirectory()
Specified by:
isDirectory in interface com.flexstor.common.io.xfile.FlexXFileI

getAbsolutePath

public java.lang.String getAbsolutePath()
Specified by:
getAbsolutePath in interface com.flexstor.common.io.xfile.FlexXFileI

getServer

public java.lang.String getServer()
Specified by:
getServer in interface com.flexstor.common.io.xfile.FlexXFileI

extendedList

public java.lang.String[] extendedList(com.flexstor.common.io.xfile.XFilenameFilterI filter)
Specified by:
extendedList in interface com.flexstor.common.io.xfile.FlexXFileI

list

public java.lang.String[] list(com.flexstor.common.io.xfile.XFilenameFilterI filter)
Specified by:
list in interface com.flexstor.common.io.xfile.FlexXFileI

getName

public java.lang.String getName()
Specified by:
getName in interface com.flexstor.common.io.xfile.FlexXFileI

getParent

public java.lang.String getParent()
Specified by:
getParent in interface com.flexstor.common.io.xfile.FlexXFileI

canRead

public boolean canRead()
Specified by:
canRead in interface com.flexstor.common.io.xfile.FlexXFileI

getLocalParent

public java.lang.String getLocalParent()
Specified by:
getLocalParent in interface com.flexstor.common.io.xfile.FlexXFileI

getLocalPath

public java.lang.String getLocalPath()
Specified by:
getLocalPath in interface com.flexstor.common.io.xfile.FlexXFileI

getUNCPath

public java.lang.String getUNCPath()
Specified by:
getUNCPath in interface com.flexstor.common.io.xfile.FlexXFileI

getPath

public java.lang.String getPath()
Specified by:
getPath in interface com.flexstor.common.io.xfile.FlexXFileI

getLocalUNCPath

public java.lang.String getLocalUNCPath()
Specified by:
getLocalUNCPath in interface com.flexstor.common.io.xfile.FlexXFileI

mkdir

public boolean mkdir()
Specified by:
mkdir in interface com.flexstor.common.io.xfile.FlexXFileI

mkdirs

public boolean mkdirs()
Specified by:
mkdirs in interface com.flexstor.common.io.xfile.FlexXFileI

mkStru

private boolean mkStru(java.lang.String path,
                       FtpSession session)

renameTo

public boolean renameTo(com.flexstor.common.io.xfile.FlexXFileI file)
Specified by:
renameTo in interface com.flexstor.common.io.xfile.FlexXFileI

canWrite

public boolean canWrite()
Specified by:
canWrite in interface com.flexstor.common.io.xfile.FlexXFileI

getFileSeparator

public java.lang.String getFileSeparator()
Specified by:
getFileSeparator in interface com.flexstor.common.io.xfile.FlexXFileI

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


printArray

public static void printArray(java.lang.String[] arr)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception

print

private static void print(java.lang.String string)