FTPIF.java 1.15 KB
package com.sitech.util.upload;

public interface FTPIF {
	/**
	 * 登录
	 * @param host
	 * @param username
	 * @param password
	 * @throws Exception
	 */
	public void login(String host, String username, String password) throws Exception;

	/**
	 * 退出
	 * @param host
	 * @param username
	 * @param password
	 * @throws Exception
	 */
	public void logout() throws Exception;

	/**
	 * 上传文件
	 * 
	 * @param toRfileName 上传的新文件名
	 * @param uploadFile 要上传的文件
	 */
	public boolean store(String uploadFile, String toRfileName)
			throws Exception;
	
	/**
	 * 列出远程目录下面所有的文件
	 * 
	 * @param remoteDir 远程目录
	 */
	public RemoteFile[] listRemoteFile(String remoteDir) throws Exception;
	
	/**
	 * 列出远程目录下面指定的文件
	 * 
	 * @param remoteDir 远程目录
	 * @param fileName 文件名
	 */
	public RemoteFile listRemoteFile(String remoteDir, String fileName) throws Exception;

	public boolean chdir(String remoteDir) throws Exception ;

	public boolean get(String fileName, String localFileName)  throws Exception ;
	
	public boolean rename(String fromName, String toName) throws Exception;
}