com.myjavaworld.jftp
Class FTPSession
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JRootPane
com.myjavaworld.jftp.SessionPanel
com.myjavaworld.jftp.FTPSession
- All Implemented Interfaces:
- com.myjavaworld.ftp.ControlConnectionListener, com.myjavaworld.ftp.DataConnectionListener, com.myjavaworld.ftp.FTPConnectionListener, FileChangeListener, ProgressListener, ZipListener, ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible
public class FTPSession
- extends SessionPanel
- implements com.myjavaworld.ftp.FTPConnectionListener, com.myjavaworld.ftp.ControlConnectionListener, com.myjavaworld.ftp.DataConnectionListener, ActionListener, FileChangeListener, ProgressListener, ZipListener
FTP session. Contains the main interface and connection and data transfer
logic.
- Version:
- 2.0
- Author:
- Sai Pullabhotla, psai [at] jMethods [dot] com
- See Also:
- Serialized Form
Fields inherited from class javax.swing.JRootPane |
COLOR_CHOOSER_DIALOG, contentPane, defaultButton, defaultPressAction, defaultReleaseAction, ERROR_DIALOG, FILE_CHOOSER_DIALOG, FRAME, INFORMATION_DIALOG, layeredPane, menuBar, NONE, PLAIN_DIALOG, QUESTION_DIALOG, WARNING_DIALOG |
Method Summary |
void |
actionPerformed(ActionEvent evt)
|
void |
beginFile(ZipEvent evt)
|
void |
changeRemoteFilePermissions(com.myjavaworld.ftp.RemoteFile oldFile,
com.myjavaworld.ftp.RemoteFile newFile,
boolean recursive)
|
void |
clearAbortFlag()
|
void |
closeSession()
|
void |
commandSent(com.myjavaworld.ftp.ControlConnectionEvent evt)
|
void |
connect(RemoteHost remoteHost)
|
void |
connectionClosed(com.myjavaworld.ftp.FTPConnectionEvent evt)
|
void |
connectionDropped(com.myjavaworld.ftp.ControlConnectionEvent evt)
|
void |
connectionException(Exception exp)
|
void |
connectionOpened(com.myjavaworld.ftp.FTPConnectionEvent evt)
|
void |
createLocalDirectory(String dir)
|
void |
createLocalFile(String fileName)
|
void |
createRemoteDirectory(String directory)
|
void |
createRemoteFile(String file)
|
void |
dataTransferAborted(com.myjavaworld.ftp.DataConnectionEvent evt)
|
void |
dataTransferError(com.myjavaworld.ftp.DataConnectionEvent evt)
|
void |
dataTransferFinished(com.myjavaworld.ftp.DataConnectionEvent evt)
|
void |
dataTransferProgress(com.myjavaworld.ftp.DataConnectionEvent evt)
|
void |
dataTransferStarted(com.myjavaworld.ftp.DataConnectionEvent evt)
|
void |
deleteLocalFiles()
|
void |
deleteRemoteFiles()
|
void |
disconnect()
|
void |
download()
|
void |
download(com.myjavaworld.ftp.RemoteFile sourceDir,
File targetDir,
com.myjavaworld.ftp.RemoteFile source)
|
void |
download(com.myjavaworld.ftp.RemoteFile sourceDir,
File targetDir,
com.myjavaworld.ftp.RemoteFile source,
String targetName)
|
void |
downloadDataFile(com.myjavaworld.ftp.RemoteFile source,
File target)
|
File |
downloadToTempFile(com.myjavaworld.ftp.RemoteFile source,
boolean monitor)
|
void |
endFile(ZipEvent evt)
|
void |
exception(Throwable t)
|
void |
executeCommand(String command)
|
void |
executeCommands(String[] commands)
|
void |
fileChanged(FileChangeEvent evt)
|
void |
ftpException(Exception exp)
|
com.myjavaworld.ftp.FTPClient |
getFTPClient()
|
int |
getId()
|
JFTP |
getJFTP()
|
com.myjavaworld.util.Filter |
getLocalFileFilter()
|
int |
getLocalFileSelectionCount()
|
LocalFile |
getLocalWorkingDirectory()
|
com.myjavaworld.util.Filter |
getRemoteFileFilter()
|
int |
getRemoteFileSelectionCount()
|
RemoteHost |
getRemoteHost()
|
com.myjavaworld.ftp.RemoteFile |
getRemoteWorkingDirectory()
|
LocalFile |
getSelectedLocalFile()
|
LocalFile[] |
getSelectedLocalFiles()
|
com.myjavaworld.ftp.RemoteFile |
getSelectedRemoteFile()
|
com.myjavaworld.ftp.RemoteFile[] |
getSelectedRemoteFiles()
|
int |
getTransferType()
|
int |
getTransferType(String ext)
|
void |
invertLocalFileSelection()
|
void |
invertRemoteFileSelection()
|
boolean |
isAutoDetect()
|
boolean |
isConnected()
|
void |
progressChanged(ProgressEvent evt)
|
void |
reconnect()
|
void |
refreshLocalPane()
|
void |
refreshRemotePane()
|
void |
renameLocalFile(String fromName,
String toName)
|
void |
renameRemoteFile(String fromName,
String toName)
|
void |
replyReceived(com.myjavaworld.ftp.ControlConnectionEvent evt)
|
void |
resetStatusBar()
|
void |
selectAllLocalFiles()
|
void |
selectAllRemoteFiles()
|
void |
setAbortFlag(boolean abort)
|
void |
setAutoDetect(boolean autoDetect)
|
void |
setBusy(boolean busy)
|
void |
setLocalFileFilter(com.myjavaworld.util.Filter filter)
|
void |
setLocalWorkingDirectory(LocalFile dir)
|
void |
setLocalWorkingDirectory(String dir)
|
void |
setProgress(int progress)
|
void |
setRemoteFileFilter(com.myjavaworld.util.Filter filter)
|
void |
setRemoteWorkingDirectory(com.myjavaworld.ftp.RemoteFile dir)
|
void |
setRemoteWorkingDirectory(String name)
|
void |
setStatus(String status)
|
void |
setTransferType(int transferType)
|
String |
toString()
|
void |
updateRemoteFile(com.myjavaworld.ftp.RemoteFile oldFile,
com.myjavaworld.ftp.RemoteFile newFile)
|
void |
updateToolBar()
|
void |
upload()
|
void |
upload(LocalFile localFile,
com.myjavaworld.ftp.RemoteFile destination)
|
void |
upload(LocalFile sourceDir,
com.myjavaworld.ftp.RemoteFile targetDir,
LocalFile source)
|
void |
upload(LocalFile sourceDir,
com.myjavaworld.ftp.RemoteFile targetDir,
LocalFile source,
String targetName)
|
void |
upload(LocalFile localFile,
String remoteFileName)
|
void |
upLocalWorkingDirectory()
|
void |
upRemoteWorkingDirectory()
|
Methods inherited from class javax.swing.JRootPane |
addImpl, addNotify, createContentPane, createGlassPane, createLayeredPane, createRootLayout, getAccessibleContext, getContentPane, getDefaultButton, getGlassPane, getJMenuBar, getLayeredPane, getMenuBar, getUI, getUIClassID, getWindowDecorationStyle, isOptimizedDrawingEnabled, isValidateRoot, paramString, removeNotify, setContentPane, setDefaultButton, setDoubleBuffered, setGlassPane, setJMenuBar, setLayeredPane, setMenuBar, setUI, setWindowDecorationStyle, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle |
FTPSession
public FTPSession(JFTP jftp)
fileChanged
public void fileChanged(FileChangeEvent evt)
- Specified by:
fileChanged
in interface FileChangeListener
getId
public int getId()
setBusy
public void setBusy(boolean busy)
- Overrides:
setBusy
in class SessionPanel
setTransferType
public void setTransferType(int transferType)
getTransferType
public int getTransferType()
setAutoDetect
public void setAutoDetect(boolean autoDetect)
isAutoDetect
public boolean isAutoDetect()
getTransferType
public int getTransferType(String ext)
actionPerformed
public void actionPerformed(ActionEvent evt)
- Specified by:
actionPerformed
in interface ActionListener
toString
public String toString()
- Overrides:
toString
in class Component
setLocalFileFilter
public void setLocalFileFilter(com.myjavaworld.util.Filter filter)
- Parameters:
filter
-
getLocalFileFilter
public com.myjavaworld.util.Filter getLocalFileFilter()
- Returns:
- current filter set on local files.
setRemoteFileFilter
public void setRemoteFileFilter(com.myjavaworld.util.Filter filter)
- Parameters:
filter
-
getRemoteFileFilter
public com.myjavaworld.util.Filter getRemoteFileFilter()
- Returns:
- current filter set on local files.
closeSession
public void closeSession()
getRemoteHost
public RemoteHost getRemoteHost()
getFTPClient
public com.myjavaworld.ftp.FTPClient getFTPClient()
setLocalWorkingDirectory
public void setLocalWorkingDirectory(String dir)
setLocalWorkingDirectory
public void setLocalWorkingDirectory(LocalFile dir)
getLocalWorkingDirectory
public LocalFile getLocalWorkingDirectory()
upLocalWorkingDirectory
public void upLocalWorkingDirectory()
refreshLocalPane
public void refreshLocalPane()
setRemoteWorkingDirectory
public void setRemoteWorkingDirectory(String name)
getRemoteWorkingDirectory
public com.myjavaworld.ftp.RemoteFile getRemoteWorkingDirectory()
setRemoteWorkingDirectory
public void setRemoteWorkingDirectory(com.myjavaworld.ftp.RemoteFile dir)
upRemoteWorkingDirectory
public void upRemoteWorkingDirectory()
refreshRemotePane
public void refreshRemotePane()
getLocalFileSelectionCount
public int getLocalFileSelectionCount()
getSelectedLocalFile
public LocalFile getSelectedLocalFile()
getSelectedLocalFiles
public LocalFile[] getSelectedLocalFiles()
getRemoteFileSelectionCount
public int getRemoteFileSelectionCount()
getSelectedRemoteFile
public com.myjavaworld.ftp.RemoteFile getSelectedRemoteFile()
getSelectedRemoteFiles
public com.myjavaworld.ftp.RemoteFile[] getSelectedRemoteFiles()
connectionOpened
public void connectionOpened(com.myjavaworld.ftp.FTPConnectionEvent evt)
- Specified by:
connectionOpened
in interface com.myjavaworld.ftp.FTPConnectionListener
connectionClosed
public void connectionClosed(com.myjavaworld.ftp.FTPConnectionEvent evt)
- Specified by:
connectionClosed
in interface com.myjavaworld.ftp.FTPConnectionListener
commandSent
public void commandSent(com.myjavaworld.ftp.ControlConnectionEvent evt)
- Specified by:
commandSent
in interface com.myjavaworld.ftp.ControlConnectionListener
replyReceived
public void replyReceived(com.myjavaworld.ftp.ControlConnectionEvent evt)
- Specified by:
replyReceived
in interface com.myjavaworld.ftp.ControlConnectionListener
connectionDropped
public void connectionDropped(com.myjavaworld.ftp.ControlConnectionEvent evt)
dataTransferStarted
public void dataTransferStarted(com.myjavaworld.ftp.DataConnectionEvent evt)
- Specified by:
dataTransferStarted
in interface com.myjavaworld.ftp.DataConnectionListener
dataTransferFinished
public void dataTransferFinished(com.myjavaworld.ftp.DataConnectionEvent evt)
- Specified by:
dataTransferFinished
in interface com.myjavaworld.ftp.DataConnectionListener
dataTransferProgress
public void dataTransferProgress(com.myjavaworld.ftp.DataConnectionEvent evt)
- Specified by:
dataTransferProgress
in interface com.myjavaworld.ftp.DataConnectionListener
dataTransferAborted
public void dataTransferAborted(com.myjavaworld.ftp.DataConnectionEvent evt)
- Specified by:
dataTransferAborted
in interface com.myjavaworld.ftp.DataConnectionListener
dataTransferError
public void dataTransferError(com.myjavaworld.ftp.DataConnectionEvent evt)
- Specified by:
dataTransferError
in interface com.myjavaworld.ftp.DataConnectionListener
ftpException
public void ftpException(Exception exp)
exception
public void exception(Throwable t)
connectionException
public void connectionException(Exception exp)
connect
public void connect(RemoteHost remoteHost)
reconnect
public void reconnect()
download
public void download()
download
public void download(com.myjavaworld.ftp.RemoteFile sourceDir,
File targetDir,
com.myjavaworld.ftp.RemoteFile source)
download
public void download(com.myjavaworld.ftp.RemoteFile sourceDir,
File targetDir,
com.myjavaworld.ftp.RemoteFile source,
String targetName)
downloadDataFile
public void downloadDataFile(com.myjavaworld.ftp.RemoteFile source,
File target)
upload
public void upload()
upload
public void upload(LocalFile sourceDir,
com.myjavaworld.ftp.RemoteFile targetDir,
LocalFile source)
upload
public void upload(LocalFile sourceDir,
com.myjavaworld.ftp.RemoteFile targetDir,
LocalFile source,
String targetName)
upload
public void upload(LocalFile localFile,
String remoteFileName)
upload
public void upload(LocalFile localFile,
com.myjavaworld.ftp.RemoteFile destination)
createRemoteDirectory
public void createRemoteDirectory(String directory)
createRemoteFile
public void createRemoteFile(String file)
renameRemoteFile
public void renameRemoteFile(String fromName,
String toName)
changeRemoteFilePermissions
public void changeRemoteFilePermissions(com.myjavaworld.ftp.RemoteFile oldFile,
com.myjavaworld.ftp.RemoteFile newFile,
boolean recursive)
updateRemoteFile
public void updateRemoteFile(com.myjavaworld.ftp.RemoteFile oldFile,
com.myjavaworld.ftp.RemoteFile newFile)
deleteRemoteFiles
public void deleteRemoteFiles()
createLocalDirectory
public void createLocalDirectory(String dir)
createLocalFile
public void createLocalFile(String fileName)
renameLocalFile
public void renameLocalFile(String fromName,
String toName)
deleteLocalFiles
public void deleteLocalFiles()
executeCommand
public void executeCommand(String command)
executeCommands
public void executeCommands(String[] commands)
disconnect
public void disconnect()
isConnected
public boolean isConnected()
downloadToTempFile
public File downloadToTempFile(com.myjavaworld.ftp.RemoteFile source,
boolean monitor)
updateToolBar
public void updateToolBar()
setAbortFlag
public void setAbortFlag(boolean abort)
clearAbortFlag
public void clearAbortFlag()
getJFTP
public JFTP getJFTP()
setStatus
public void setStatus(String status)
resetStatusBar
public void resetStatusBar()
setProgress
public void setProgress(int progress)
progressChanged
public void progressChanged(ProgressEvent evt)
- Specified by:
progressChanged
in interface ProgressListener
beginFile
public void beginFile(ZipEvent evt)
- Specified by:
beginFile
in interface ZipListener
endFile
public void endFile(ZipEvent evt)
- Specified by:
endFile
in interface ZipListener
selectAllLocalFiles
public void selectAllLocalFiles()
invertLocalFileSelection
public void invertLocalFileSelection()
selectAllRemoteFiles
public void selectAllRemoteFiles()
invertRemoteFileSelection
public void invertRemoteFileSelection()
Copyright © 2000-2012 jMethods, Inc.. All Rights Reserved.